syzbot


WARNING: bad unlock balance in seq_read_iter

Status: upstream: reported C repro on 2025/01/31 20:47
Subsystems: fs
[Documentation on labels]
Reported-by: syzbot+c041985778e4069e1ce3@syzkaller.appspotmail.com
First crash: 11d, last: 1d15h
Discussions (2)
Title Replies (including bot) Last reply
[PATCH] tracing: keep the event lock balanced 1 (1) 2025/02/01 05:50
[syzbot] [fs?] WARNING: bad unlock balance in seq_read_iter 4 (8) 2025/02/01 05:50
Last patch testing requests (5)
Created Duration User Patch Repo Result
2025/02/01 05:30 19m eadavis@qq.com patch upstream OK log
2025/02/01 03:44 19m eadavis@qq.com https://github.com/ea1davis/linux ftr/syz OK log
2025/02/01 02:27 19m eadavis@qq.com https://github.com/ea1davis/linux ftr/syz OK log
2025/02/01 01:42 19m eadavis@qq.com https://github.com/ea1davis/linux ftr/syz OK log
2025/02/01 01:04 19m eadavis@qq.com https://github.com/ea1davis/linux ftr/syz OK log

Sample crash report:
Code: 48 83 c4 28 c3 e8 17 1a 00 00 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 73 01 c3 48 c7 c1 b8 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007ffe566caee8 EFLAGS: 00000246 ORIG_RAX: 0000000000000000
RAX: ffffffffffffffda RBX: 00007ffe566caef0 RCX: 00007f1f6401a2e9
RDX: 0000000000006c64 RSI: 0000000000000000 RDI: 0000000000000003
RBP: 0000000000000001 R08: 00007ffe566cac87 R09: 00007f1f64080032
R10: 0000000000000001 R11: 0000000000000246 R12: 00007f1f64085618
R13: 00007ffe566cb0c8 R14: 0000000000000001 R15: 0000000000000001
 </TASK>
=====================================
WARNING: bad unlock balance detected!
6.13.0-syzkaller-09760-g69e858e0b8b2 #0 Not tainted
-------------------------------------
syz-executor359/5828 is trying to release lock (event_mutex) at:
[<ffffffff8239231f>] seq_read_iter+0x5ff/0x12b0 fs/seq_file.c:251
but there are no more locks to release!

other info that might help us debug this:
1 lock held by syz-executor359/5828:
 #0: ffff88802fd120a0 (&p->lock){+.+.}-{4:4}, at: seq_read_iter+0xd8/0x12b0 fs/seq_file.c:182

stack backtrace:
CPU: 0 UID: 0 PID: 5828 Comm: syz-executor359 Not tainted 6.13.0-syzkaller-09760-g69e858e0b8b2 #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 12/27/2024
Call Trace:
 <TASK>
 __dump_stack lib/dump_stack.c:94 [inline]
 dump_stack_lvl+0x116/0x1f0 lib/dump_stack.c:120
 print_unlock_imbalance_bug kernel/locking/lockdep.c:5289 [inline]
 print_unlock_imbalance_bug+0x1aa/0x1f0 kernel/locking/lockdep.c:5263
 __lock_release kernel/locking/lockdep.c:5528 [inline]
 lock_release+0x525/0x6f0 kernel/locking/lockdep.c:5872
 __mutex_unlock_slowpath+0xa3/0x6a0 kernel/locking/mutex.c:891
 seq_read_iter+0x5ff/0x12b0 fs/seq_file.c:251
 seq_read+0x39f/0x4e0 fs/seq_file.c:162
 vfs_read+0x1df/0xbf0 fs/read_write.c:563
 ksys_read+0x12b/0x250 fs/read_write.c:708
 do_syscall_x64 arch/x86/entry/common.c:52 [inline]
 do_syscall_64+0xcd/0x250 arch/x86/entry/common.c:83
 entry_SYSCALL_64_after_hwframe+0x77/0x7f
RIP: 0033:0x7f1f6401a2e9
Code: 48 83 c4 28 c3 e8 17 1a 00 00 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 73 01 c3 48 c7 c1 b8 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007ffe566caee8 EFLAGS: 00000246 ORIG_RAX: 0000000000000000
RAX: ffffffffffffffda RBX: 00007ffe566caef0 RCX: 00007f1f6401a2e9
RDX: 0000000000006c64 RSI: 0000000000000000 RDI: 0000000000000003
RBP: 0000000000000001 R08: 00007ffe566cac87 R09: 00007f1f64080032
R10: 0000000000000001 R11: 0000000000000246 R12: 00007f1f64085618
R13: 00007ffe566
----------------
Code disassembly (best guess):
   0:	48 83 c4 28          	add    $0x28,%rsp
   4:	c3                   	ret
   5:	e8 17 1a 00 00       	call   0x1a21
   a:	0f 1f 80 00 00 00 00 	nopl   0x0(%rax)
  11:	48 89 f8             	mov    %rdi,%rax
  14:	48 89 f7             	mov    %rsi,%rdi
  17:	48 89 d6             	mov    %rdx,%rsi
  1a:	48 89 ca             	mov    %rcx,%rdx
  1d:	4d 89 c2             	mov    %r8,%r10
  20:	4d 89 c8             	mov    %r9,%r8
  23:	4c 8b 4c 24 08       	mov    0x8(%rsp),%r9
  28:	0f 05                	syscall
* 2a:	48 3d 01 f0 ff ff    	cmp    $0xfffffffffffff001,%rax <-- trapping instruction
  30:	73 01                	jae    0x33
  32:	c3                   	ret
  33:	48 c7 c1 b8 ff ff ff 	mov    $0xffffffffffffffb8,%rcx
  3a:	f7 d8                	neg    %eax
  3c:	64 89 01             	mov    %eax,%fs:(%rcx)
  3f:	48                   	rex.W

Crashes (7):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2025/01/31 20:46 upstream 69e858e0b8b2 aa47157c .config console log report syz / log C [disk image] [vmlinux] [kernel image] ci-qemu-gce-upstream-auto WARNING: bad unlock balance in seq_read_iter
2025/02/03 15:00 upstream 2014c95afece a21a8419 .config console log report info [disk image] [vmlinux] [kernel image] ci-qemu-gce-upstream-auto WARNING: bad unlock balance in seq_read_iter
2025/02/03 14:53 upstream 2014c95afece a21a8419 .config console log report info [disk image] [vmlinux] [kernel image] ci-qemu-gce-upstream-auto WARNING: bad unlock balance in seq_read_iter
2025/02/02 04:53 upstream 69e858e0b8b2 568559e4 .config console log report info [disk image] [vmlinux] [kernel image] ci-qemu-gce-upstream-auto WARNING: bad unlock balance in seq_read_iter
2025/01/31 20:21 upstream 69e858e0b8b2 aa47157c .config console log report info [disk image] [vmlinux] [kernel image] ci-qemu-gce-upstream-auto WARNING: bad unlock balance in seq_read_iter
2025/01/27 02:03 upstream c2da8b3f914f 9fbd772e .config console log report info [disk image] [vmlinux] [kernel image] ci-qemu-gce-upstream-auto WARNING: bad unlock balance in seq_read_iter
2025/01/24 22:25 upstream 68732c0bf97c 1293872d .config console log report info [disk image] [vmlinux] [kernel image] ci-qemu-gce-upstream-auto WARNING: bad unlock balance in seq_read_iter
* Struck through repros no longer work on HEAD.