public inbox for io-uring@vger.kernel.org
 help / color / mirror / Atom feed
* [syzbot] [io-uring?] KASAN: slab-use-after-free Read in io_waitid_wait
@ 2025-10-07 12:43 syzbot
  2025-10-07 13:20 ` Jens Axboe
                   ` (2 more replies)
  0 siblings, 3 replies; 9+ messages in thread
From: syzbot @ 2025-10-07 12:43 UTC (permalink / raw)
  To: axboe, io-uring, linux-kernel, syzkaller-bugs

Hello,

syzbot found the following issue on:

HEAD commit:    6a74422b9710 Merge tag 'mips_6.18' of git://git.kernel.org..
git tree:       upstream
console output: https://syzkaller.appspot.com/x/log.txt?x=124fdee2580000
kernel config:  https://syzkaller.appspot.com/x/.config?x=8f142ebe84501b0b
dashboard link: https://syzkaller.appspot.com/bug?extid=b9e83021d9c642a33d8c
compiler:       gcc (Debian 12.2.0-14+deb12u1) 12.2.0, GNU ld (GNU Binutils for Debian) 2.40
syz repro:      https://syzkaller.appspot.com/x/repro.syz?x=1437c304580000
C reproducer:   https://syzkaller.appspot.com/x/repro.c?x=118b3334580000

Downloadable assets:
disk image (non-bootable): https://storage.googleapis.com/syzbot-assets/d900f083ada3/non_bootable_disk-6a74422b.raw.xz
vmlinux: https://storage.googleapis.com/syzbot-assets/fc46a17eb520/vmlinux-6a74422b.xz
kernel image: https://storage.googleapis.com/syzbot-assets/a9132caa46a1/bzImage-6a74422b.xz

IMPORTANT: if you fix the issue, please add the following tag to the commit:
Reported-by: syzbot+b9e83021d9c642a33d8c@syzkaller.appspotmail.com

==================================================================
BUG: KASAN: slab-use-after-free in __list_del_entry_valid_or_report+0x1ba/0x200 lib/list_debug.c:49
Read of size 8 at addr ffff888051712d50 by task syz.0.17/6127

CPU: 0 UID: 0 PID: 6127 Comm: syz.0.17 Not tainted syzkaller #0 PREEMPT(full) 
Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2~bpo12+1 04/01/2014
Call Trace:
 <TASK>
 __dump_stack lib/dump_stack.c:94 [inline]
 dump_stack_lvl+0x116/0x1f0 lib/dump_stack.c:120
 print_address_description mm/kasan/report.c:378 [inline]
 print_report+0xcd/0x630 mm/kasan/report.c:482
 kasan_report+0xe0/0x110 mm/kasan/report.c:595
 __list_del_entry_valid_or_report+0x1ba/0x200 lib/list_debug.c:49
 __list_del_entry_valid include/linux/list.h:132 [inline]
 __list_del_entry include/linux/list.h:223 [inline]
 list_del_init include/linux/list.h:295 [inline]
 io_waitid_wait+0xf7/0x230 io_uring/waitid.c:239
 __wake_up_common+0x132/0x1f0 kernel/sched/wait.c:108
 __wake_up_common_lock kernel/sched/wait.c:125 [inline]
 __wake_up_sync_key+0x36/0x50 kernel/sched/wait.c:192
 do_notify_parent_cldstop+0x540/0xb50 kernel/signal.c:2333
 ptrace_stop.part.0+0x7e1/0x950 kernel/signal.c:2437
 ptrace_stop kernel/signal.c:2376 [inline]
 ptrace_signal kernel/signal.c:2743 [inline]
 get_signal+0x13d5/0x26d0 kernel/signal.c:2921
 arch_do_signal_or_restart+0x8f/0x7c0 arch/x86/kernel/signal.c:337
 exit_to_user_mode_loop kernel/entry/common.c:40 [inline]
 exit_to_user_mode_prepare include/linux/irq-entry-common.h:225 [inline]
 irqentry_exit_to_user_mode+0x141/0x2b0 kernel/entry/common.c:73
 asm_exc_page_fault+0x26/0x30 arch/x86/include/asm/idtentry.h:623
