syzbot


general protection fault in io_poll_double_wake

Status: fixed on 2020/09/16 22:51
Subsystems: io-uring fs
[Documentation on labels]
Reported-by: syzbot+7f617d4a9369028b8a2c@syzkaller.appspotmail.com
Fix commit: d4e7cd36a90e io_uring: sanitize double poll handling
First crash: 1350d, last: 1321d
Cause bisection: introduced by (bisect log) :
commit 18bceab101adde8f38de76016bc77f3f25cf22f4
Author: Jens Axboe <axboe@kernel.dk>
Date: Fri May 15 17:56:54 2020 +0000

  io_uring: allow POLL_ADD with double poll_wait() users

Crash: WARNING: refcount bug in io_poll_remove_double (log)
Repro: C syz .config
  
Duplicate bugs (1)
duplicates (1):
Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
possible deadlock in io_poll_double_wake io-uring fs C 17 1321d 1349d 0/26 closed as dup on 2020/08/15 18:15
Discussions (4)
Title Replies (including bot) Last reply
[PATCH 5.8 000/464] 5.8.2-rc1 review 475 (475) 2020/08/19 06:11
[PATCH 5.7 000/393] 5.7.16-rc1 review 398 (398) 2020/08/18 22:36
[PATCH] io_uring: sanitize double poll handling 1 (1) 2020/08/15 18:49
general protection fault in io_poll_double_wake 2 (3) 2020/08/15 18:48
Similar bugs (1)
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
upstream general protection fault in io_poll_double_wake (2) fs io-uring C error 2 1307d 1306d 15/26 fixed on 2020/10/21 11:05

