[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <d6818b66-e1c8-e2bf-e54f-73d1f83db020@kernel.dk>
Date: Mon, 27 Mar 2023 07:35:59 -0600
From: Jens Axboe <axboe@...nel.dk>
To: Pengfei Xu <pengfei.xu@...el.com>
Cc: stable@...r.kernel.org, linux-kernel@...r.kernel.org,
heng.su@...el.com, lkp@...el.com
Subject: Re: [Syzkaller & bisect] There is "io_poll_remove_entries" NULL
pointer BUG in v6.3-rc4 kernel
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
Powered by blists - more mailing lists