RIP: 0033:0x7fc598db6c60
Code: 6e c7 89 13 48 8b 50 08 0f 16 40 50 0f 11 00 48 89 50 50 48 8b 50 10 48 89 78 10 48 89 50 40 48 89 d7 eb b2 66 0f 1f 44 00 00 <64> 48 8b 0c 25 10 00 00 00 8b 91 08 03 00 00 48 8d b9 08 03 00 00
RSP: 002b:00007ffccd0733d8 EFLAGS: 00010202
RAX: 00000000fffffffa RBX: 00007fc598fe5fa0 RCX: 0000000000000000
RDX: 00007ffccd073420 RSI: 0000000000000000 RDI: 0000000000000000
RBP: 00007fc598e11f91 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
R13: 00007fc598fe5fa0 R14: 00007fc598fe5fa0 R15: 0000000000000006
 </TASK>

Allocated by task 6123:
 kasan_save_stack+0x33/0x60 mm/kasan/common.c:56
 kasan_save_track+0x14/0x30 mm/kasan/common.c:77
 poison_kmalloc_redzone mm/kasan/common.c:400 [inline]
 __kasan_kmalloc+0xaa/0xb0 mm/kasan/common.c:417
 kasan_kmalloc include/linux/kasan.h:262 [inline]
 __do_kmalloc_node mm/slub.c:5603 [inline]
 __kmalloc_noprof+0x32f/0x880 mm/slub.c:5615
 kmalloc_noprof include/linux/slab.h:961 [inline]
 io_uring_alloc_async_data io_uring/io_uring.h:328 [inline]
 io_waitid_prep+0x1aa/0x470 io_uring/waitid.c:251
 io_init_req io_uring/io_uring.c:2248 [inline]
 io_submit_sqe io_uring/io_uring.c:2295 [inline]
 io_submit_sqes+0x855/0x2710 io_uring/io_uring.c:2447
 __do_sys_io_uring_enter+0xd69/0x1630 io_uring/io_uring.c:3514
 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline]
 do_syscall_64+0xcd/0x4e0 arch/x86/entry/syscall_64.c:94
 entry_SYSCALL_64_after_hwframe+0x77/0x7f

Freed by task 6123:
 kasan_save_stack+0x33/0x60 mm/kasan/common.c:56
 kasan_save_track+0x14/0x30 mm/kasan/common.c:77
 __kasan_save_free_info+0x3b/0x60 mm/kasan/generic.c:587
 kasan_save_free_info mm/kasan/kasan.h:406 [inline]
 poison_slab_object mm/kasan/common.c:252 [inline]
 __kasan_slab_free+0x5f/0x80 mm/kasan/common.c:284
 kasan_slab_free include/linux/kasan.h:234 [inline]
 slab_free_hook mm/slub.c:2514 [inline]
 slab_free mm/slub.c:6566 [inline]
 kfree+0x2b8/0x6d0 mm/slub.c:6773
 io_req_async_data_free io_uring/io_uring.h:349 [inline]
 io_waitid_free io_uring/waitid.c:40 [inline]
 io_waitid_finish io_uring/waitid.c:108 [inline]
 io_waitid_complete+0x249/0x5e0 io_uring/waitid.c:123
 io_waitid_cb+0xe4/0x3a0 io_uring/waitid.c:217
 io_handle_tw_list+0x483/0x500 io_uring/io_uring.c:1151
 tctx_task_work_run+0xac/0x380 io_uring/io_uring.c:1216
 tctx_task_work+0x7a/0xd0 io_uring/io_uring.c:1234
 task_work_run+0x150/0x240 kernel/task_work.c:227
 get_signal+0x1d0/0x26d0 kernel/signal.c:2807
 arch_do_signal_or_restart+0x8f/0x7c0 arch/x86/kernel/signal.c:337
 exit_to_user_mode_loop kernel/entry/common.c:40 [inline]
 exit_to_user_mode_prepare include/linux/irq-entry-common.h:225 [inline]
 irqentry_exit_to_user_mode+0x141/0x2b0 kernel/entry/common.c:73
 asm_exc_page_fault+0x26/0x30 arch/x86/include/asm/idtentry.h:623

