From: Yunseong Kim <ysk@kzalloc.com>
To: linux-usb@vger.kernel.org, gregkh@linuxfoundation.org,
stern@rowland.harvard.edu
Cc: Andrey Konovalov <andreyknvl@google.com>,
Shuah Khan <skhan@linuxfoundation.org>,
Thomas Gleixner <tglx@linutronix.de>,
Sebastian Andrzej Siewior <bigeasy@linutronix.de>,
Clark Williams <clrkwllms@kernel.org>,
Steven Rostedt <rostedt@goodmis.org>,
linux-rt-users@vger.kernel.org, linux-kernel@vger.kernel.org,
syzkaller@googlegroups.com
Subject: Re: [BUG] usbip: vhci: Sleeping function called from invalid context in vhci_urb_enqueue on PREEMPT_RT
Date: Sat, 16 Aug 2025 10:47:08 +0900 [thread overview]
Message-ID: <b3edc81f-8082-4a7d-9c12-38c44fd3f888@kzalloc.com> (raw)
In-Reply-To: <c6c17f0d-b71d-4a44-bcef-2b65e4d634f7@kzalloc.com>
P.S.
Just to clarify,
On 8/16/25 10:29 AM, Yunseong Kim wrote:
> While testing a PREEMPT_RT enabled kernel (based on v6.17.0-rc1),
> I encountered a "BUG: sleeping function called from invalid context"
> error originating from the USB/IP VHCI driver.
>
> On PREEMPT_RT configurations, standard spin_lock() calls are replaced by
> rt_spin_lock(). Since rt_spin_lock() may sleep when contended, it must not
> be called from an atomic context (e.g., with interrupts disabled).
>
> The issue occurs within the vhci_urb_enqueue function This function
> explicitly disables local interrupts using local_irq_disable() immediately
> before calling usb_hcd_giveback_urb(), adhering to HCD requirements.
>
> This error reported after this work:
> Link: https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git/commit/?h=usb-linus&id=9528d32873b38281ae105f2f5799e79ae9d086c2
To be clear and avoid any misunderstanding, reporting was done after
this work "kcov, usb: Don't disable interrupts in kcov_remote_start_usb_softirq()"
because the fuzzing could proceed smoothly on PREEMPT_RT following this work,
which allowed the issue to be discovered. It does not mean that this step
introduced the error at all.
next prev parent reply other threads:[~2025-08-16 1:47 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-08-16 1:29 [BUG] usbip: vhci: Sleeping function called from invalid context in vhci_urb_enqueue on PREEMPT_RT Yunseong Kim
2025-08-16 1:47 ` Yunseong Kim [this message]
2025-08-16 1:51 ` Alan Stern
2025-08-16 2:18 ` Yunseong Kim
2025-08-16 14:16 ` Alan Stern
2025-08-17 14:27 ` Alan Stern
2025-08-19 11:04 ` Sebastian Andrzej Siewior
2025-08-19 14:12 ` Alan Stern
2025-08-19 14:57 ` Sebastian Andrzej Siewior
2025-08-19 15:44 ` Alan Stern
2025-08-20 16:26 ` Sebastian Andrzej Siewior
2025-08-20 20:53 ` Alan Stern
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=b3edc81f-8082-4a7d-9c12-38c44fd3f888@kzalloc.com \
--to=ysk@kzalloc.com \
--cc=andreyknvl@google.com \
--cc=bigeasy@linutronix.de \
--cc=clrkwllms@kernel.org \
--cc=gregkh@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-rt-users@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
--cc=rostedt@goodmis.org \
--cc=skhan@linuxfoundation.org \
--cc=stern@rowland.harvard.edu \
--cc=syzkaller@googlegroups.com \
--cc=tglx@linutronix.de \
/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