Loading
drm/client: fix null pointer dereference in drm_client_modeset_probe
stable inclusion from stable-v5.10.224 commit 5291d4f73452c91e8a11f71207617e3e234d418e category: bugfix bugzilla: https://gitee.com/src-openeuler/kernel/issues/IAMM95 CVE: CVE-2024-43894 Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=5291d4f73452c91e8a11f71207617e3e234d418e -------------------------------- commit 113fd6372a5bb3689aba8ef5b8a265ed1529a78f upstream. In drm_client_modeset_probe(), the return value of drm_mode_duplicate() is assigned to modeset->mode, which will lead to a possible NULL pointer dereference on failure of drm_mode_duplicate(). Add a check to avoid npd. Cc: stable@vger.kernel.org Fixes: cf13909a ("drm/fb-helper: Move out modeset config code") Signed-off-by:Ma Ke <make24@iscas.ac.cn> Reviewed-by:
Thomas Zimmermann <tzimmermann@suse.de> Signed-off-by:
Thomas Zimmermann <tzimmermann@suse.de> Link: https://patchwork.freedesktop.org/patch/msgid/20240802044736.1570345-1-make24@iscas.ac.cn Signed-off-by:
Greg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by:
Yongqiang Liu <liuyongqiang13@huawei.com>