mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Pengfei Xu <pengfei.xu@intel.com>
To: Jens Axboe <axboe@kernel.dk>
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: Tue, 28 Mar 2023 10:48:06 +0800	[thread overview]
Message-ID: <ZCJVZk4nfosZzA1k@xpf.sh.intel.com> (raw)
In-Reply-To: <d6818b66-e1c8-e2bf-e54f-73d1f83db020@kernel.dk>

Hi Jens Axboe,

On 2023-03-27 at 07:35:59 -0600, Jens Axboe wrote:
> 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);
> 
  Thanks for your fixed patch in short time!

  After receiving this email, I saw one of your newly improved fixed patch.
  I will verify the new one soon.

  Thanks!
  BR.
  -Pengfei

> -- 
> Jens Axboe
> 

      reply	other threads:[~2023-03-28  2:46 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-27  6:08 Pengfei Xu
2023-03-27 13:35 ` Jens Axboe
2023-03-28  2:48   ` Pengfei Xu [this message]

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=ZCJVZk4nfosZzA1k@xpf.sh.intel.com \
    --to=pengfei.xu@intel.com \
    --cc=axboe@kernel.dk \
    --cc=heng.su@intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lkp@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

all inboxes | Powered by JetHome®