The buggy address belongs to the object at ffff888051712d00
 which belongs to the cache kmalloc-96 of size 96
The buggy address is located 80 bytes inside of
 freed 96-byte region [ffff888051712d00, ffff888051712d60)

The buggy address belongs to the physical page:
page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x51712
flags: 0xfff00000000000(node=0|zone=1|lastcpupid=0x7ff)
page_type: f5(slab)
raw: 00fff00000000000 ffff88801b042280 dead000000000122 0000000000000000
raw: 0000000000000000 0000000080200020 00000000f5000000 0000000000000000
page dumped because: kasan: bad access detected
page_owner tracks the page as allocated
page last allocated via order 0, migratetype Unmovable, gfp_mask 0x52cc0(GFP_KERNEL|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP), pid 6123, tgid 6123 (syz.0.17), ts 124233232510, free_ts 119982111762
 set_page_owner include/linux/page_owner.h:32 [inline]
 post_alloc_hook+0x1c0/0x230 mm/page_alloc.c:1850
 prep_new_page mm/page_alloc.c:1858 [inline]
 get_page_from_freelist+0x10a3/0x3a30 mm/page_alloc.c:3884
 __alloc_frozen_pages_noprof+0x25f/0x2470 mm/page_alloc.c:5183
 alloc_pages_mpol+0x1fb/0x550 mm/mempolicy.c:2416
 alloc_slab_page mm/slub.c:3030 [inline]
 allocate_slab mm/slub.c:3203 [inline]
 new_slab+0x24a/0x360 mm/slub.c:3257
 ___slab_alloc+0xdc4/0x1ae0 mm/slub.c:4627
 __slab_alloc.constprop.0+0x63/0x110 mm/slub.c:4746
 __slab_alloc_node mm/slub.c:4822 [inline]
 slab_alloc_node mm/slub.c:5233 [inline]
 __do_kmalloc_node mm/slub.c:5602 [inline]
 __kmalloc_noprof+0x501/0x880 mm/slub.c:5615
 kmalloc_noprof include/linux/slab.h:961 [inline]
 io_uring_alloc_async_data io_uring/io_uring.h:328 [inline]
 io_waitid_prep+0x1aa/0x470 io_uring/waitid.c:251
 io_init_req io_uring/io_uring.c:2248 [inline]
 io_submit_sqe io_uring/io_uring.c:2295 [inline]
 io_submit_sqes+0x855/0x2710 io_uring/io_uring.c:2447
 __do_sys_io_uring_enter+0xd69/0x1630 io_uring/io_uring.c:3514
 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline]
 do_syscall_64+0xcd/0x4e0 arch/x86/entry/syscall_64.c:94
 entry_SYSCALL_64_after_hwframe+0x77/0x7f
