From: Shuah Khan <skhan@linuxfoundation.org>
To: Adrian Wowk <dev@adrianwowk.com>,
valentina.manea.m@gmail.com, shuah@kernel.org
Cc: i@zenithal.me, gregkh@linuxfoundation.org,
linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org,
Shuah Khan <skhan@linuxfoundation.org>
Subject: Re: [PATCH 1/2] usbip: vhci_hcd: fix NULL deref in status_show_vhci
Date: Tue, 5 May 2026 12:15:32 -0600 [thread overview]
Message-ID: <c14bfdfb-0366-485e-90a9-20293ed126b5@linuxfoundation.org> (raw)
In-Reply-To: <20260414010050.158064-2-dev@adrianwowk.com>
On 4/13/26 19:00, Adrian Wowk wrote:
> platform_get_drvdata() can return NULL if a VHCI host controller's
> probe failed (e.g. due to USB bus number exhaustion). status_show_vhci()
> checked for a NULL pdev but not for a NULL hcd returned by
> platform_get_drvdata(). Passing NULL to hcd_to_vhci_hcd() does not
> return NULL - it returns a pointer offset of 0x260, causing a NULL
> pointer dereference when that value is subsequently dereferenced.
>
> Add a NULL check on hcd before calling hcd_to_vhci_hcd(). Move
> status_show_not_ready() above status_show_vhci() to make it callable
> from the new error path without a forward declaration.
>
> Signed-off-by: Adrian Wowk <dev@adrianwowk.com>
> ---
> drivers/usb/usbip/vhci_sysfs.c | 52 +++++++++++++++++++---------------
> 1 file changed, 29 insertions(+), 23 deletions(-)
>
Looks good to me.
Reviewed-by: Shuah Khan <skhan@linuxfoundation.org>
Greg, Please pick this up.
thanks,
-- Shuah
next prev parent reply other threads:[~2026-05-05 18:15 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-04-14 1:00 [PATCH 0/2] usbip: vhci_hcd: fix NULL deref and NR_HCS upper bound Adrian Wowk
2026-04-14 1:00 ` [PATCH 1/2] usbip: vhci_hcd: fix NULL deref in status_show_vhci Adrian Wowk
2026-05-05 18:15 ` Shuah Khan [this message]
2026-04-14 1:00 ` [PATCH 2/2] usbip: vhci_hcd: reduce CONFIG_USBIP_VHCI_NR_HCS upper bound to 32 Adrian Wowk
2026-05-05 18:15 ` Shuah Khan
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=c14bfdfb-0366-485e-90a9-20293ed126b5@linuxfoundation.org \
--to=skhan@linuxfoundation.org \
--cc=dev@adrianwowk.com \
--cc=gregkh@linuxfoundation.org \
--cc=i@zenithal.me \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
--cc=shuah@kernel.org \
--cc=valentina.manea.m@gmail.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