From: Jens Axboe <axboe@kernel.dk>
To: Pengfei Xu <pengfei.xu@intel.com>
Cc: stable@vger.kernel.org, linux-kernel@vger.kernel.org,
heng.su@intel.com, lkp@intel.com
Subject: Re: [Syzkaller & bisect] There is "io_poll_remove_entries" NULL pointer BUG in v6.3-rc4 kernel
Date: Mon, 27 Mar 2023 07:35:59 -0600 [thread overview]
Message-ID: <d6818b66-e1c8-e2bf-e54f-73d1f83db020@kernel.dk> (raw)
In-Reply-To: <ZCEy5jA2nT/vaO56@xpf.sh.intel.com>
On 3/27/23 12:08?AM, Pengfei Xu wrote:
> Hi Jens Axboe and kernel experts,
>
> Platform: x86 platforms
> There is "io_poll_remove_entries" NULL pointer BUG in v6.3-rc4 kernel.
>
> All detailed log: https://github.com/xupengfe/syzkaller_logs/tree/main/230327_041425_io_poll_remove_entries
> Syzkaller reproduced code: https://github.com/xupengfe/syzkaller_logs/blob/main/230327_041425_io_poll_remove_entries/repro.c
> Syzkaller analysis report0: https://github.com/xupengfe/syzkaller_logs/blob/main/230327_041425_io_poll_remove_entries/report0
> Syzkaller analysis status: https://github.com/xupengfe/syzkaller_logs/blob/main/230327_041425_io_poll_remove_entries/repro.stats
> v6.3-rc4 issue dmesg: https://github.com/xupengfe/syzkaller_logs/blob/main/230327_041425_io_poll_remove_entries/v63rc4_reproduce_dmesg.log
> Kconfig: https://github.com/xupengfe/syzkaller_logs/blob/main/230327_041425_io_poll_remove_entries/kconfig_origin
> Bisect info: https://github.com/xupengfe/syzkaller_logs/blob/main/230327_041425_io_poll_remove_entries/bisect_info.log
>
> It could be reproduced in v6.3-rc3 and v6.3-rc4 kernel, and bisected between
> v6.3-rc3 and v5.11 kernel, bad commit was:
> "
> c16bda37594f83147b167d381d54c010024efecf
> io_uring/poll: allow some retries for poll triggering spuriously
> "
> After reverted above commit on top of v6.3-rc3 kernel, this issue was gone.
This should probably fix it, though I do wonder why this can only
trigger after that patch. Seems like it would've been possible before
too.
diff --git a/io_uring/poll.c b/io_uring/poll.c
index 795facbd0e9f..90555a22a900 100644
--- a/io_uring/poll.c
+++ b/io_uring/poll.c
@@ -600,7 +600,8 @@ static int __io_arm_poll_handler(struct io_kiocb *req,
mask = vfs_poll(req->file, &ipt->pt) & poll->events;
if (unlikely(ipt->error || !ipt->nr_entries)) {
- io_poll_remove_entries(req);
+ if (ipt->nr_entries)
+ io_poll_remove_entries(req);
if (!io_poll_can_finish_inline(req, ipt)) {
io_poll_mark_cancelled(req);
--
Jens Axboe
next prev parent reply other threads:[~2023-03-27 13:36 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-03-27 6:08 [Syzkaller & bisect] There is "io_poll_remove_entries" NULL pointer BUG in v6.3-rc4 kernel Pengfei Xu
2023-03-27 13:35 ` Jens Axboe [this message]
2023-03-28 2:48 ` Pengfei Xu
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=d6818b66-e1c8-e2bf-e54f-73d1f83db020@kernel.dk \
--to=axboe@kernel.dk \
--cc=heng.su@intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=lkp@intel.com \
--cc=pengfei.xu@intel.com \
--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