page last free pid 6077 tgid 6077 stack trace:
 reset_page_owner include/linux/page_owner.h:25 [inline]
 free_pages_prepare mm/page_alloc.c:1394 [inline]
 __free_frozen_pages+0x7df/0x1160 mm/page_alloc.c:2906
 vfree+0x1fd/0xb50 mm/vmalloc.c:3440
 kcov_put kernel/kcov.c:439 [inline]
 kcov_put kernel/kcov.c:435 [inline]
 kcov_close+0x34/0x60 kernel/kcov.c:535
 __fput+0x402/0xb70 fs/file_table.c:468
 task_work_run+0x150/0x240 kernel/task_work.c:227
 exit_task_work include/linux/task_work.h:40 [inline]
 do_exit+0x86f/0x2bf0 kernel/exit.c:966
 do_group_exit+0xd3/0x2a0 kernel/exit.c:1107
 get_signal+0x2671/0x26d0 kernel/signal.c:3034
 arch_do_signal_or_restart+0x8f/0x7c0 arch/x86/kernel/signal.c:337
 exit_to_user_mode_loop+0x85/0x130 kernel/entry/common.c:40
 exit_to_user_mode_prepare include/linux/irq-entry-common.h:225 [inline]
 syscall_exit_to_user_mode_work include/linux/entry-common.h:175 [inline]
 syscall_exit_to_user_mode include/linux/entry-common.h:210 [inline]
 do_syscall_64+0x419/0x4e0 arch/x86/entry/syscall_64.c:100
 entry_SYSCALL_64_after_hwframe+0x77/0x7f

Memory state around the buggy address:
 ffff888051712c00: 00 00 00 00 00 00 00 00 00 00 00 00 fc fc fc fc
 ffff888051712c80: 00 00 00 00 00 00 00 00 00 00 00 00 fc fc fc fc
>ffff888051712d00: fa fb fb fb fb fb fb fb fb fb fb fb fc fc fc fc
                                                 ^
 ffff888051712d80: 00 00 00 00 00 00 00 00 00 fc fc fc fc fc fc fc
 ffff888051712e00: 00 00 00 00 00 00 00 00 00 fc fc fc fc fc fc fc
==================================================================


---
This report is generated by a bot. It may contain errors.
See https://goo.gl/tpsmEJ for more information about syzbot.
syzbot engineers can be reached at syzkaller@googlegroups.com.

syzbot will keep track of this issue. See:
https://goo.gl/tpsmEJ#status for how to communicate with syzbot.

If the report is already addressed, let syzbot know by replying with:
#syz fix: exact-commit-title

If you want syzbot to run the reproducer, reply with:
#syz test: git://repo/address.git branch-or-commit-hash
If you attach or paste a git patch, syzbot will apply it before testing.

If you want to overwrite report's subsystems, reply with:
#syz set subsystems: new-subsystem
(See the list of subsystem names on the web dashboard)

If the report is a duplicate of another one, reply with:
#syz dup: exact-subject-of-another-report

If you want to undo deduplication, reply with:
#syz undup

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [syzbot] [io-uring?] KASAN: slab-use-after-free Read in io_waitid_wait
  2025-10-07 12:43 [syzbot] [io-uring?] KASAN: slab-use-after-free Read in io_waitid_wait syzbot
@ 2025-10-07 13:20 ` Jens Axboe
  2025-10-07 13:20   ` syzbot
  2025-10-07 13:24 ` Jens Axboe
  2025-10-09 16:56 ` Jens Axboe
  2 siblings, 1 reply; 9+ messages in thread
From: Jens Axboe @ 2025-10-07 13:20 UTC (permalink / raw)
  To: syzbot, io-uring, linux-kernel, syzkaller-bugs

#syz test: git://git.kernel.org/pub/scm/linux/kernel/git/axboe/linux.git

diff --git a/io_uring/waitid.c b/io_uring/waitid.c
index 26c118f3918d..f25110fb1b12 100644
--- a/io_uring/waitid.c
+++ b/io_uring/waitid.c
@@ -230,13 +230,14 @@ static int io_waitid_wait(struct wait_queue_entry *wait, unsigned mode,
 	if (!pid_child_should_wake(wo, p))
 		return 0;
 
+	list_del_init(&wait->entry);
+
 	/* cancel is in progress */
 	if (atomic_fetch_inc(&iw->refs) & IO_WAITID_REF_MASK)
 		return 1;
 
 	req->io_task_work.func = io_waitid_cb;
 	io_req_task_work_add(req);
-	list_del_init(&wait->entry);
 	return 1;
 }
 

-- 
Jens Axboe

^ permalink raw reply related	[flat|nested] 9+ messages in thread

