From: Tejun Heo <tj@kernel.org>
To: Zqiang <qiang.zhang1211@gmail.com>
Cc: jiangshanlai@gmail.com, syzkaller-bugs@googlegroups.com,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2] workqueue: Fix UAF report by KASAN in pwq_release_workfn()
Date: Tue, 19 Sep 2023 07:44:20 -1000 [thread overview]
Message-ID: <ZQnd9CVWecNqHo5V@slm.duckdns.org> (raw)
In-Reply-To: <ZQndj34e9lOpA8Fm@slm.duckdns.org>
On Tue, Sep 19, 2023 at 07:42:39AM -1000, Tejun Heo wrote:
> Hello,
>
> The patch looks fine but
>
> On Tue, Sep 19, 2023 at 04:19:58PM +0800, Zqiang wrote:
> > @@ -4743,6 +4743,8 @@ struct workqueue_struct *alloc_workqueue(const char *fmt,
> > wq_free_lockdep(wq);
> > err_free_wq:
> > free_workqueue_attrs(wq->unbound_attrs);
>
> Can you please add a comment here explaining why the flushing is necessary?
>
> > + if (wq->flags & WQ_UNBOUND)
> > + kthread_flush_worker(pwq_release_worker);
Hmm... also, wouldn't it be clearer to flush from alloc_and_link_pwqs()
right after apply_workqueue_attrs() failed? That's the only case that
requires flushing, right?
Thanks.
--
tejun
next prev parent reply other threads:[~2023-09-19 17:45 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-09-19 8:19 Zqiang
2023-09-19 17:42 ` Tejun Heo
2023-09-19 17:44 ` Tejun Heo [this message]
2023-09-20 5:00 ` Z qiang
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=ZQnd9CVWecNqHo5V@slm.duckdns.org \
--to=tj@kernel.org \
--cc=jiangshanlai@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=qiang.zhang1211@gmail.com \
--cc=syzkaller-bugs@googlegroups.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
all inboxes | Powered by JetHome®