From: Markus Elfring <Markus.Elfring@web.de>
To: Ma Ke <make24@iscas.ac.cn>,
nouveau@lists.freedesktop.org, dri-devel@lists.freedesktop.org,
Daniel Vetter <daniel@ffwll.ch>,
Danilo Krummrich <dakr@redhat.com>,
David Airlie <airlied@gmail.com>,
Karol Herbst <kherbst@redhat.com>, Lyude Paul <lyude@redhat.com>
Cc: stable@vger.kernel.org, LKML <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] drm/nouveau/dispnv04: fix null pointer dereference in nv17_tv_get_hd_modes
Date: Tue, 25 Jun 2024 16:34:17 +0200 [thread overview]
Message-ID: <c7969a4e-61aa-479f-89c8-0373e84c43be@web.de> (raw)
In-Reply-To: <20240625081029.2619437-1-make24@iscas.ac.cn>
> In nv17_tv_get_hd_modes(), the return value of drm_mode_duplicate() is
> assigned to mode, which will lead to a possible NULL pointer dereference
> on failure of drm_mode_duplicate(). The same applies to drm_cvt_mode().
> Add a check to avoid null pointer dereference.
Can a wording approach (like the following) be a better change description?
A null pointer is stored in the local variable “mode” after a call
of the function “drm_cvt_mode” or “drm_mode_duplicate” failed.
This pointer was used in subsequent statements where an undesirable
dereference will be performed then.
Thus add corresponding return value checks.
> Cc: stable@vger.kernel.org
Would you like to add the tag “Fixes” accordingly?
How do you think about to use a summary phrase like
“Prevent null pointer dereferences in nv17_tv_get_hd_modes()”?
Regards,
Markus
next prev parent reply other threads:[~2024-06-25 14:34 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-06-25 8:10 [PATCH] drm/nouveau/dispnv04: fix null pointer dereference in nv17_tv_get_hd_modes Ma Ke
2024-06-25 14:34 ` Markus Elfring [this message]
2024-06-25 19:11 ` Lyude Paul
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=c7969a4e-61aa-479f-89c8-0373e84c43be@web.de \
--to=markus.elfring@web.de \
--cc=airlied@gmail.com \
--cc=dakr@redhat.com \
--cc=daniel@ffwll.ch \
--cc=dri-devel@lists.freedesktop.org \
--cc=kherbst@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=lyude@redhat.com \
--cc=make24@iscas.ac.cn \
--cc=nouveau@lists.freedesktop.org \
--cc=stable@vger.kernel.org \
/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