* Re: [syzbot] [io-uring?] KASAN: slab-use-after-free Read in io_waitid_wait
  2025-10-07 13:20 ` Jens Axboe
@ 2025-10-07 13:20   ` syzbot
  0 siblings, 0 replies; 9+ messages in thread
From: syzbot @ 2025-10-07 13:20 UTC (permalink / raw)
  To: axboe; +Cc: axboe, io-uring, linux-kernel, syzkaller-bugs

> #syz test: git://git.kernel.org/pub/scm/linux/kernel/git/axboe/linux.git

want either no args or 2 args (repo, branch), got 5

>
> diff --git a/io_uring/waitid.c b/io_uring/waitid.c
> index 26c118f3918d..f25110fb1b12 100644
> --- a/io_uring/waitid.c
> +++ b/io_uring/waitid.c
> @@ -230,13 +230,14 @@ static int io_waitid_wait(struct wait_queue_entry *wait, unsigned mode,
>  	if (!pid_child_should_wake(wo, p))
>  		return 0;
>  
> +	list_del_init(&wait->entry);
> +
>  	/* cancel is in progress */
>  	if (atomic_fetch_inc(&iw->refs) & IO_WAITID_REF_MASK)
>  		return 1;
>  
>  	req->io_task_work.func = io_waitid_cb;
>  	io_req_task_work_add(req);
> -	list_del_init(&wait->entry);
>  	return 1;
>  }
>  
>
> -- 
> Jens Axboe

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [syzbot] [io-uring?] KASAN: slab-use-after-free Read in io_waitid_wait
  2025-10-07 12:43 [syzbot] [io-uring?] KASAN: slab-use-after-free Read in io_waitid_wait syzbot
  2025-10-07 13:20 ` Jens Axboe
@ 2025-10-07 13:24 ` Jens Axboe
  2025-10-07 13:45   ` syzbot
  2025-10-09 16:56 ` Jens Axboe
  2 siblings, 1 reply; 9+ messages in thread
From: Jens Axboe @ 2025-10-07 13:24 UTC (permalink / raw)
  To: syzbot, io-uring, linux-kernel, syzkaller-bugs

#syz test: git://git.kernel.org/pub/scm/linux/kernel/git/axboe/linux.git master

diff --git a/io_uring/waitid.c b/io_uring/waitid.c
index 26c118f3918d..f25110fb1b12 100644
--- a/io_uring/waitid.c
+++ b/io_uring/waitid.c
@@ -230,13 +230,14 @@ static int io_waitid_wait(struct wait_queue_entry *wait, unsigned mode,
 	if (!pid_child_should_wake(wo, p))
 		return 0;
 
+	list_del_init(&wait->entry);
+
 	/* cancel is in progress */
 	if (atomic_fetch_inc(&iw->refs) & IO_WAITID_REF_MASK)
 		return 1;
 
 	req->io_task_work.func = io_waitid_cb;
 	io_req_task_work_add(req);
-	list_del_init(&wait->entry);
 	return 1;
 }
 

-- 
Jens Axboe

^ permalink raw reply related	[flat|nested] 9+ messages in thread

* Re: [syzbot] [io-uring?] KASAN: slab-use-after-free Read in io_waitid_wait
  2025-10-07 13:24 ` Jens Axboe
@ 2025-10-07 13:45   ` syzbot
  0 siblings, 0 replies; 9+ messages in thread
From: syzbot @ 2025-10-07 13:45 UTC (permalink / raw)
  To: axboe, io-uring, linux-kernel, syzkaller-bugs

Hello,

syzbot has tested the proposed patch and the reproducer did not trigger any issue:

Reported-by: syzbot+b9e83021d9c642a33d8c@syzkaller.appspotmail.com
Tested-by: syzbot+b9e83021d9c642a33d8c@syzkaller.appspotmail.com

Tested on:

