lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <rljy4kzfb2zdecshtbbqy5lg22ejw4yrjao5dedwh43icq3h5c@zj7cwppkllr2>
Date: Tue, 7 Jan 2025 11:35:32 +0200
From: Dmitry Baryshkov <dmitry.baryshkov@...aro.org>
To: Cristian Ciocaltea <cristian.ciocaltea@...labora.com>
Cc: Maarten Lankhorst <maarten.lankhorst@...ux.intel.com>, 
	Maxime Ripard <mripard@...nel.org>, Thomas Zimmermann <tzimmermann@...e.de>, 
	David Airlie <airlied@...il.com>, Simona Vetter <simona@...ll.ch>, 
	Dave Stevenson <dave.stevenson@...pberrypi.com>, kernel@...labora.com, dri-devel@...ts.freedesktop.org, 
	linux-kernel@...r.kernel.org
Subject: Re: [PATCH] drm/connector: hdmi: Handle NULL display mode in state
 check helper

On Tue, Jan 07, 2025 at 02:00:35AM +0200, Cristian Ciocaltea wrote:
> drm_atomic_helper_connector_hdmi_check() helper makes use of
> connector_state_get_mode() to obtain a drm_display_mode pointer, but it
> doesn't validate it, which may lead to a NULL pointer dereference in
> some cases, i.e. unloading a DRM module:
> 
> [ 1002.910414] Unable to handle kernel NULL pointer dereference at virtual address 0000000000000000
> [...]
> [ 1002.923833] Hardware name: Radxa ROCK 5B (DT)
> [ 1002.924819] pc : drm_match_cea_mode+0x30/0x280 [drm]
> [ 1002.925318] lr : hdmi_try_format_bpc+0x7c/0x580 [drm_display_helper]
> [...]
> [ 1002.932411] Call trace:
> [ 1002.932626]  drm_match_cea_mode+0x30/0x280 [drm] (P)
> [ 1002.933120]  hdmi_try_format_bpc+0x7c/0x580 [drm_display_helper]
> [ 1002.933662]  drm_atomic_helper_connector_hdmi_check+0x10c/0x478 [drm_display_helper]
> [ 1002.934355]  drm_bridge_connector_atomic_check+0x20/0x40 [drm_display_helper]
> [ 1002.934993]  drm_atomic_helper_check_modeset+0x698/0xd28 [drm_kms_helper]
> [ 1002.935607]  drm_atomic_helper_check+0x28/0xb8 [drm_kms_helper]
> [ 1002.936143]  drm_atomic_check_only+0x794/0x988 [drm]
> [ 1002.936635]  drm_atomic_commit+0x60/0xe0 [drm]
> [ 1002.937082]  drm_atomic_helper_disable_all+0x184/0x218 [drm_kms_helper]
> [ 1002.937678]  drm_atomic_helper_shutdown+0x90/0x150 [drm_kms_helper]
> [ 1002.938243]  rockchip_drm_unbind+0x38/0x80 [rockchipdrm]
> [ 1002.938720]  component_master_del+0xac/0xf8
> [ 1002.939089]  rockchip_drm_platform_remove+0x34/0x78 [rockchipdrm]
> [...]
> 
> Add the missing NULL check before passing the mode pointer further.
> 
> Fixes: f035f4097f1e ("drm/connector: hdmi: Calculate TMDS character rate")
> Signed-off-by: Cristian Ciocaltea <cristian.ciocaltea@...labora.com>
> ---
>  drivers/gpu/drm/display/drm_hdmi_state_helper.c | 3 +++
>  1 file changed, 3 insertions(+)
> 

Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@...aro.org>

-- 
With best wishes
Dmitry

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