Sample crash report:
general protection fault, probably for non-canonical address 0xdffffc0000000009: 0000 [#1] PREEMPT SMP KASAN
KASAN: null-ptr-deref in range [0x0000000000000048-0x000000000000004f]
CPU: 0 PID: 6841 Comm: syz-executor870 Not tainted 5.8.0-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
RIP: 0010:io_poll_get_single fs/io_uring.c:4665 [inline]
RIP: 0010:io_poll_double_wake+0x51/0x510 fs/io_uring.c:4732
Code: fc ff df 48 c1 ea 03 80 3c 02 00 0f 85 9e 03 00 00 48 b8 00 00 00 00 00 fc ff df 49 8b 5d 08 48 8d 7b 48 48 89 fa 48 c1 ea 03 <0f> b6 04 02 84 c0 74 06 0f 8e 63 03 00 00 0f b6 6b 48 bf 06 00 00
RSP: 0018:ffffc9000533f820 EFLAGS: 00010006
RAX: dffffc0000000000 RBX: 0000000000000000 RCX: 0000000000000000
RDX: 0000000000000009 RSI: ffffffff81d6fe2d RDI: 0000000000000048
RBP: dffffc0000000000 R08: ffff8880950ce318 R09: ffff888092cd1c1f
R10: 0000000000000001 R11: 00000000000066d0 R12: 0000000000000000
R13: ffff8880950ce318 R14: ffff8880950ce320 R15: 0000000000000000
FS:  00007fdc4c9cd700(0000) GS:ffff8880ae600000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00007fd76f5e3710 CR3: 00000000a162a000 CR4: 00000000001506f0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
 __wake_up_common+0x147/0x650 kernel/sched/wait.c:93
 __wake_up_common_lock+0xd0/0x130 kernel/sched/wait.c:123
 n_tty_set_termios+0x73d/0x1010 drivers/tty/n_tty.c:1874
 tty_set_termios+0x5eb/0x840 drivers/tty/tty_ioctl.c:341
 set_termios.part.0+0x2be/0x4d0 drivers/tty/tty_ioctl.c:414
 set_termios drivers/tty/tty_ioctl.c:368 [inline]
 tty_mode_ioctl+0x899/0xb60 drivers/tty/tty_ioctl.c:745
 n_tty_ioctl_helper+0x55/0x3a0 drivers/tty/tty_ioctl.c:940
 n_tty_ioctl+0x56/0x370 drivers/tty/n_tty.c:2466
 tty_ioctl+0x10c5/0x15f0 drivers/tty/tty_io.c:2665
 vfs_ioctl fs/ioctl.c:48 [inline]
 __do_sys_ioctl fs/ioctl.c:753 [inline]
 __se_sys_ioctl fs/ioctl.c:739 [inline]
 __x64_sys_ioctl+0x193/0x200 fs/ioctl.c:739
 do_syscall_64+0x2d/0x70 arch/x86/entry/common.c:46
 entry_SYSCALL_64_after_hwframe+0x44/0xa9
RIP: 0033:0x445c89
Code: e8 fc b8 02 00 48 83 c4 18 c3 0f 1f 80 00 00 00 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 0f 83 0b 12 fc ff c3 66 2e 0f 1f 84 00 00 00 00
RSP: 002b:00007fdc4c9ccda8 EFLAGS: 00000246 ORIG_RAX: 0000000000000010
RAX: ffffffffffffffda RBX: 00000000006dac58 RCX: 0000000000445c89
RDX: 0000000020000080 RSI: 0000000000005404 RDI: 0000000000000005
RBP: 00000000006dac50 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 00000000006dac5c
R13: 00007fffde43a00f R14: 00007fdc4c9cd9c0 R15: 20c49ba5e353f7cf
Modules linked in:
---[ end trace fcb3eade8056d482 ]---
RIP: 0010:io_poll_get_single fs/io_uring.c:4665 [inline]
RIP: 0010:io_poll_double_wake+0x51/0x510 fs/io_uring.c:4732
Code: fc ff df 48 c1 ea 03 80 3c 02 00 0f 85 9e 03 00 00 48 b8 00 00 00 00 00 fc ff df 49 8b 5d 08 48 8d 7b 48 48 89 fa 48 c1 ea 03 <0f> b6 04 02 84 c0 74 06 0f 8e 63 03 00 00 0f b6 6b 48 bf 06 00 00
RSP: 0018:ffffc9000533f820 EFLAGS: 00010006
RAX: dffffc0000000000 RBX: 0000000000000000 RCX: 0000000000000000
RDX: 0000000000000009 RSI: ffffffff81d6fe2d RDI: 0000000000000048
RBP: dffffc0000000000 R08: ffff8880950ce318 R09: ffff888092cd1c1f
R10: 0000000000000001 R11: 00000000000066d0 R12: 0000000000000000
R13: ffff8880950ce318 R14: ffff8880950ce320 R15: 0000000000000000
FS:  00007fdc4c9cd700(0000) GS:ffff8880ae600000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00007fd76f5e3710 CR3: 00000000a162a000 CR4: 00000000001506f0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400

Crashes (8):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2020/08/16 21:16 upstream 2cc3c4b3c2e9 424dd8e7 .config console log report syz C ci-upstream-kasan-gce-root
2020/08/15 18:58 upstream c9c9735c46f5 424dd8e7 .config console log report syz C ci-upstream-kasan-gce-selinux-root
2020/08/15 06:43 upstream 7fca4dee610d 424dd8e7 .config console log report syz C ci-upstream-kasan-gce-smack-root
2020/08/19 05:23 linux-next 83c52faab7b1 e1c29030 .config console log report syz C ci-upstream-linux-next-kasan-gce-root
2020/09/03 13:39 upstream fc3abb53250a abf9ba4f .config console log report ci-upstream-kasan-gce-selinux-root
2020/08/15 06:28 upstream 7fca4dee610d 424dd8e7 .config console log report ci-upstream-kasan-gce-smack-root
2020/09/12 15:13 linux-next d5b2251d63b5 ce441f06 .config console log report ci-upstream-linux-next-kasan-gce-root
2020/08/23 18:22 linux-next 494d311a82bb cef5ae68 .config console log report ci-upstream-linux-next-kasan-gce-root
* Struck through repros no longer work on HEAD.