commit:         c746c3b5 Merge tag 'for-6.18-tag' of git://git.kernel...
git tree:       git://git.kernel.org/pub/scm/linux/kernel/git/axboe/linux.git master
console output: https://syzkaller.appspot.com/x/log.txt?x=110955cd980000
kernel config:  https://syzkaller.appspot.com/x/.config?x=8f142ebe84501b0b
dashboard link: https://syzkaller.appspot.com/bug?extid=b9e83021d9c642a33d8c
compiler:       gcc (Debian 12.2.0-14+deb12u1) 12.2.0, GNU ld (GNU Binutils for Debian) 2.40
patch:          https://syzkaller.appspot.com/x/patch.diff?x=13aa0542580000

Note: testing is done by a robot and is best-effort only.

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [syzbot] [io-uring?] KASAN: slab-use-after-free Read in io_waitid_wait
  2025-10-07 12:43 [syzbot] [io-uring?] KASAN: slab-use-after-free Read in io_waitid_wait syzbot
  2025-10-07 13:20 ` Jens Axboe
  2025-10-07 13:24 ` Jens Axboe
@ 2025-10-09 16:56 ` Jens Axboe
  2025-10-09 17:11   ` syzbot
  2 siblings, 1 reply; 9+ messages in thread
From: Jens Axboe @ 2025-10-09 16:56 UTC (permalink / raw)
  To: syzbot, io-uring, linux-kernel, syzkaller-bugs

#syz test: git://git.kernel.org/pub/scm/linux/kernel/git/axboe/linux.git syztest 

