[PATCH 0/6] Rockchip DRM use-after-free & null-ptr-deref fixes

Cristian Ciocaltea posted 6 patches 2 weeks, 3 days ago
drivers/gpu/drm/rockchip/dw_dp-rockchip.c      | 35 ++++++++++----------------
drivers/gpu/drm/rockchip/dw_hdmi_qp-rockchip.c | 13 +++++-----
drivers/gpu/drm/rockchip/inno_hdmi-rockchip.c  |  3 ++-
3 files changed, 21 insertions(+), 30 deletions(-)
[PATCH 0/6] Rockchip DRM use-after-free & null-ptr-deref fixes
Posted by Cristian Ciocaltea 2 weeks, 3 days ago
The first three patches in the series are fixes for use-after-free &
null-ptr-deref related issues found in dw_dp and inno-hdmi Rockchip DRM
drivers.

The remaining ones provide a few minor improvements to dw_dp and
dw_hdmi_qp.

Signed-off-by: Cristian Ciocaltea <cristian.ciocaltea@collabora.com>
---
Cristian Ciocaltea (6):
      drm/rockchip: inno-hdmi: Switch to drmm_kzalloc()
      drm/rockchip: dw_dp: Switch to drmm_kzalloc()
      drm/rockchip: dw_dp: Fix null-ptr-deref in dw_dp_remove()
      drm/rockchip: dw_dp: Simplify error handling
      drm/rockchip: dw_dp: Drop unnecessary #include
      drm/rockchip: dw_hdmi_qp: Switch to drmm_encoder_init()

 drivers/gpu/drm/rockchip/dw_dp-rockchip.c      | 35 ++++++++++----------------
 drivers/gpu/drm/rockchip/dw_hdmi_qp-rockchip.c | 13 +++++-----
 drivers/gpu/drm/rockchip/inno_hdmi-rockchip.c  |  3 ++-
 3 files changed, 21 insertions(+), 30 deletions(-)
---
base-commit: 68b271a3a94cfd6c7695a96b6398b52feb89e2c2
change-id: 20260122-drm-rk-fixes-a7622c71553e
Re: [PATCH 0/6] Rockchip DRM use-after-free & null-ptr-deref fixes
Posted by Maxime Ripard 2 weeks, 2 days ago
On Thu, Jan 22, 2026 at 01:17:33AM +0200, Cristian Ciocaltea wrote:
> The first three patches in the series are fixes for use-after-free &
> null-ptr-deref related issues found in dw_dp and inno-hdmi Rockchip DRM
> drivers.
> 
> The remaining ones provide a few minor improvements to dw_dp and
> dw_hdmi_qp.
> 
> Signed-off-by: Cristian Ciocaltea <cristian.ciocaltea@collabora.com>

Just FYI, you'll also need to sprinkle the driver with
drm_dev_enter/exit to make this actually safe.

Maxime
Re: [PATCH 0/6] Rockchip DRM use-after-free & null-ptr-deref fixes
Posted by Cristian Ciocaltea 2 weeks, 1 day ago
On 1/22/26 5:21 PM, Maxime Ripard wrote:
> On Thu, Jan 22, 2026 at 01:17:33AM +0200, Cristian Ciocaltea wrote:
>> The first three patches in the series are fixes for use-after-free &
>> null-ptr-deref related issues found in dw_dp and inno-hdmi Rockchip DRM
>> drivers.
>>
>> The remaining ones provide a few minor improvements to dw_dp and
>> dw_hdmi_qp.
>>
>> Signed-off-by: Cristian Ciocaltea <cristian.ciocaltea@collabora.com>
> 
> Just FYI, you'll also need to sprinkle the driver with
> drm_dev_enter/exit to make this actually safe.

Thanks for the heads up!

Cristian
Re: [PATCH 0/6] Rockchip DRM use-after-free & null-ptr-deref fixes
Posted by Chaoyi Chen 2 weeks, 3 days ago
Hi Cristian,

On 1/22/2026 7:17 AM, Cristian Ciocaltea wrote:
> The first three patches in the series are fixes for use-after-free &
> null-ptr-deref related issues found in dw_dp and inno-hdmi Rockchip DRM
> drivers.
> 

Have you tried calling unbind() and bind() multiple times? 
In this case, can DRM still work properly?

> The remaining ones provide a few minor improvements to dw_dp and
> dw_hdmi_qp.
> 
> Signed-off-by: Cristian Ciocaltea <cristian.ciocaltea@collabora.com>
> ---
> Cristian Ciocaltea (6):
>       drm/rockchip: inno-hdmi: Switch to drmm_kzalloc()
>       drm/rockchip: dw_dp: Switch to drmm_kzalloc()
>       drm/rockchip: dw_dp: Fix null-ptr-deref in dw_dp_remove()
>       drm/rockchip: dw_dp: Simplify error handling
>       drm/rockchip: dw_dp: Drop unnecessary #include
>       drm/rockchip: dw_hdmi_qp: Switch to drmm_encoder_init()
> 
>  drivers/gpu/drm/rockchip/dw_dp-rockchip.c      | 35 ++++++++++----------------
>  drivers/gpu/drm/rockchip/dw_hdmi_qp-rockchip.c | 13 +++++-----
>  drivers/gpu/drm/rockchip/inno_hdmi-rockchip.c  |  3 ++-
>  3 files changed, 21 insertions(+), 30 deletions(-)
> ---
> base-commit: 68b271a3a94cfd6c7695a96b6398b52feb89e2c2
> change-id: 20260122-drm-rk-fixes-a7622c71553e
> 
> 
> 
> 
-- 
Best, 
Chaoyi
Re: [PATCH 0/6] Rockchip DRM use-after-free & null-ptr-deref fixes
Posted by Cristian Ciocaltea 2 weeks, 1 day ago
Hi Chaoyi,

On 1/22/26 4:27 AM, Chaoyi Chen wrote:
> Hi Cristian,
> 
> On 1/22/2026 7:17 AM, Cristian Ciocaltea wrote:
>> The first three patches in the series are fixes for use-after-free &
>> null-ptr-deref related issues found in dw_dp and inno-hdmi Rockchip DRM
>> drivers.
>>
> 
> Have you tried calling unbind() and bind() multiple times? 
> In this case, can DRM still work properly?

Do you have any specific usecase in mind?

The tests performed so far were mostly focused on reloading the rockchipdrm
module, which is how I actually noticed those issues.

Regards,
Cristian
Re: [PATCH 0/6] Rockchip DRM use-after-free & null-ptr-deref fixes
Posted by Chaoyi Chen 1 week, 6 days ago
Hi Cristian, 

On 1/24/2026 7:18 AM, Cristian Ciocaltea wrote:
> Do you have any specific usecase in mind?
> 
> The tests performed so far were mostly focused on reloading the rockchipdrm
> module, which is how I actually noticed those issues.

Ah, if that's the case, then there's no problem. Thank you!

-- 
Best, 
Chaoyi