bisecting cause commit starting from b9011c7e671dbbf59bb753283ddfd03f0c9eb865 building syzkaller on 33c26cb735dc83786ebebe071a3e17cdd5383ead testing commit b9011c7e671dbbf59bb753283ddfd03f0c9eb865 compiler: gcc (GCC) 10.2.1 20210217, GNU ld (GNU Binutils for Debian) 2.35.1 kernel signature: 7f4a6970b16d0788f02d2862aeb66030f9e3689072838cac5d6d726bafe31f00 all runs: crashed: general protection fault in __io_queue_sqe testing release v5.13 testing commit 62fb9874f5da54fdb243003b386128037319b219 compiler: gcc (GCC) 10.2.1 20210217, GNU ld (GNU Binutils for Debian) 2.35.1 kernel signature: 1cb5111c0f95c1fc7e3896d55db5b53fbce5858f143c657e735c92f7019c7d10 all runs: OK # git bisect start b9011c7e671dbbf59bb753283ddfd03f0c9eb865 62fb9874f5da54fdb243003b386128037319b219 Bisecting: 11799 revisions left to test after this (roughly 14 steps) [8e4f3e15175ffab5d2126dc8e7c8cfcc1654a5aa] Merge tag 'fuse-update-5.14' of git://git.kernel.org/pub/scm/linux/kernel/git/mszeredi/fuse testing commit 8e4f3e15175ffab5d2126dc8e7c8cfcc1654a5aa compiler: gcc (GCC) 10.2.1 20210217, GNU ld (GNU Binutils for Debian) 2.35.1 kernel signature: 031c33434c4cdd2994c0fc39e43e9518364a1507bf1c2bcccd73328659b70be5 run #0: boot failed: BUG: sleeping function called from invalid context in stack_depot_save run #1: boot failed: kernel panic: VFS: Unable to mount root fs on unknown-block(NUM,NUM) run #2: boot failed: kernel panic: VFS: Unable to mount root fs on unknown-block(NUM,NUM) run #3: boot failed: BUG: sleeping function called from invalid context in stack_depot_save run #4: boot failed: kernel panic: VFS: Unable to mount root fs on unknown-block(NUM,NUM) run #5: boot failed: BUG: sleeping function called from invalid context in stack_depot_save run #6: boot failed: BUG: sleeping function called from invalid context in stack_depot_save run #7: boot failed: kernel panic: VFS: Unable to mount root fs on unknown-block(NUM,NUM) run #8: boot failed: kernel panic: VFS: Unable to mount root fs on unknown-block(NUM,NUM) run #9: boot failed: possible deadlock in get_page_from_freelist # git bisect skip 8e4f3e15175ffab5d2126dc8e7c8cfcc1654a5aa Bisecting: 11799 revisions left to test after this (roughly 14 steps) [cdb14e0f7775e767484843e8ecd736bb21754c58] blk-mq: factor out a blk_mq_alloc_sq_tag_set helper testing commit cdb14e0f7775e767484843e8ecd736bb21754c58 compiler: gcc (GCC) 10.2.1 20210217, GNU ld (GNU Binutils for Debian) 2.35.1 kernel signature: 3e810dec7dc13fb332701602fea4c1d9272c816d4f37ac60ee720ca32e9acb92 all runs: OK # git bisect good cdb14e0f7775e767484843e8ecd736bb21754c58 Bisecting: 11784 revisions left to test after this (roughly 14 steps) [4c55e2aeb8082cb118cd63596bfe0dc5247b78e1] Merge tag 'for-linus' of git://github.com/openrisc/linux testing commit 4c55e2aeb8082cb118cd63596bfe0dc5247b78e1 compiler: gcc (GCC) 10.2.1 20210217, GNU ld (GNU Binutils for Debian) 2.35.1 kernel signature: 031c33434c4cdd2994c0fc39e43e9518364a1507bf1c2bcccd73328659b70be5 run #0: boot failed: possible deadlock in get_page_from_freelist run #1: boot failed: BUG: sleeping function called from invalid context in stack_depot_save run #2: boot failed: kernel panic: VFS: Unable to mount root fs on unknown-block(NUM,NUM) run #3: boot failed: possible deadlock in fs_reclaim_acquire run #4: boot failed: kernel panic: VFS: Unable to mount root fs on unknown-block(NUM,NUM) run #5: boot failed: BUG: sleeping function called from invalid context in stack_depot_save run #6: boot failed: possible deadlock in get_page_from_freelist run #7: boot failed: BUG: sleeping function called from invalid context in stack_depot_save run #8: boot failed: BUG: sleeping function called from invalid context in stack_depot_save run #9: boot failed: kernel panic: VFS: Unable to mount root fs on unknown-block(NUM,NUM) # git bisect skip 4c55e2aeb8082cb118cd63596bfe0dc5247b78e1 Bisecting: 11784 revisions left to test after this (roughly 14 steps) [d5c9d0a207f4c61734ccd4b51818788e8b86296a] mt76: mt7921: Fix fall-through warning for Clang testing commit d5c9d0a207f4c61734ccd4b51818788e8b86296a compiler: gcc (GCC) 10.2.1 20210217, GNU ld (GNU Binutils for Debian) 2.35.1 kernel signature: d9f5ef2aa2e4ee219a16a8500a3c819c1de6b9d85797a969770a042a68195305 run #0: basic kernel testing failed: possible deadlock in fs_reclaim_acquire run #1: OK run #2: OK run #3: OK run #4: OK run #5: OK run #6: OK run #7: OK run #8: OK run #9: OK # git bisect good d5c9d0a207f4c61734ccd4b51818788e8b86296a Bisecting: 4480 revisions left to test after this (roughly 12 steps) [34698bb637479092493ec56c31c20422db0e4c1c] Merge remote-tracking branch 'net-next/master' testing commit 34698bb637479092493ec56c31c20422db0e4c1c compiler: gcc (GCC) 10.2.1 20210217, GNU ld (GNU Binutils for Debian) 2.35.1 kernel signature: dc9fb8d464efa82542cd4864d2773617cd4478fa79f3a68598dbbcac7b506bb5 all runs: OK # git bisect good 34698bb637479092493ec56c31c20422db0e4c1c Bisecting: 2275 revisions left to test after this (roughly 11 steps) [bb4af596b7c019a76762c9b7527daba259623f65] Merge remote-tracking branch 'spi/for-next' testing commit bb4af596b7c019a76762c9b7527daba259623f65 compiler: gcc (GCC) 10.2.1 20210217, GNU ld (GNU Binutils for Debian) 2.35.1 kernel signature: d3893b25c1e2fec53215fe371cb1e7569687f452027325231ced29f1c9fe77d8 all runs: crashed: general protection fault in __io_queue_sqe # git bisect bad bb4af596b7c019a76762c9b7527daba259623f65 Bisecting: 1102 revisions left to test after this (roughly 10 steps) [a22c074fd1dd52a8b41dd6789220409b64093e9c] Merge tag 'drm-intel-next-2021-08-10-1' of git://anongit.freedesktop.org/drm/drm-intel into drm-next testing commit a22c074fd1dd52a8b41dd6789220409b64093e9c compiler: gcc (GCC) 10.2.1 20210217, GNU ld (GNU Binutils for Debian) 2.35.1 kernel signature: 767b726092fe771f135f8541109f51ae6bb4ca02a5065a13d62c0391f2df5ceb all runs: OK # git bisect good a22c074fd1dd52a8b41dd6789220409b64093e9c Bisecting: 472 revisions left to test after this (roughly 9 steps) [d81daed08674a6abd8ed401cab04b7f9b721fd80] Merge remote-tracking branch 'sound-asoc/for-next' testing commit d81daed08674a6abd8ed401cab04b7f9b721fd80 compiler: gcc (GCC) 10.2.1 20210217, GNU ld (GNU Binutils for Debian) 2.35.1 kernel signature: 47244b8acc704bf4fe0dca539774cb02c0bea22468d14c679e13ec49cceee901 all runs: OK # git bisect good d81daed08674a6abd8ed401cab04b7f9b721fd80 Bisecting: 241 revisions left to test after this (roughly 8 steps) [a967de311126ed56b8de6decaf1d5e5001b3e732] Merge remote-tracking branch 'mmc/next' testing commit a967de311126ed56b8de6decaf1d5e5001b3e732 compiler: gcc (GCC) 10.2.1 20210217, GNU ld (GNU Binutils for Debian) 2.35.1 kernel signature: 99b5a2a9b76afc0e2128137f9e11d23b2340f2bc143b8e41a2ab2ec21cb82b6c all runs: crashed: general protection fault in __io_queue_sqe # git bisect bad a967de311126ed56b8de6decaf1d5e5001b3e732 Bisecting: 111 revisions left to test after this (roughly 7 steps) [6db418f3dc5550f861287ce6ddaceb33788fb9fc] Merge branch 'for-5.15/block' into for-next testing commit 6db418f3dc5550f861287ce6ddaceb33788fb9fc compiler: gcc (GCC) 10.2.1 20210217, GNU ld (GNU Binutils for Debian) 2.35.1 kernel signature: c7944ca7d2739c2c25a0725feb845b649612f8faa32bcbee116fd6cf2a324179 all runs: OK # git bisect good 6db418f3dc5550f861287ce6ddaceb33788fb9fc Bisecting: 55 revisions left to test after this (roughly 6 steps) [0f6eedb0a71cd302db26cb0d88427771b0eaf8b2] Merge branch 'for-5.15/io_uring' into for-next testing commit 0f6eedb0a71cd302db26cb0d88427771b0eaf8b2 compiler: gcc (GCC) 10.2.1 20210217, GNU ld (GNU Binutils for Debian) 2.35.1 kernel signature: a3d95341776982e38bc8e853ccecbf84df186f9593a2426d083910b51b018395 all runs: crashed: general protection fault in __io_queue_sqe # git bisect bad 0f6eedb0a71cd302db26cb0d88427771b0eaf8b2 Bisecting: 27 revisions left to test after this (roughly 5 steps) [8299ab6b77ef92f837de2a1d64303860f9eaec68] Merge branch 'for-5.15/drivers' into for-next testing commit 8299ab6b77ef92f837de2a1d64303860f9eaec68 compiler: gcc (GCC) 10.2.1 20210217, GNU ld (GNU Binutils for Debian) 2.35.1 kernel signature: 6026cfbcb687b26a528816f0f66b34ea060c0030f29f9e50db97f369b7888317 run #0: basic kernel testing failed: KFENCE: use-after-free in kvm_fastop_exception run #1: OK run #2: OK run #3: OK run #4: OK run #5: OK run #6: OK run #7: OK run #8: OK run #9: OK # git bisect good 8299ab6b77ef92f837de2a1d64303860f9eaec68 Bisecting: 13 revisions left to test after this (roughly 4 steps) [bd492d3edbed5e3eec9fa188f64390ca89532ead] Merge branch 'for-5.15/drivers' into for-next testing commit bd492d3edbed5e3eec9fa188f64390ca89532ead compiler: gcc (GCC) 10.2.1 20210217, GNU ld (GNU Binutils for Debian) 2.35.1 kernel signature: b346d318cddbf96dd39edaf3ec9ee8ed9e81f73db4df07506c9d140c3b969fd3 all runs: OK # git bisect good bd492d3edbed5e3eec9fa188f64390ca89532ead Bisecting: 6 revisions left to test after this (roughly 3 steps) [4e9b49dd086d875960058bb1291f173db670cea0] io_uring: simplify io_prep_linked_timeout testing commit 4e9b49dd086d875960058bb1291f173db670cea0 compiler: gcc (GCC) 10.2.1 20210217, GNU ld (GNU Binutils for Debian) 2.35.1 kernel signature: 6d693b88ec99c29feda120555f8507c94c362dc4f399e9cb447987e1d0e07f00 all runs: OK # git bisect good 4e9b49dd086d875960058bb1291f173db670cea0 Bisecting: 2 revisions left to test after this (roughly 2 steps) [0a26aaa4571314d767b77de8d250b6108626b9e1] Merge branch 'for-5.15/block' into for-next testing commit 0a26aaa4571314d767b77de8d250b6108626b9e1 compiler: gcc (GCC) 10.2.1 20210217, GNU ld (GNU Binutils for Debian) 2.35.1 kernel signature: 71f06dbd2507ac3cbbde2cf1456c0033f9633eb15ca7195f5261f3cd30aeba96 all runs: OK # git bisect good 0a26aaa4571314d767b77de8d250b6108626b9e1 Bisecting: 0 revisions left to test after this (roughly 1 step) [483fc4e30869f8bd1693aca9cffddb21fb303b32] io_uring: optimise io_prep_linked_timeout() testing commit 483fc4e30869f8bd1693aca9cffddb21fb303b32 compiler: gcc (GCC) 10.2.1 20210217, GNU ld (GNU Binutils for Debian) 2.35.1 kernel signature: 2e0af66de63202f481377d689f8d8da7896caa198a5d04372d439d3487c9108a all runs: crashed: general protection fault in __io_queue_sqe # git bisect bad 483fc4e30869f8bd1693aca9cffddb21fb303b32 Bisecting: 0 revisions left to test after this (roughly 0 steps) [72f42973a559fb5a59fd66bbf277966ce81d1c8a] io_uring: cancel not-armed linked touts separately testing commit 72f42973a559fb5a59fd66bbf277966ce81d1c8a compiler: gcc (GCC) 10.2.1 20210217, GNU ld (GNU Binutils for Debian) 2.35.1 kernel signature: 396e6d51fd68a57c1a29f7a1a997f716553205c1a37f9bd027127b82baa25d1d all runs: OK # git bisect good 72f42973a559fb5a59fd66bbf277966ce81d1c8a 483fc4e30869f8bd1693aca9cffddb21fb303b32 is the first bad commit commit 483fc4e30869f8bd1693aca9cffddb21fb303b32 Author: Pavel Begunkov Date: Sun Aug 15 10:40:26 2021 +0100 io_uring: optimise io_prep_linked_timeout() Linked timeout handling during issuing is heavy, it adds extra instructions and forces to save the next linked timeout before io_issue_sqe(). Follwing the same reasoning as in refcounting patches, a request can't be freed by the time it returns from io_issue_sqe(), so now we don't need to do io_prep_linked_timeout() in advance, and it can be delayed to colder paths optimising the generic path. Also, it should also save quite a lot for requests with linked timeouts and completed inline on timeout spinlocking + hrtimer_start() + hrtimer_try_to_cancel() and so on. Signed-off-by: Pavel Begunkov Link: https://lore.kernel.org/r/19bfc9a0d26c5c5f1e359f7650afe807ca8ef879.1628981736.git.asml.silence@gmail.com Signed-off-by: Jens Axboe fs/io_uring.c | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) culprit signature: 2e0af66de63202f481377d689f8d8da7896caa198a5d04372d439d3487c9108a parent signature: 396e6d51fd68a57c1a29f7a1a997f716553205c1a37f9bd027127b82baa25d1d revisions tested: 19, total time: 4h29m4.811190327s (build: 2h5m14.31054015s, test: 2h21m48.779559252s) first bad commit: 483fc4e30869f8bd1693aca9cffddb21fb303b32 io_uring: optimise io_prep_linked_timeout() recipients (to): ["asml.silence@gmail.com" "axboe@kernel.dk" "axboe@kernel.dk" "io-uring@vger.kernel.org"] recipients (cc): ["asml.silence@gmail.com" "linux-kernel@vger.kernel.org"] crash: general protection fault in __io_queue_sqe general protection fault, probably for non-canonical address 0xdffffc000000000b: 0000 [#1] PREEMPT SMP KASAN KASAN: null-ptr-deref in range [0x0000000000000058-0x000000000000005f] CPU: 0 PID: 10185 Comm: syz-executor.3 Not tainted 5.14.0-rc5-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 RIP: 0010:__io_req_set_refcount fs/io_uring.c:1123 [inline] RIP: 0010:__io_prep_linked_timeout fs/io_uring.c:1319 [inline] RIP: 0010:io_prep_linked_timeout fs/io_uring.c:1327 [inline] RIP: 0010:__io_queue_sqe+0x1fb/0xcf0 fs/io_uring.c:6512 Code: 89 ea 48 c1 ea 03 80 3c 02 00 0f 85 50 0a 00 00 48 b8 00 00 00 00 00 fc ff df 4c 8b 65 70 49 8d 7c 24 58 48 89 fa 48 c1 ea 03 <0f> b6 04 02 84 c0 74 08 3c 03 0f 8e a0 08 00 00 41 8b 44 24 58 a9 RSP: 0018:ffffc9000aaefd50 EFLAGS: 00010202 RAX: dffffc0000000000 RBX: 1ffff9200155dfb0 RCX: ffffffff81c74e8d RDX: 000000000000000b RSI: 0000000000000004 RDI: 0000000000000058 RBP: ffff88801b9e8280 R08: 0000000000000001 R09: ffff88801b9e82df R10: ffffed100373d05b R11: ffff8881441b26a0 R12: 0000000000000000 R13: ffff88801b9e82f0 R14: dffffc0000000000 R15: ffff88801b9e8310 FS: 00007f379013c700(0000) GS:ffff8880b9e00000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 0000555579f14438 CR3: 00000000168a8000 CR4: 00000000001506f0 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 Call Trace: io_req_task_submit+0x93/0x110 fs/io_uring.c:2110 tctx_task_work+0x110/0x420 fs/io_uring.c:2034 task_work_run+0xc0/0x160 kernel/task_work.c:164 tracehook_notify_signal include/linux/tracehook.h:212 [inline] handle_signal_work kernel/entry/common.c:146 [inline] exit_to_user_mode_loop kernel/entry/common.c:172 [inline] exit_to_user_mode_prepare+0x256/0x290 kernel/entry/common.c:209 __syscall_exit_to_user_mode_work kernel/entry/common.c:291 [inline] syscall_exit_to_user_mode+0x19/0x60 kernel/entry/common.c:302 do_syscall_64+0x42/0xb0 arch/x86/entry/common.c:86 entry_SYSCALL_64_after_hwframe+0x44/0xae RIP: 0033:0x4665e9 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 bc ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007f379013c188 EFLAGS: 00000246 ORIG_RAX: 00000000000001aa RAX: 0000000000000200 RBX: 000000000056bf80 RCX: 00000000004665e9 RDX: 0000000000000000 RSI: 00000000000045f5 RDI: 0000000000000003 RBP: 00000000004bfcc4 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 000000000056bf80 R13: 00007fff1cc41a4f R14: 00007f379013c300 R15: 0000000000022000 Modules linked in: ---[ end trace 014404aba8a8c3d0 ]--- RIP: 0010:__io_req_set_refcount fs/io_uring.c:1123 [inline] RIP: 0010:__io_prep_linked_timeout fs/io_uring.c:1319 [inline] RIP: 0010:io_prep_linked_timeout fs/io_uring.c:1327 [inline] RIP: 0010:__io_queue_sqe+0x1fb/0xcf0 fs/io_uring.c:6512 Code: 89 ea 48 c1 ea 03 80 3c 02 00 0f 85 50 0a 00 00 48 b8 00 00 00 00 00 fc ff df 4c 8b 65 70 49 8d 7c 24 58 48 89 fa 48 c1 ea 03 <0f> b6 04 02 84 c0 74 08 3c 03 0f 8e a0 08 00 00 41 8b 44 24 58 a9 RSP: 0018:ffffc9000aaefd50 EFLAGS: 00010202 RAX: dffffc0000000000 RBX: 1ffff9200155dfb0 RCX: ffffffff81c74e8d RDX: 000000000000000b RSI: 0000000000000004 RDI: 0000000000000058 RBP: ffff88801b9e8280 R08: 0000000000000001 R09: ffff88801b9e82df R10: ffffed100373d05b R11: ffff8881441b26a0 R12: 0000000000000000 R13: ffff88801b9e82f0 R14: dffffc0000000000 R15: ffff88801b9e8310 FS: 00007f379013c700(0000) GS:ffff8880b9e00000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 00007f5d40ece000 CR3: 00000000168a8000 CR4: 00000000001506f0 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 ---------------- Code disassembly (best guess): 0: 89 ea mov %ebp,%edx 2: 48 c1 ea 03 shr $0x3,%rdx 6: 80 3c 02 00 cmpb $0x0,(%rdx,%rax,1) a: 0f 85 50 0a 00 00 jne 0xa60 10: 48 b8 00 00 00 00 00 movabs $0xdffffc0000000000,%rax 17: fc ff df 1a: 4c 8b 65 70 mov 0x70(%rbp),%r12 1e: 49 8d 7c 24 58 lea 0x58(%r12),%rdi 23: 48 89 fa mov %rdi,%rdx 26: 48 c1 ea 03 shr $0x3,%rdx 2a: 0f b6 04 02 movzbl (%rdx,%rax,1),%eax <-- trapping instruction 2e: 84 c0 test %al,%al 30: 74 08 je 0x3a 32: 3c 03 cmp $0x3,%al 34: 0f 8e a0 08 00 00 jle 0x8da 3a: 41 8b 44 24 58 mov 0x58(%r12),%eax 3f: a9 .byte 0xa9