-- 
Jens Axboe

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [syzbot] [io-uring?] KASAN: slab-use-after-free Read in io_waitid_wait
  2025-10-09 16:56 ` Jens Axboe
@ 2025-10-09 17:11   ` syzbot
  2025-10-09 17:16     ` Jens Axboe
  0 siblings, 1 reply; 9+ messages in thread
From: syzbot @ 2025-10-09 17:11 UTC (permalink / raw)
  To: axboe, io-uring, linux-kernel, syzkaller-bugs

Hello,

syzbot has tested the proposed patch but the reproducer is still triggering an issue:
general protection fault in add_wait_queue

Oops: general protection fault, probably for non-canonical address 0xdffffc0000000003: 0000 [#1] SMP KASAN NOPTI
KASAN: null-ptr-deref in range [0x0000000000000018-0x000000000000001f]
CPU: 3 UID: 0 PID: 6397 Comm: syz.0.17 Not tainted syzkaller #0 PREEMPT(full) 
Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2~bpo12+1 04/01/2014
RIP: 0010:kasan_byte_accessible+0x15/0x30 mm/kasan/generic.c:210
Code: 00 00 0f 1f 00 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 66 0f 1f 00 48 b8 00 00 00 00 00 fc ff df 48 c1 ef 03 48 01 c7 <0f> b6 07 3c 07 0f 96 c0 c3 cc cc cc cc 66 66 2e 0f 1f 84 00 00 00
RSP: 0018:ffffc900027579b0 EFLAGS: 00010086
RAX: dffffc0000000000 RBX: 0000000000000018 RCX: 0000000000000000
RDX: 0000000000000000 RSI: ffffffff8b54cf9a RDI: dffffc0000000003
RBP: 0000000000000018 R08: 0000000000000001 R09: 0000000000000000
R10: ffffffff905ff0d7 R11: 0000000000000000 R12: ffffffff8b54cf9a
R13: 0000000000000000 R14: 0000000000000000 R15: 0000000000000000
FS:  00007fe7bc5c86c0(0000) GS:ffff8880d7161000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00007fe7bb9e5fac CR3: 00000000504de000 CR4: 0000000000352ef0
Call Trace:
 <TASK>
 __kasan_check_byte+0x13/0x50 mm/kasan/common.c:579
 kasan_check_byte include/linux/kasan.h:401 [inline]
 lock_acquire kernel/locking/lockdep.c:5842 [inline]
 lock_acquire+0xfc/0x350 kernel/locking/lockdep.c:5825
 __raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:110 [inline]
 _raw_spin_lock_irqsave+0x3a/0x60 kernel/locking/spinlock.c:162
 add_wait_queue+0x45/0x230 kernel/sched/wait.c:23
 io_waitid_cb+0x1c3/0x2b0 io_uring/waitid.c:219
 io_handle_tw_list+0x486/0x500 io_uring/io_uring.c:1151
 tctx_task_work_run+0xac/0x380 io_uring/io_uring.c:1216
 tctx_task_work+0x7a/0xd0 io_uring/io_uring.c:1234
 task_work_run+0x150/0x240 kernel/task_work.c:227
 get_signal+0x1d0/0x26d0 kernel/signal.c:2807
 arch_do_signal_or_restart+0x8f/0x7c0 arch/x86/kernel/signal.c:337
 exit_to_user_mode_loop+0x85/0x130 kernel/entry/common.c:40
 exit_to_user_mode_prepare include/linux/irq-entry-common.h:225 [inline]
 syscall_exit_to_user_mode_work include/linux/entry-common.h:175 [inline]
 syscall_exit_to_user_mode include/linux/entry-common.h:210 [inline]
 do_syscall_64+0x419/0x4e0 arch/x86/entry/syscall_64.c:100
 entry_SYSCALL_64_after_hwframe+0x77/0x7f
RIP: 0033:0x7fe7bb78eec9
Code: ff ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 40 00 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 c7 c1 a8 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007fe7bc5c80e8 EFLAGS: 00000246 ORIG_RAX: 00000000000000ca
RAX: 0000000000000000 RBX: 00007fe7bb9e5fa8 RCX: 00007fe7bb78eec9
RDX: 0000000000000000 RSI: 0000000000000080 RDI: 00007fe7bb9e5fa8
RBP: 00007fe7bb9e5fa0 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
R13: 00007fe7bb9e6038 R14: 00007ffcd14563d0 R15: 00007ffcd14564b8
 </TASK>
Modules linked in:
---[ end trace 0000000000000000 ]---
RIP: 0010:kasan_byte_accessible+0x15/0x30 mm/kasan/generic.c:210
Code: 00 00 0f 1f 00 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 66 0f 1f 00 48 b8 00 00 00 00 00 fc ff df 48 c1 ef 03 48 01 c7 <0f> b6 07 3c 07 0f 96 c0 c3 cc cc cc cc 66 66 2e 0f 1f 84 00 00 00
RSP: 0018:ffffc900027579b0 EFLAGS: 00010086
RAX: dffffc0000000000 RBX: 0000000000000018 RCX: 0000000000000000
RDX: 0000000000000000 RSI: ffffffff8b54cf9a RDI: dffffc0000000003
RBP: 0000000000000018 R08: 0000000000000001 R09: 0000000000000000
R10: ffffffff905ff0d7 R11: 0000000000000000 R12: ffffffff8b54cf9a
R13: 0000000000000000 R14: 0000000000000000 R15: 0000000000000000
FS:  00007fe7bc5c86c0(0000) GS:ffff8880d7161000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00007fe7bb9e5fac CR3: 00000000504de000 CR4: 0000000000352ef0
----------------
Code disassembly (best guess):
   0:	00 00                	add    %al,(%rax)
   2:	0f 1f 00             	nopl   (%rax)
   5:	90                   	nop
   6:	90                   	nop
   7:	90                   	nop
   8:	90                   	nop
   9:	90                   	nop
   a:	90                   	nop
   b:	90                   	nop
   c:	90                   	nop
   d:	90                   	nop
   e:	90                   	nop
   f:	90                   	nop
  10:	90                   	nop
  11:	90                   	nop
  12:	90                   	nop
  13:	90                   	nop
  14:	90                   	nop
  15:	66 0f 1f 00          	nopw   (%rax)
  19:	48 b8 00 00 00 00 00 	movabs $0xdffffc0000000000,%rax
  20:	fc ff df
  23:	48 c1 ef 03          	shr    $0x3,%rdi
  27:	48 01 c7             	add    %rax,%rdi
* 2a:	0f b6 07             	movzbl (%rdi),%eax <-- trapping instruction
  2d:	3c 07                	cmp    $0x7,%al
  2f:	0f 96 c0             	setbe  %al
  32:	c3                   	ret
  33:	cc                   	int3
  34:	cc                   	int3
  35:	cc                   	int3
  36:	cc                   	int3
  37:	66                   	data16
  38:	66                   	data16
  39:	2e                   	cs
  3a:	0f                   	.byte 0xf
  3b:	1f                   	(bad)
  3c:	84 00                	test   %al,(%rax)


Tested on:

commit:         299d12f3 io_uring/waitid: use io_waitid_remove_wq() co..
git tree:       git://git.kernel.org/pub/scm/linux/kernel/git/axboe/linux.git syztest
console output: https://syzkaller.appspot.com/x/log.txt?x=12de0dcd980000
kernel config:  https://syzkaller.appspot.com/x/.config?x=6da9233e22696ba7
dashboard link: https://syzkaller.appspot.com/bug?extid=b9e83021d9c642a33d8c
compiler:       gcc (Debian 12.2.0-14+deb12u1) 12.2.0, GNU ld (GNU Binutils for Debian) 2.40

Note: no patches were applied.

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [syzbot] [io-uring?] KASAN: slab-use-after-free Read in io_waitid_wait
  2025-10-09 17:11   ` syzbot
