public inbox for io-uring@vger.kernel.org
 help / color / mirror / Atom feed
From: Hillf Danton <hdanton@sina.com>
To: syzbot <syzbot+01523a0ae5600aef5895@syzkaller.appspotmail.com>
Cc: axboe@kernel.dk, io-uring@vger.kernel.org,
	linux-kernel@vger.kernel.org, syzkaller-bugs@googlegroups.com
Subject: Re: [syzbot] [io-uring?] KASAN: slab-use-after-free Read in io_poll_remove_entries
Date: Sun, 20 Jul 2025 08:36:06 +0800	[thread overview]
Message-ID: <20250720003607.2491-1-hdanton@sina.com> (raw)
In-Reply-To: <687bd5fe.a70a0220.693ce.0091.GAE@google.com>

> Date: Sat, 19 Jul 2025 10:29:34 -0700	[thread overview]
> Hello,
> 
> syzbot found the following issue on:
> 
> HEAD commit:    4871b7cb27f4 Merge tag 'v6.16-rc6-smb3-client-fixes' of gi..
> git tree:       upstream
> console output: https://syzkaller.appspot.com/x/log.txt?x=1288c38c580000
> kernel config:  https://syzkaller.appspot.com/x/.config?x=fa738a4418f051ee
> dashboard link: https://syzkaller.appspot.com/bug?extid=01523a0ae5600aef5895
> compiler:       gcc (Debian 12.2.0-14) 12.2.0, GNU ld (GNU Binutils for Debian) 2.40
> syz repro:      https://syzkaller.appspot.com/x/repro.syz?x=1688c38c580000
> C reproducer:   https://syzkaller.appspot.com/x/repro.c?x=166ed7d4580000

What is difficult to understand is why rcu failed to prevent the uaf.

#syz test

--- x/io_uring/poll.c
+++ y/io_uring/poll.c
@@ -143,6 +143,8 @@ static inline void io_poll_remove_entry(
 	struct wait_queue_head *head = smp_load_acquire(&poll->head);
 
 	if (head) {
+		if (list_empty(&poll->wait.entry))
+			return;
 		spin_lock_irq(&head->lock);
 		list_del_init(&poll->wait.entry);
 		poll->head = NULL;
@@ -416,7 +418,7 @@ static int io_poll_wake(struct wait_queu
 		/* optional, saves extra locking for removal in tw handler */
 		if (mask && poll->events & EPOLLONESHOT) {
 			list_del_init(&poll->wait.entry);
-			poll->head = NULL;
+			smp_store_release(&poll->head, NULL);
 			if (wqe_is_double(wait))
 				req->flags &= ~REQ_F_DOUBLE_POLL;
 			else
--

  reply	other threads:[~2025-07-20  0:36 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-07-19 17:29 [syzbot] [io-uring?] KASAN: slab-use-after-free Read in io_poll_remove_entries syzbot
2025-07-20  0:36 ` Hillf Danton [this message]
2025-07-20  0:49   ` syzbot
2025-07-20 18:24 ` Jens Axboe
2025-07-20 18:49   ` Jens Axboe
2025-07-20 19:00     ` Jens Axboe
2025-07-20 19:19       ` [syzbot] [kernel] " syzbot
2025-07-22 12:21       ` [syzbot] [io-uring?] " Jens Axboe
2025-07-22 12:30         ` Ian Abbott
2025-07-22 12:43           ` Jens Axboe
2025-07-22 12:31         ` Greg Kroah-Hartman
2025-07-22 12:44           ` Jens Axboe
2025-07-22 12:47       ` Ian Abbott
2025-07-22 13:00         ` Jens Axboe
2025-07-22 13:07           ` Ian Abbott
2025-07-22 13:31             ` Ian Abbott
2025-07-22 13:50               ` Jens Axboe
2025-07-22 14:03                 ` Ian Abbott
2025-07-22 13:53         ` Jens Axboe
2025-07-22 14:15           ` Ian Abbott
2025-07-23 14:08     ` Aleksandr Nogikh
2025-07-22 12:47 ` Jens Axboe
2025-07-22 13:14   ` [syzbot] [kernel] " syzbot

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=20250720003607.2491-1-hdanton@sina.com \
    --to=hdanton@sina.com \
    --cc=axboe@kernel.dk \
    --cc=io-uring@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=syzbot+01523a0ae5600aef5895@syzkaller.appspotmail.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