inconsistent lock state in tap_sock_destruct

Status: upstream: reported C repro on 2026/11/12 16:37
Reported-by: syzbot+9b95127c085ee7d5e6ac@syzkaller.appspotmail.com
First crash: 12d, last: 1d04h
▶ ▼ Similar bugs (2)
Kernel Title Rank 🛈 Repro Cause bisect Fix bisect Count Last Reported Patched Status
linux-6.1 inconsistent lock state in tap_sock_destruct 4 syz, C 6 20h19m 7d04h 0/3 upstream: reported C repro on 2026/11/17 17:18
upstream inconsistent lock state in tap_sock_destruct net prio:low 4 syz, C done 6 2d02h 1h17m 0/29 upstream: reported C repro on 2026/11/24 20:44

Sample crash report:
================================
WARNING: inconsistent lock state
syzkaller #0 Not tainted
--------------------------------
inconsistent {SOFTIRQ-ON-W} -> {IN-SOFTIRQ-W} usage.
ksoftirqd/1/20 [HC0[0]:SC1[1]:HE1:SE0] takes:
ffff88805e9716e0 (&r->consumer_lock#3){+.?.}-{2:2}, at: spin_lock include/linux/spinlock.h:364 [inline]
ffff88805e9716e0 (&r->consumer_lock#3){+.?.}-{2:2}, at: ptr_ring_consume include/linux/ptr_ring.h:331 [inline]
ffff88805e9716e0 (&r->consumer_lock#3){+.?.}-{2:2}, at: ptr_ring_cleanup include/linux/ptr_ring.h:669 [inline]
ffff88805e9716e0 (&r->consumer_lock#3){+.?.}-{2:2}, at: tap_sock_destruct+0x31/0x490 drivers/net/tap.c:496
{SOFTIRQ-ON-W} state was registered at:
  lock_acquire+0x19f/0x400 kernel/locking/lockdep.c:5737
  __raw_spin_lock include/linux/spinlock_api_smp.h:142 [inline]
  _raw_spin_lock+0x2a/0x40 kernel/locking/spinlock.c:154
  spin_lock include/linux/spinlock.h:364 [inline]
  ptr_ring_consume include/linux/ptr_ring.h:331 [inline]
  ptr_ring_cleanup include/linux/ptr_ring.h:669 [inline]
  tap_sock_destruct+0x31/0x490 drivers/net/tap.c:496
  __sk_destruct+0x4f/0x840 net/core/sock.c:1960
  sock_put include/net/sock.h:1990 [inline]
  tap_put_queue drivers/net/tap.c:242 [inline]
  tap_release+0x308/0x3a0 drivers/net/tap.c:566
  __fput+0x212/0x8c0 fs/file_table.c:311
  task_work_run+0x125/0x1a0 kernel/task_work.c:188
  tracehook_notify_resume include/linux/tracehook.h:189 [inline]
  exit_to_user_mode_loop+0x10f/0x130 kernel/entry/common.c:184
  exit_to_user_mode_prepare+0xee/0x180 kernel/entry/common.c:217
  __syscall_exit_to_user_mode_work kernel/entry/common.c:299 [inline]
  syscall_exit_to_user_mode+0x16/0x40 kernel/entry/common.c:310
  do_syscall_64+0x58/0xa0 arch/x86/entry/common.c:86
  entry_SYSCALL_64_after_hwframe+0x66/0xd0
irq event stamp: 231722
hardirqs last  enabled at (231722): [<ffffffff81be7dd4>] kasan_quarantine_put+0xd4/0x210 mm/kasan/quarantine.c:231
hardirqs last disabled at (231721): [<ffffffff81be7d39>] kasan_quarantine_put+0x39/0x210 mm/kasan/quarantine.c:204
softirqs last  enabled at (231706): [<ffffffff81496644>] run_ksoftirqd+0xa4/0x100 kernel/softirq.c:943
softirqs last disabled at (231711): [<ffffffff81496644>] run_ksoftirqd+0xa4/0x100 kernel/softirq.c:943

other info that might help us debug this:
 Possible unsafe locking scenario:

       CPU0
       ----
  lock(&r->consumer_lock#3);
  <Interrupt>
    lock(&r->consumer_lock#3);

 *** DEADLOCK ***

1 lock held by ksoftirqd/1/20:
 #0: ffffffff8d11efa0 (rcu_read_lock){....}-{1:2}, at: rcu_lock_acquire+0x9/0x30 include/linux/rcupdate.h:313

stack backtrace:
CPU: 1 PID: 20 Comm: ksoftirqd/1 Not tainted syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 11/06/2026
Call Trace:
 <TASK>
 dump_stack_lvl+0x188/0x250 lib/dump_stack.c:106
 valid_state+0x13b/0x1d0 kernel/locking/lockdep.c:3999
 mark_lock_irq+0xa9/0x900 kernel/locking/lockdep.c:4202
 mark_lock+0x208/0x320 kernel/locking/lockdep.c:4664
 mark_usage kernel/locking/lockdep.c:-1 [inline]
 __lock_acquire+0xd77/0x7d40 kernel/locking/lockdep.c:5074
 lock_acquire+0x19f/0x400 kernel/locking/lockdep.c:5737
 __raw_spin_lock include/linux/spinlock_api_smp.h:142 [inline]
 _raw_spin_lock+0x2a/0x40 kernel/locking/spinlock.c:154
 spin_lock include/linux/spinlock.h:364 [inline]
 ptr_ring_consume include/linux/ptr_ring.h:331 [inline]
 ptr_ring_cleanup include/linux/ptr_ring.h:669 [inline]
 tap_sock_destruct+0x31/0x490 drivers/net/tap.c:496
 __sk_destruct+0x4f/0x840 net/core/sock.c:1960
 skb_release_head_state+0xf6/0x240 net/core/skbuff.c:729
 skb_release_all net/core/skbuff.c:740 [inline]
 __kfree_skb net/core/skbuff.c:756 [inline]
 kfree_skb_reason+0x7f/0x110 net/core/skbuff.c:776
 llc_rcv+0x6fe/0xbf0 net/llc/llc_input.c:-1
 __netif_receive_skb_one_core net/core/dev.c:5552 [inline]
 __netif_receive_skb+0xcc/0x290 net/core/dev.c:5666
 process_backlog+0x366/0x770 net/core/dev.c:6543
 __napi_poll+0xbb/0x430 net/core/dev.c:7102
 napi_poll net/core/dev.c:7169 [inline]
 net_rx_action+0x522/0xa80 net/core/dev.c:7259
 handle_softirqs+0x336/0x830 kernel/softirq.c:576
 run_ksoftirqd+0xa4/0x100 kernel/softirq.c:943
 smpboot_thread_fn+0x520/0x990 kernel/smpboot.c:164
 kthread+0x42e/0x520 kernel/kthread.c:334
 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:287
 </TASK>

Crashes (9):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2026/11/13 02:17 linux-5.15.y 29c6cdaac04a c0087d7f .config console log report syz / log C [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan inconsistent lock state in tap_sock_destruct
2026/11/23 17:44 linux-5.15.y 4f2df9a01754 e9bfbe3a .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan inconsistent lock state in tap_sock_destruct
2026/11/23 12:35 linux-5.15.y 4f2df9a01754 e9bfbe3a .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan inconsistent lock state in tap_sock_destruct
2026/11/20 20:53 linux-5.15.y 29c6cdaac04a b2c69459 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan inconsistent lock state in tap_sock_destruct
2026/11/19 07:52 linux-5.15.y 29c6cdaac04a f138241c .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan inconsistent lock state in tap_sock_destruct
2026/11/14 00:30 linux-5.15.y 29c6cdaac04a 819ebe34 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan inconsistent lock state in tap_sock_destruct
2026/11/13 11:49 linux-5.15.y 29c6cdaac04a be5d1971 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan inconsistent lock state in tap_sock_destruct
2026/11/13 11:48 linux-5.15.y 29c6cdaac04a be5d1971 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan inconsistent lock state in tap_sock_destruct
2026/11/12 16:37 linux-5.15.y 29c6cdaac04a c0087d7f .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan inconsistent lock state in tap_sock_destruct
* Struck through repros no longer work on HEAD.