mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Harry Wentland <harry.wentland@amd.com>
To: jackysliu <1972843537@qq.com>
Cc: sunpeng.li@amd.com, siqueira@igalia.com,
	alexander.deucher@amd.com, christian.koenig@amd.com,
	airlied@gmail.com, simona@ffwll.ch, alvin.lee2@amd.com,
	aurabindo.pillai@amd.com, Dillon.Varone@amd.com,
	Austin.Zheng@amd.com, Sung.Lee@amd.com,
	mario.limonciello@amd.com, Wayne.Lin@amd.com, ryanseto@amd.com,
	linux@treblig.org, joshua.aberback@amd.com,
	amd-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org,
	linux-kernel@vger.kernel.org, jackysliu <Security@tencent.com>
Subject: Re: [PATCH] drm/amd/display:fix a Null pointer dereference vulnerability
Date: Thu, 3 Jul 2025 11:15:49 -0400	[thread overview]
Message-ID: <220f9fb4-45ad-4997-9572-564242737dd4@amd.com> (raw)
In-Reply-To: <tencent_4A53F3018A4E9A1EAECFAD853F6952D67B06@qq.com>

On 2025-07-02 23:39, jackysliu wrote:
> A null pointer dereference vulnerability exists in the AMD display driver's
>  (DC module) cleanup function dc_destruct().
>  When display control context (dc->ctx) construction fails
>  (due to memory allocation failure), this pointer remains NULL.
> During subsequent error handling when dc_destruct() is called,
> there's no NULL check before dereferencing the perf_trace member
>  (dc->ctx->perf_trace),
>  causing a kernel null pointer dereference crash
> 
> Signed-off-by: jackysliu <Security@tencent.com>

Thanks for your patch.

Please run and fix this checkpatch.pl warning:

WARNING: From:/Signed-off-by: email address mismatch: 'From: jackysliu <1972843537@qq.com>' != 'Signed-off-by: jackysliu <Security@tencent.com>'

> ---
>  drivers/gpu/drm/amd/display/dc/core/dc.c | 6 ++++++
>  1 file changed, 6 insertions(+)
> 
> diff --git a/drivers/gpu/drm/amd/display/dc/core/dc.c b/drivers/gpu/drm/amd/display/dc/core/dc.c
> index 56d011a1323c..3bda0593f66f 100644
> --- a/drivers/gpu/drm/amd/display/dc/core/dc.c
> +++ b/drivers/gpu/drm/amd/display/dc/core/dc.c
> @@ -934,6 +934,11 @@ static void dc_destruct(struct dc *dc)
>  	if (dc->link_srv)
>  		link_destroy_link_service(&dc->link_srv);
>  
> +	if (!dc->ctx) {
> +		dm_error("%s: called with NULL ctx\n", __func__);
> +		goto skip_ctx_cleanup;
> +	}
> +

I would prefer to simply wrap the dc->ctx->logger and dc->ctx bits
with if (!dc->ctx) and avoid the goto.

Harry

>  	if (dc->ctx->gpio_service)
>  		dal_gpio_service_destroy(&dc->ctx->gpio_service);
>  
> @@ -946,6 +951,7 @@ static void dc_destruct(struct dc *dc)
>  	kfree(dc->ctx);
>  	dc->ctx = NULL;
>  
> +skip_ctx_cleanup:
>  	kfree(dc->bw_vbios);
>  	dc->bw_vbios = NULL;
>  


  reply	other threads:[~2025-07-03 15:15 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-07-03  3:39 jackysliu
2025-07-03 15:15 ` Harry Wentland [this message]
2025-07-04  3:11   ` jackysliu
2025-07-04  3:16   ` [PATCH v2] " jackysliu
2025-07-15 10:44     ` Krzysztof Kozlowski
2025-07-15 21:29       ` Mario Limonciello
2025-07-16  3:10       ` [PATCH] scsi:bfa: Double-free vulnerability fix jackysliu
2025-07-16  3:37       ` [PATCH v2] drm/amd/display:fix a Null pointer dereference vulnerability jackysliu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=220f9fb4-45ad-4997-9572-564242737dd4@amd.com \
    --to=harry.wentland@amd.com \
    --cc=1972843537@qq.com \
    --cc=Austin.Zheng@amd.com \
    --cc=Dillon.Varone@amd.com \
    --cc=Security@tencent.com \
    --cc=Sung.Lee@amd.com \
    --cc=Wayne.Lin@amd.com \
    --cc=airlied@gmail.com \
    --cc=alexander.deucher@amd.com \
    --cc=alvin.lee2@amd.com \
    --cc=amd-gfx@lists.freedesktop.org \
    --cc=aurabindo.pillai@amd.com \
    --cc=christian.koenig@amd.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=joshua.aberback@amd.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@treblig.org \
    --cc=mario.limonciello@amd.com \
    --cc=ryanseto@amd.com \
    --cc=simona@ffwll.ch \
    --cc=siqueira@igalia.com \
    --cc=sunpeng.li@amd.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®