From: Greg KH <greg@kroah.com>
To: Lukasz Majczak <lma@semihalf.com>
Cc: stable@vger.kernel.org, Radoslaw Biernacki <rad@chromium.org>,
Manasi Navare <navaremanasi@chromium.org>
Subject: Re: [PATCH 5.4.y] drm/dp_mst: Fix NULL deref in get_mst_branch_device_by_guid_helper()
Date: Tue, 31 Oct 2023 12:13:16 +0100 [thread overview]
Message-ID: <2023103108-breeching-grumpily-302a@gregkh> (raw)
In-Reply-To: <20231030112904.142092-1-lma@semihalf.com>
On Mon, Oct 30, 2023 at 12:29:04PM +0100, Lukasz Majczak wrote:
> As drm_dp_get_mst_branch_device_by_guid() is called from
> drm_dp_get_mst_branch_device_by_guid(), mstb parameter has to be checked,
> otherwise NULL dereference may occur in the call to
> the memcpy() and cause following:
>
> [12579.365869] BUG: kernel NULL pointer dereference, address: 0000000000000049
> [12579.365878] #PF: supervisor read access in kernel mode
> [12579.365880] #PF: error_code(0x0000) - not-present page
> [12579.365882] PGD 0 P4D 0
> [12579.365887] Oops: 0000 [#1] PREEMPT SMP NOPTI
> ...
> [12579.365895] Workqueue: events_long drm_dp_mst_up_req_work
> [12579.365899] RIP: 0010:memcmp+0xb/0x29
> [12579.365921] Call Trace:
> [12579.365927] get_mst_branch_device_by_guid_helper+0x22/0x64
> [12579.365930] drm_dp_mst_up_req_work+0x137/0x416
> [12579.365933] process_one_work+0x1d0/0x419
> [12579.365935] worker_thread+0x11a/0x289
> [12579.365938] kthread+0x13e/0x14f
> [12579.365941] ? process_one_work+0x419/0x419
> [12579.365943] ? kthread_blkcg+0x31/0x31
> [12579.365946] ret_from_fork+0x1f/0x30
>
> As get_mst_branch_device_by_guid_helper() is recursive, moving condition
> to the first line allow to remove a similar one for step over of NULL elements
> inside a loop.
>
> Fixes: 5e93b8208d3c ("drm/dp/mst: move GUID storage from mgr, port to only mst branch")
> Cc: <stable@vger.kernel.org> # 4.14+
> Signed-off-by: Lukasz Majczak <lma@semihalf.com>
> Reviewed-by: Radoslaw Biernacki <rad@chromium.org>
> Signed-off-by: Manasi Navare <navaremanasi@chromium.org>
> Link: https://patchwork.freedesktop.org/patch/msgid/20230922063410.23626-1-lma@semihalf.com
> (cherry picked from commit 3d887d512494d678b17c57b835c32f4e48d34f26)
> Signed-off-by: Lukasz Majczak <lma@semihalf.com>
> ---
> drivers/gpu/drm/drm_dp_mst_topology.c | 6 +++---
> 1 file changed, 3 insertions(+), 3 deletions(-)
>
All now queued up, thanks.
greg k-h
prev parent reply other threads:[~2023-10-31 11:13 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-10-27 12:21 FAILED: patch "[PATCH] drm/dp_mst: Fix NULL deref in" failed to apply to 5.4-stable tree gregkh
2023-10-30 11:29 ` [PATCH 5.4.y] drm/dp_mst: Fix NULL deref in get_mst_branch_device_by_guid_helper() Lukasz Majczak
2023-10-31 11:13 ` Greg KH [this message]
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=2023103108-breeching-grumpily-302a@gregkh \
--to=greg@kroah.com \
--cc=lma@semihalf.com \
--cc=navaremanasi@chromium.org \
--cc=rad@chromium.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