WARNING in mark_lock

Status: fixed on 2019/08/27 17:15
Subsystems: kernel
[Documentation on labels]
Fix commit: 95fa145479fb bpf: sockmap/tls, close can race with map free
First crash: 1796d, last: 1736d
Cause bisection: introduced by (bisect log) :
commit e9db4ef6bf4ca9894bb324c76e01b8f1a16b2650
Author: John Fastabend <>
Date: Sat Jun 30 13:17:47 2018 +0000

  bpf: sockhash fix omitted bucket lock in sock_close

Crash: KASAN: use-after-free Write in bpf_tcp_close (log)
Repro: syz .config
Discussions (2)
Title Replies (including bot) Last reply
WARNING in mark_lock 9 (13) 2019/07/08 22:03
Reminder: 36 open syzbot bugs in "net/bpf" subsystem 1 (1) 2019/07/03 06:01
Similar bugs (2)
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
upstream WARNING in mark_lock (3) C done inconclusive 69 1456d 1637d 0/26 auto-obsoleted due to no activity on 2022/12/14 03:19
upstream WARNING in mark_lock (2) fs 14 1673d 1700d 13/26 fixed on 2019/10/27 22:28
Last patch testing requests (2)
Created Duration User Patch Repo Result
2019/07/08 16:21 17m git:// fix-unhash OK
2019/07/01 05:32 11m git:// ktls-unhash report log

Sample crash report:
------------[ cut here ]------------
WARNING: CPU: 0 PID: 9968 at kernel/locking/lockdep.c:167 hlock_class kernel/locking/lockdep.c:167 [inline]
WARNING: CPU: 0 PID: 9968 at kernel/locking/lockdep.c:167 hlock_class kernel/locking/lockdep.c:156 [inline]
WARNING: CPU: 0 PID: 9968 at kernel/locking/lockdep.c:167 mark_lock+0x22b/0x11e0 kernel/locking/lockdep.c:3594
Kernel panic - not syncing: panic_on_warn set ...
CPU: 0 PID: 9968 Comm: syz-executor.2 Not tainted 5.2.0-rc5-next-20190620 #19
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
Call Trace:
 __dump_stack lib/dump_stack.c:77 [inline]
 dump_stack+0x172/0x1f0 lib/dump_stack.c:113
 panic+0x2dc/0x755 kernel/panic.c:219
 __warn.cold+0x20/0x4c kernel/panic.c:576
 report_bug+0x263/0x2b0 lib/bug.c:186
 fixup_bug arch/x86/kernel/traps.c:179 [inline]
 fixup_bug arch/x86/kernel/traps.c:174 [inline]
 do_error_trap+0x11b/0x200 arch/x86/kernel/traps.c:272
 do_invalid_op+0x37/0x50 arch/x86/kernel/traps.c:291
 invalid_op+0x14/0x20 arch/x86/entry/entry_64.S:986
RIP: 0010:hlock_class kernel/locking/lockdep.c:167 [inline]
RIP: 0010:hlock_class kernel/locking/lockdep.c:156 [inline]
RIP: 0010:mark_lock+0x22b/0x11e0 kernel/locking/lockdep.c:3594
Code: d0 7c 08 84 d2 0f 85 33 0f 00 00 44 8b 15 4d 14 4a 08 45 85 d2 75 b6 48 c7 c6 c0 a6 8b 87 48 c7 c7 00 a7 8b 87 e8 ad e6 eb ff <0f> 0b 31 db e9 a8 fe ff ff 48 c7 c7 80 71 86 8a e8 f0 95 53 00 e9
RSP: 0018:ffff8880ae809ad0 EFLAGS: 00010082
RAX: 0000000000000000 RBX: 0000000000000f1d RCX: 0000000000000000
RDX: 0000000000010000 RSI: ffffffff815b37e6 RDI: ffffed1015d0134c
RBP: ffff8880ae809b20 R08: ffff88808662e0c0 R09: fffffbfff11b3285
R10: fffffbfff11b3284 R11: ffffffff88d99423 R12: 0000000000000000
R13: ffff88808662e9c8 R14: 000000000000004f R15: 00000000000c4f1d
 mark_usage kernel/locking/lockdep.c:3485 [inline]
 __lock_acquire+0x1e1a/0x4680 kernel/locking/lockdep.c:3839
 lock_acquire+0x190/0x410 kernel/locking/lockdep.c:4418
 __raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:110 [inline]
 _raw_spin_lock_irqsave+0x95/0xcd kernel/locking/spinlock.c:159
 try_to_wake_up+0x90/0x1430 kernel/sched/core.c:2000
 wake_up_process+0x10/0x20 kernel/sched/core.c:2114
 hrtimer_wakeup+0x48/0x60 kernel/time/hrtimer.c:1636
 __run_hrtimer kernel/time/hrtimer.c:1388 [inline]
 __hrtimer_run_queues+0x364/0xe40 kernel/time/hrtimer.c:1450
 hrtimer_interrupt+0x314/0x770 kernel/time/hrtimer.c:1508
 local_apic_timer_interrupt arch/x86/kernel/apic/apic.c:1041 [inline]
 smp_apic_timer_interrupt+0x12a/0x5b0 arch/x86/kernel/apic/apic.c:1066
 apic_timer_interrupt+0xf/0x20 arch/x86/entry/entry_64.S:806
Kernel Offset: disabled
Rebooting in 86400 seconds..

Crashes (2):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2019/06/20 23:45 linux-next dc636f5d78de 34bf9440 .config console log report syz ci-upstream-linux-next-kasan-gce-root
2019/08/19 02:05 usb-fuzzer d0847550e22d b8ceabfc .config console log report ci2-upstream-usb
* Struck through repros no longer work on HEAD.