bisecting cause commit starting from 2a1d7946fa53cea2083e5981ff55a8176ab2be6b building syzkaller on 36c88236dfc6146c2c536718c8930886cf31adbe testing commit 2a1d7946fa53cea2083e5981ff55a8176ab2be6b with gcc (GCC) 10.2.1 20210217 kernel signature: bc317b58c048f5dc129012f6681aa206aafdb617752bd2217d7fea0a24361da3 all runs: crashed: possible deadlock in sctp_addr_wq_timeout_handler testing release v5.11 testing commit f40ddce88593482919761f74910f42f4b84c004b with gcc (GCC) 10.2.1 20210217 kernel signature: 293e6579f0d65cbda46b2d20e15f30555f6e4ea292502f9356c74a1affb84b2f all runs: OK # git bisect start 2a1d7946fa53cea2083e5981ff55a8176ab2be6b f40ddce88593482919761f74910f42f4b84c004b Bisecting: 6783 revisions left to test after this (roughly 13 steps) [d99676af540c2dc829999928fb81c58c80a1dce4] Merge tag 'drm-next-2021-02-19' of git://anongit.freedesktop.org/drm/drm testing commit d99676af540c2dc829999928fb81c58c80a1dce4 with gcc (GCC) 10.2.1 20210217 kernel signature: fa41a26c30eb2809c43f280e5d054c5b5eeae7eda808bec3137f533b4faac18b run #0: crashed: WARNING in kvm_wait run #1: crashed: WARNING in kvm_wait run #2: crashed: WARNING in kvm_wait run #3: crashed: WARNING in kvm_wait run #4: OK run #5: OK run #6: OK run #7: OK run #8: OK run #9: OK reproducer seems to be flaky # git bisect bad d99676af540c2dc829999928fb81c58c80a1dce4 Bisecting: 3717 revisions left to test after this (roughly 12 steps) [f9d58de23152f2c16f326d7e014cfa2933b00304] Merge tag 'affs-for-5.12-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/kdave/linux testing commit f9d58de23152f2c16f326d7e014cfa2933b00304 with gcc (GCC) 10.2.1 20210217 kernel signature: 665fbf144a3a1cf6cce6aa7a6744860b212ea31bf70bf233190572551e9c555b all runs: OK # git bisect good f9d58de23152f2c16f326d7e014cfa2933b00304 Bisecting: 1854 revisions left to test after this (roughly 11 steps) [de1617578849acab8e16c9ffdce39b91fb50639d] Merge tag 'media/v5.12-1' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-media testing commit de1617578849acab8e16c9ffdce39b91fb50639d with gcc (GCC) 10.2.1 20210217 kernel signature: 0c85d207fcb2b1a844eb52dc2a3154b912a453c00fa142192f33c884007fbba7 run #0: crashed: WARNING in kvm_wait run #1: crashed: WARNING in kvm_wait run #2: crashed: WARNING in kvm_wait run #3: crashed: WARNING in kvm_wait run #4: crashed: WARNING in kvm_wait run #5: crashed: WARNING in kvm_wait run #6: crashed: WARNING in kvm_wait run #7: crashed: WARNING in kvm_wait run #8: crashed: WARNING in kvm_wait run #9: crashed: WARNING in kvm_wait run #10: crashed: WARNING in kvm_wait run #11: boot failed: WARNING in kvm_wait run #12: OK run #13: OK run #14: OK run #15: OK run #16: OK run #17: OK run #18: OK run #19: OK # git bisect bad de1617578849acab8e16c9ffdce39b91fb50639d Bisecting: 929 revisions left to test after this (roughly 10 steps) [4a037ad5d115b2cc79a5071a7854475f365476fa] Merge tag 'for-linus-5.12-rc1-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/xen/tip testing commit 4a037ad5d115b2cc79a5071a7854475f365476fa with gcc (GCC) 10.2.1 20210217 kernel signature: c75a82230c27395fc919f84a529f6fd1bf97fdcdcf0d68945111763d06d4a76b run #0: crashed: WARNING in kvm_wait run #1: crashed: WARNING in kvm_wait run #2: crashed: WARNING in kvm_wait run #3: crashed: WARNING in kvm_wait run #4: crashed: WARNING in kvm_wait run #5: crashed: WARNING in kvm_wait run #6: crashed: WARNING in kvm_wait run #7: crashed: WARNING in kvm_wait run #8: crashed: WARNING in kvm_wait run #9: crashed: WARNING in kvm_wait run #10: crashed: WARNING in kvm_wait run #11: OK run #12: OK run #13: OK run #14: OK run #15: OK run #16: OK run #17: OK run #18: OK run #19: OK # git bisect bad 4a037ad5d115b2cc79a5071a7854475f365476fa Bisecting: 451 revisions left to test after this (roughly 9 steps) [582cd91f69de8e44857cb610ebca661dac8656b7] Merge tag 'for-5.12/block-2021-02-17' of git://git.kernel.dk/linux-block testing commit 582cd91f69de8e44857cb610ebca661dac8656b7 with gcc (GCC) 10.2.1 20210217 kernel signature: 2b7284c22d81c9deca798d7b2d828a5235b256960a05cc77cb9717c254e8ea43 all runs: OK # git bisect good 582cd91f69de8e44857cb610ebca661dac8656b7 Bisecting: 247 revisions left to test after this (roughly 8 steps) [3f6ec19f2d05d800bbc42d95dece433da7697864] Merge tag 'timers-core-2021-02-15' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip testing commit 3f6ec19f2d05d800bbc42d95dece433da7697864 with gcc (GCC) 10.2.1 20210217 kernel signature: dee92d1a1c66349050804e816574e79a0e395555fe9abe69009007aa3875b1f1 all runs: OK # git bisect good 3f6ec19f2d05d800bbc42d95dece433da7697864 Bisecting: 125 revisions left to test after this (roughly 7 steps) [85e853c5ec8486117182baab10c98b321daa6d47] Merge branch 'for-mingo-rcu' of git://git.kernel.org/pub/scm/linux/kernel/git/paulmck/linux-rcu into core/rcu testing commit 85e853c5ec8486117182baab10c98b321daa6d47 with gcc (GCC) 10.2.1 20210217 kernel signature: 46d76a435f923404c8dc4c3b3f7eba6de78739fda3ca88e0045e1d5b55612ea4 all runs: OK # git bisect good 85e853c5ec8486117182baab10c98b321daa6d47 Bisecting: 73 revisions left to test after this (roughly 6 steps) [c5e6fc08feb2b88dc5dac2f3c817e1c2a4cafda4] sched,x86: Allow !PREEMPT_DYNAMIC testing commit c5e6fc08feb2b88dc5dac2f3c817e1c2a4cafda4 with gcc (GCC) 10.2.1 20210217 kernel signature: 6cc79bb575fffab332d0a33bf223a83cc3955ca3258d107c1fa834aa3f504baf all runs: OK # git bisect good c5e6fc08feb2b88dc5dac2f3c817e1c2a4cafda4 Bisecting: 33 revisions left to test after this (roughly 5 steps) [9eef02334505411667a7b51a8f349f8c6c4f3b66] Merge tag 'locking-core-2021-02-17' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip testing commit 9eef02334505411667a7b51a8f349f8c6c4f3b66 with gcc (GCC) 10.2.1 20210217 kernel signature: 19c1ba5885ef94ecdbb255d1c97c24e1d175ef45db97a04ab10a9b1cc55c158b run #0: crashed: WARNING in kvm_wait run #1: crashed: WARNING in kvm_wait run #2: crashed: WARNING in kvm_wait run #3: crashed: WARNING in kvm_wait run #4: crashed: WARNING in kvm_wait run #5: crashed: WARNING in kvm_wait run #6: crashed: WARNING in kvm_wait run #7: crashed: WARNING in kvm_wait run #8: crashed: WARNING in kvm_wait run #9: crashed: WARNING in kvm_wait run #10: crashed: WARNING in kvm_wait run #11: boot failed: WARNING in kvm_wait run #12: OK run #13: OK run #14: OK run #15: OK run #16: OK run #17: OK run #18: OK run #19: OK # git bisect bad 9eef02334505411667a7b51a8f349f8c6c4f3b66 Bisecting: 19 revisions left to test after this (roughly 4 steps) [62137364e3e8afcc745846c5c67cacf943149073] Merge branch 'linus' into locking/core, to pick up upstream fixes testing commit 62137364e3e8afcc745846c5c67cacf943149073 with gcc (GCC) 10.2.1 20210217 kernel signature: d10a129b2cee48b2452584ac81402537383264fa09672db4ea9f390462d6d558 run #0: crashed: WARNING in kvm_wait run #1: crashed: WARNING in kvm_wait run #2: crashed: WARNING in kvm_wait run #3: crashed: WARNING in kvm_wait run #4: crashed: WARNING in kvm_wait run #5: crashed: WARNING in kvm_wait run #6: crashed: WARNING in kvm_wait run #7: crashed: WARNING in kvm_wait run #8: crashed: WARNING in kvm_wait run #9: crashed: WARNING in kvm_wait run #10: crashed: WARNING in kvm_wait run #11: crashed: WARNING in kvm_wait run #12: crashed: WARNING in kvm_wait run #13: crashed: WARNING in kvm_wait run #14: boot failed: WARNING in kvm_wait run #15: boot failed: WARNING in kvm_wait run #16: boot failed: WARNING in kvm_wait run #17: OK run #18: OK run #19: OK # git bisect bad 62137364e3e8afcc745846c5c67cacf943149073 Bisecting: 9 revisions left to test after this (roughly 3 steps) [997acaf6b4b59c6a9c259740312a69ea549cc684] lockdep: report broken irq restoration testing commit 997acaf6b4b59c6a9c259740312a69ea549cc684 with gcc (GCC) 10.2.1 20210217 kernel signature: d97410920c25b0aa45d97b3ef5bf96ef6eb46b1a562b2dc990337fd4cada67ff run #0: crashed: WARNING in kvm_wait run #1: crashed: WARNING in kvm_wait run #2: crashed: WARNING in kvm_wait run #3: crashed: WARNING in kvm_wait run #4: crashed: WARNING in kvm_wait run #5: crashed: WARNING in kvm_wait run #6: crashed: WARNING in kvm_wait run #7: crashed: WARNING in kvm_wait run #8: crashed: WARNING in kvm_wait run #9: crashed: WARNING in kvm_wait run #10: crashed: WARNING in kvm_wait run #11: crashed: WARNING in kvm_wait run #12: crashed: WARNING in kvm_wait run #13: crashed: WARNING in kvm_wait run #14: crashed: WARNING in kvm_wait run #15: crashed: WARNING in kvm_wait run #16: OK run #17: OK run #18: OK run #19: OK # git bisect bad 997acaf6b4b59c6a9c259740312a69ea549cc684 Bisecting: 4 revisions left to test after this (roughly 2 steps) [175b1a60e8805617d74aefe17ce0d3a32eceb55c] locking/lockdep: Clean up check_redundant() a bit testing commit 175b1a60e8805617d74aefe17ce0d3a32eceb55c with gcc (GCC) 10.2.1 20210217 kernel signature: 088bcb7d587c998e27dee73ffe02dca88b7a5e36ed9cf872a9fc0085c5b7bae2 all runs: OK # git bisect good 175b1a60e8805617d74aefe17ce0d3a32eceb55c Bisecting: 2 revisions left to test after this (roughly 1 step) [7e923e6a3ceb877497dd9ee70d71fa33b94f332b] locking/selftests: Add local_lock inversion tests testing commit 7e923e6a3ceb877497dd9ee70d71fa33b94f332b with gcc (GCC) 10.2.1 20210217 kernel signature: 7c8257325884b4d0090d3718fcc5a705f2aa6ce136cb0bccd37304dc7b8f9247 all runs: OK # git bisect good 7e923e6a3ceb877497dd9ee70d71fa33b94f332b Bisecting: 0 revisions left to test after this (roughly 1 step) [2f0df49c89acaa58571d509830bc481250699885] jump_label: Do not profile branch annotations testing commit 2f0df49c89acaa58571d509830bc481250699885 with gcc (GCC) 10.2.1 20210217 kernel signature: 7c8257325884b4d0090d3718fcc5a705f2aa6ce136cb0bccd37304dc7b8f9247 all runs: OK # git bisect good 2f0df49c89acaa58571d509830bc481250699885 997acaf6b4b59c6a9c259740312a69ea549cc684 is the first bad commit commit 997acaf6b4b59c6a9c259740312a69ea549cc684 Author: Mark Rutland Date: Mon Jan 11 15:37:07 2021 +0000 lockdep: report broken irq restoration We generally expect local_irq_save() and local_irq_restore() to be paired and sanely nested, and so local_irq_restore() expects to be called with irqs disabled. Thus, within local_irq_restore() we only trace irq flag changes when unmasking irqs. This means that a sequence such as: | local_irq_disable(); | local_irq_save(flags); | local_irq_enable(); | local_irq_restore(flags); ... is liable to break things, as the local_irq_restore() would mask irqs without tracing this change. Similar problems may exist for architectures whose arch_irq_restore() function depends on being called with irqs disabled. We don't consider such sequences to be a good idea, so let's define those as forbidden, and add tooling to detect such broken cases. This patch adds debug code to WARN() when raw_local_irq_restore() is called with irqs enabled. As raw_local_irq_restore() is expected to pair with raw_local_irq_save(), it should never be called with irqs enabled. To avoid the possibility of circular header dependencies between irqflags.h and bug.h, the warning is handled in a separate C file. The new code is all conditional on a new CONFIG_DEBUG_IRQFLAGS symbol which is independent of CONFIG_TRACE_IRQFLAGS. As noted above such cases will confuse lockdep, so CONFIG_DEBUG_LOCKDEP now selects CONFIG_DEBUG_IRQFLAGS. Signed-off-by: Mark Rutland Signed-off-by: Peter Zijlstra (Intel) Link: https://lkml.kernel.org/r/20210111153707.10071-1-mark.rutland@arm.com include/linux/irqflags.h | 12 ++++++++++++ kernel/locking/Makefile | 1 + kernel/locking/irqflag-debug.c | 11 +++++++++++ lib/Kconfig.debug | 8 ++++++++ 4 files changed, 32 insertions(+) create mode 100644 kernel/locking/irqflag-debug.c culprit signature: d97410920c25b0aa45d97b3ef5bf96ef6eb46b1a562b2dc990337fd4cada67ff parent signature: 7c8257325884b4d0090d3718fcc5a705f2aa6ce136cb0bccd37304dc7b8f9247 Reproducer flagged being flaky revisions tested: 16, total time: 4h55m48.168569635s (build: 1h47m35.767716667s, test: 3h5m58.639703627s) first bad commit: 997acaf6b4b59c6a9c259740312a69ea549cc684 lockdep: report broken irq restoration recipients (to): ["linux-kernel@vger.kernel.org" "mark.rutland@arm.com" "mingo@redhat.com" "peterz@infradead.org" "peterz@infradead.org" "will@kernel.org"] recipients (cc): ["akpm@linux-foundation.org" "masahiroy@kernel.org" "rafael.j.wysocki@intel.com" "rostedt@goodmis.org" "tglx@linutronix.de"] crash: WARNING in kvm_wait ------------[ cut here ]------------ raw_local_irq_restore() called with IRQs enabled WARNING: CPU: 1 PID: 7889 at kernel/locking/irqflag-debug.c:9 warn_bogus_irq_restore kernel/locking/irqflag-debug.c:9 [inline] WARNING: CPU: 1 PID: 7889 at kernel/locking/irqflag-debug.c:9 warn_bogus_irq_restore+0x1d/0x20 kernel/locking/irqflag-debug.c:7 Modules linked in: CPU: 1 PID: 7889 Comm: syz-executor.5 Not tainted 5.11.0-rc2-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 RIP: 0010:warn_bogus_irq_restore kernel/locking/irqflag-debug.c:9 [inline] RIP: 0010:warn_bogus_irq_restore+0x1d/0x20 kernel/locking/irqflag-debug.c:7 Code: 51 00 e9 3f fe ff ff cc cc cc cc cc cc 80 3d e0 b4 ce 0a 00 74 01 c3 48 c7 c7 60 f5 8a 88 c6 05 cf b4 ce 0a 01 e8 17 01 a4 06 <0f> 0b c3 48 c7 c0 a0 46 4d 8e 53 48 89 fb 48 ba 00 00 00 00 00 fc RSP: 0018:ffffc9000aa9f9e0 EFLAGS: 00010286 RAX: 0000000000000000 RBX: ffff888147745040 RCX: 0000000000000000 RDX: 0000000000000002 RSI: ffffffff88ddbcc0 RDI: fffff52001553f2e RBP: 0000000000000246 R08: 0000000000000001 R09: ffff8880b9f30827 R10: ffffed10173e6104 R11: 0000000000000001 R12: 0000000000000003 R13: ffffed1028ee8a08 R14: 0000000000000001 R15: ffff8880b9f359c0 FS: 00000000032ff400(0000) GS:ffff8880b9f00000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 00000000031d6808 CR3: 000000003c1b3000 CR4: 00000000001506e0 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 Call Trace: kvm_wait arch/x86/kernel/kvm.c:860 [inline] kvm_wait+0xc3/0xe0 arch/x86/kernel/kvm.c:837 pv_wait arch/x86/include/asm/paravirt.h:564 [inline] pv_wait_head_or_lock kernel/locking/qspinlock_paravirt.h:470 [inline] __pv_queued_spin_lock_slowpath+0x8b8/0xb40 kernel/locking/qspinlock.c:508 pv_queued_spin_lock_slowpath arch/x86/include/asm/paravirt.h:554 [inline] queued_spin_lock_slowpath arch/x86/include/asm/qspinlock.h:51 [inline] queued_spin_lock include/asm-generic/qspinlock.h:85 [inline] do_raw_spin_lock+0x200/0x2b0 kernel/locking/spinlock_debug.c:113 spin_lock include/linux/spinlock.h:354 [inline] ext4_lock_group fs/ext4/ext4.h:3379 [inline] __ext4_new_inode+0x2da2/0x44d0 fs/ext4/ialloc.c:1187 ext4_symlink+0x313/0xb20 fs/ext4/namei.c:3330 vfs_symlink fs/namei.c:3962 [inline] vfs_symlink+0x385/0x590 fs/namei.c:3948 do_symlinkat+0x1c3/0x210 fs/namei.c:3989 do_syscall_64+0x2d/0x70 arch/x86/entry/common.c:46 entry_SYSCALL_64_after_hwframe+0x44/0xa9 RIP: 0033:0x465f07 Code: 73 01 c3 48 c7 c1 bc ff ff ff f7 d8 64 89 01 48 83 c8 ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 44 00 00 b8 58 00 00 00 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:00007ffc3a330908 EFLAGS: 00000202 ORIG_RAX: 0000000000000058 RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 0000000000465f07 RDX: 00007ffc3a3309f3 RSI: 00000000004bfc63 RDI: 00007ffc3a3309e0 RBP: 0000000000000000 R08: 0000000000000000 R09: 00007ffc3a3307a0 R10: 00007ffc3a330657 R11: 0000000000000202 R12: 0000000000000001 R13: 0000000000000000 R14: 0000000000000001 R15: 00007ffc3a3309e0