From: Greg KH <gregkh@linuxfoundation.org>
To: duoming@zju.edu.cn
Cc: linux-staging@lists.linux.dev, davem@davemloft.net,
alexander.deucher@amd.com, kuba@kernel.org, broonie@kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2] staging: rtl8192u: Fix sleep in atomic context bug in dm_fsync_timer_callback
Date: Sat, 25 Jun 2022 11:30:13 +0200 [thread overview]
Message-ID: <YrbVpbKvqdYuY84C@kroah.com> (raw)
In-Reply-To: <482a0dc6.10f76.1819a2a3546.Coremail.duoming@zju.edu.cn>
On Sat, Jun 25, 2022 at 05:21:06PM +0800, duoming@zju.edu.cn wrote:
> Hello,
>
> > > On Thu, Jun 23, 2022 at 01:59:12PM +0800, Duoming Zhou wrote:
> > > > There are sleep in atomic context bugs when dm_fsync_timer_callback is
> > > > executing. The root cause is that the memory allocation functions with
> > > > GFP_KERNEL or GFP_NOIO parameters are called in dm_fsync_timer_callback
> > > > which is a timer handler. The call paths that could trigger bugs are
> > > > shown below:
> > > >
> > > > (interrupt context)
> > > > dm_fsync_timer_callback
> > > > write_nic_byte
> > > > kzalloc(sizeof(data), GFP_KERNEL); //may sleep
> > > > usb_control_msg
> > > > kmalloc(.., GFP_NOIO); //may sleep
> > > > write_nic_dword
> > > > kzalloc(sizeof(data), GFP_KERNEL); //may sleep
> > > > usb_control_msg
> > > > kmalloc(.., GFP_NOIO); //may sleep
> > > >
> > > > This patch uses delayed work to replace timer and moves the operations
> > > > that may sleep into the delayed work in order to mitigate bugs.
> > > >
> > > > Fixes: 8fc8598e61f6 ("Staging: Added Realtek rtl8192u driver to staging")
> > > > Signed-off-by: Duoming Zhou <duoming@zju.edu.cn>
> > > > ---
> > > > Changes in v2:
> > > > - Use delayed work to replace timer.
> > >
> > > Did you test this with real hardware to verify it still works?
> >
> > I am testing this and I will give you feedback within one or two days.
>
> Do you know what vendor id and device id use the r8192u_usb driver?
The vendor/device ids are in the driver itself. Also in the output of
modinfo:
❯ modinfo drivers/staging/rtl8192u/r8192u_usb.ko | grep alias
alias: usb:v043Ep7A01d*dc*dsc*dp*ic*isc*ip*in*
alias: usb:v5A57p0290d*dc*dsc*dp*ic*isc*ip*in*
alias: usb:v2001p3301d*dc*dsc*dp*ic*isc*ip*in*
alias: usb:v1740p9201d*dc*dsc*dp*ic*isc*ip*in*
alias: usb:v0DF6p0031d*dc*dsc*dp*ic*isc*ip*in*
alias: usb:v050Dp805Ed*dc*dsc*dp*ic*isc*ip*in*
alias: usb:v07AAp0043d*dc*dsc*dp*ic*isc*ip*in*
alias: usb:v0BDAp8709d*dc*dsc*dp*ic*isc*ip*in*
see the "v" and "p" portions of the alias string.
thanks,
greg k-h
next prev parent reply other threads:[~2022-06-25 9:30 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-06-23 5:59 [PATCH v2] staging: rtl8192u: Fix sleep in atomic context bug in dm_fsync_timer_callback Duoming Zhou
2022-06-23 9:46 ` Greg KH
2022-06-24 6:02 ` duoming
2022-06-25 9:21 ` duoming
2022-06-25 9:30 ` Greg KH [this message]
2022-07-10 9:44 ` duoming
2022-07-10 10:02 ` Greg KH
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=YrbVpbKvqdYuY84C@kroah.com \
--to=gregkh@linuxfoundation.org \
--cc=alexander.deucher@amd.com \
--cc=broonie@kernel.org \
--cc=davem@davemloft.net \
--cc=duoming@zju.edu.cn \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-staging@lists.linux.dev \
/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