syzbot


KASAN: use-after-free Read in io_poll_check_events

Status: auto-obsoleted due to no activity on 2022/11/13 05:08
Subsystems: fs io-uring
[Documentation on labels]
Reported-by: syzbot+edb9c7738ba8cbdbf197@syzkaller.appspotmail.com
First crash: 798d, last: 750d
Cause bisection: introduced by (bisect log) :
commit d570aa1c4f191100f502edfc240e8d49687f62ac
Author: Jens Axboe <axboe@kernel.dk>
Date: Thu Mar 31 18:38:46 2022 +0000

  io_uring: drop the old style inflight file tracking

Crash: general protection fault in io_poll_check_events (log)
Repro: C syz .config
  
Discussions (1)
Title Replies (including bot) Last reply
[syzbot] KASAN: use-after-free Read in io_poll_check_events 1 (5) 2022/04/01 15:04
Last patch testing requests (2)
Created Duration User Patch Repo Result
2022/11/13 03:30 18m retest repro linux-next OK log
2022/04/01 14:51 11m axboe@kernel.dk git://git.kernel.dk/linux-block for-next OK

Sample crash report:
general protection fault, probably for non-canonical address 0xdffffc0000000005: 0000 [#1] PREEMPT SMP KASAN
KASAN: null-ptr-deref in range [0x0000000000000028-0x000000000000002f]
CPU: 1 PID: 3567 Comm: syz-executor893 Not tainted 5.17.0-next-20220401-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
RIP: 0010:vfs_poll include/linux/poll.h:86 [inline]
RIP: 0010:io_poll_check_events+0x1e0/0x800 fs/io_uring.c:5960
Code: e8 03 48 c7 44 24 60 00 00 00 00 44 89 74 24 68 42 80 3c 28 00 0f 85 ac 05 00 00 48 8b 5d 00 48 8d 7b 28 48 89 f8 48 c1 e8 03 <42> 80 3c 28 00 0f 85 88 05 00 00 48 8b 43 28 48 8d 78 48 48 89 fa
RSP: 0018:ffffc900038ffa00 EFLAGS: 00010206
RAX: 0000000000000005 RBX: 0000000000000000 RCX: 0000000000000000
RDX: ffff88801cea0000 RSI: ffffffff81eba128 RDI: 0000000000000028
RBP: ffff8880182d28c0 R08: 0000000000000000 R09: ffff8880182d2947
R10: ffffffff81eba2f4 R11: 0000000000000006 R12: 0000000000000001
R13: dffffc0000000000 R14: 0000000040002038 R15: ffff8880182d2944
FS:  0000555556048300(0000) GS:ffff8880b9d00000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00007ff954a2e140 CR3: 000000001a5af000 CR4: 00000000003506e0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
 <TASK>
 io_poll_task_func+0x41/0x500 fs/io_uring.c:5995
 handle_tw_list fs/io_uring.c:2462 [inline]
 tctx_task_work+0x1a4/0x1460 fs/io_uring.c:2496
 task_work_run+0xdd/0x1a0 kernel/task_work.c:164
 get_signal+0x1c5/0x24c0 kernel/signal.c:2681
 arch_do_signal_or_restart+0x88/0x1a10 arch/x86/kernel/signal.c:867
 exit_to_user_mode_loop kernel/entry/common.c:180 [inline]
 exit_to_user_mode_prepare+0x15f/0x250 kernel/entry/common.c:215
 __syscall_exit_to_user_mode_work kernel/entry/common.c:297 [inline]
 syscall_exit_to_user_mode+0x19/0x60 kernel/entry/common.c:308
 do_syscall_64+0x42/0x80 arch/x86/entry/common.c:86
 entry_SYSCALL_64_after_hwframe+0x44/0xae
RIP: 0033:0x7ff9549bcff9
Code: 28 00 00 00 75 05 48 83 c4 28 c3 e8 b1 14 00 00 90 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 c0 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007ffd1be31e78 EFLAGS: 00000246 ORIG_RAX: 00000000000001aa
RAX: 0000000000000200 RBX: 0000000000000000 RCX: 00007ff9549bcff9
RDX: 0000000000000000 RSI: 000000000000146f RDI: 0000000000000003
RBP: 0000000000000000 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 00007ff954980880
R13: 431bde82d7b634db R14: 0000000000000000 R15: 0000000000000000
 </TASK>
Modules linked in:
---[ end trace 0000000000000000 ]---
RIP: 0010:vfs_poll include/linux/poll.h:86 [inline]
RIP: 0010:io_poll_check_events+0x1e0/0x800 fs/io_uring.c:5960
Code: e8 03 48 c7 44 24 60 00 00 00 00 44 89 74 24 68 42 80 3c 28 00 0f 85 ac 05 00 00 48 8b 5d 00 48 8d 7b 28 48 89 f8 48 c1 e8 03 <42> 80 3c 28 00 0f 85 88 05 00 00 48 8b 43 28 48 8d 78 48 48 89 fa
RSP: 0018:ffffc900038ffa00 EFLAGS: 00010206
RAX: 0000000000000005 RBX: 0000000000000000 RCX: 0000000000000000
RDX: ffff88801cea0000 RSI: ffffffff81eba128 RDI: 0000000000000028
RBP: ffff8880182d28c0 R08: 0000000000000000 R09: ffff8880182d2947
R10: ffffffff81eba2f4 R11: 0000000000000006 R12: 0000000000000001
R13: dffffc0000000000 R14: 0000000040002038 R15: ffff8880182d2944
FS:  0000555556048300(0000) GS:ffff8880b9d00000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00007ff954a2e140 CR3: 000000001a5af000 CR4: 00000000003506e0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
----------------
Code disassembly (best guess):
   0:	e8 03 48 c7 44       	callq  0x44c74808
   5:	24 60                	and    $0x60,%al
   7:	00 00                	add    %al,(%rax)
   9:	00 00                	add    %al,(%rax)
   b:	44 89 74 24 68       	mov    %r14d,0x68(%rsp)
  10:	42 80 3c 28 00       	cmpb   $0x0,(%rax,%r13,1)
  15:	0f 85 ac 05 00 00    	jne    0x5c7
  1b:	48 8b 5d 00          	mov    0x0(%rbp),%rbx
  1f:	48 8d 7b 28          	lea    0x28(%rbx),%rdi
  23:	48 89 f8             	mov    %rdi,%rax
  26:	48 c1 e8 03          	shr    $0x3,%rax
* 2a:	42 80 3c 28 00       	cmpb   $0x0,(%rax,%r13,1) <-- trapping instruction
  2f:	0f 85 88 05 00 00    	jne    0x5bd
  35:	48 8b 43 28          	mov    0x28(%rbx),%rax
  39:	48 8d 78 48          	lea    0x48(%rax),%rdi
  3d:	48 89 fa             	mov    %rdi,%rdx

Crashes (20):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2022/04/01 09:22 linux-next e5071887cd22 68fc921a .config console log report syz C ci-upstream-linux-next-kasan-gce-root general protection fault in io_poll_check_events
2022/03/13 20:48 upstream f0e18b03fcaf 9e8eaa75 .config console log report info ci-upstream-kasan-gce-root KASAN: use-after-free Read in io_poll_check_events
2022/02/20 12:21 upstream 4f12b742eb2b 3cd800e4 .config console log report info ci-upstream-kasan-gce-smack-root KASAN: use-after-free Read in io_poll_check_events
2022/02/15 03:26 upstream d567f5db412e 8b9ca619 .config console log report info ci-upstream-kasan-gce-smack-root KASAN: use-after-free Read in io_poll_check_events
2022/04/04 00:07 linux-next e5071887cd22 79a2a8fc .config console log report info ci-upstream-linux-next-kasan-gce-root general protection fault in io_poll_check_events
2022/04/03 23:15 linux-next e5071887cd22 79a2a8fc .config console log report info ci-upstream-linux-next-kasan-gce-root general protection fault in io_poll_check_events
2022/04/03 23:14 linux-next e5071887cd22 79a2a8fc .config console log report info ci-upstream-linux-next-kasan-gce-root general protection fault in io_poll_check_events
2022/04/02 11:01 linux-next e5071887cd22 79a2a8fc .config console log report info ci-upstream-linux-next-kasan-gce-root general protection fault in io_poll_check_events
2022/04/02 00:44 linux-next e5071887cd22 79a2a8fc .config console log report info ci-upstream-linux-next-kasan-gce-root general protection fault in io_poll_check_events
2022/04/01 18:53 linux-next e5071887cd22 20955a24 .config console log report info ci-upstream-linux-next-kasan-gce-root general protection fault in io_poll_check_events
2022/04/01 16:16 linux-next e5071887cd22 20955a24 .config console log report info ci-upstream-linux-next-kasan-gce-root general protection fault in io_poll_check_events
2022/04/01 06:05 linux-next e5071887cd22 68fc921a .config console log report info ci-upstream-linux-next-kasan-gce-root general protection fault in io_poll_check_events
2022/04/01 05:54 linux-next e5071887cd22 68fc921a .config console log report info ci-upstream-linux-next-kasan-gce-root general protection fault in io_poll_check_events
2022/04/01 05:53 linux-next e5071887cd22 68fc921a .config console log report info ci-upstream-linux-next-kasan-gce-root general protection fault in io_poll_check_events
2022/04/01 05:34 linux-next e5071887cd22 68fc921a .config console log report info ci-upstream-linux-next-kasan-gce-root general protection fault in io_poll_check_events
2022/04/01 05:19 linux-next e5071887cd22 68fc921a .config console log report info ci-upstream-linux-next-kasan-gce-root general protection fault in io_poll_check_events
2022/04/01 04:30 linux-next e5071887cd22 68fc921a .config console log report info ci-upstream-linux-next-kasan-gce-root general protection fault in io_poll_check_events
2022/04/01 04:24 linux-next e5071887cd22 68fc921a .config console log report info ci-upstream-linux-next-kasan-gce-root general protection fault in io_poll_check_events
2022/04/01 03:49 linux-next e5071887cd22 68fc921a .config console log report info ci-upstream-linux-next-kasan-gce-root general protection fault in io_poll_check_events
2022/04/01 03:38 linux-next e5071887cd22 68fc921a .config console log report info ci-upstream-linux-next-kasan-gce-root general protection fault in io_poll_check_events
* Struck through repros no longer work on HEAD.