@ 2025-10-09 17:16     ` Jens Axboe
  2025-10-09 17:36       ` syzbot
  0 siblings, 1 reply; 9+ messages in thread
From: Jens Axboe @ 2025-10-09 17:16 UTC (permalink / raw)
  To: syzbot, io-uring, linux-kernel, syzkaller-bugs

#syz test: git://git.kernel.org/pub/scm/linux/kernel/git/axboe/linux.git syztest

-- 
Jens Axboe


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [syzbot] [io-uring?] KASAN: slab-use-after-free Read in io_waitid_wait
  2025-10-09 17:16     ` Jens Axboe
@ 2025-10-09 17:36       ` syzbot
  0 siblings, 0 replies; 9+ messages in thread
From: syzbot @ 2025-10-09 17:36 UTC (permalink / raw)
  To: axboe, io-uring, linux-kernel, syzkaller-bugs

Hello,

syzbot has tested the proposed patch and the reproducer did not trigger any issue:

Reported-by: syzbot+b9e83021d9c642a33d8c@syzkaller.appspotmail.com
Tested-by: syzbot+b9e83021d9c642a33d8c@syzkaller.appspotmail.com

Tested on:

commit:         554d1823 io_uring/waitid: use io_waitid_remove_wq() co..
git tree:       git://git.kernel.org/pub/scm/linux/kernel/git/axboe/linux.git syztest
console output: https://syzkaller.appspot.com/x/log.txt?x=10fe1304580000
kernel config:  https://syzkaller.appspot.com/x/.config?x=6da9233e22696ba7
dashboard link: https://syzkaller.appspot.com/bug?extid=b9e83021d9c642a33d8c
compiler:       gcc (Debian 12.2.0-14+deb12u1) 12.2.0, GNU ld (GNU Binutils for Debian) 2.40

Note: no patches were applied.
Note: testing is done by a robot and is best-effort only.

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2025-10-09 17:36 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-10-07 12:43 [syzbot] [io-uring?] KASAN: slab-use-after-free Read in io_waitid_wait syzbot
2025-10-07 13:20 ` Jens Axboe
2025-10-07 13:20   ` syzbot
2025-10-07 13:24 ` Jens Axboe
2025-10-07 13:45   ` syzbot
2025-10-09 16:56 ` Jens Axboe
2025-10-09 17:11   ` syzbot
2025-10-09 17:16     ` Jens Axboe
2025-10-09 17:36       ` syzbot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox