syzbot


WARNING: bad unlock balance in sockopt_release_sock

Status: fixed on 2023/10/12 12:48
Subsystems: net
[Documentation on labels]
Fix commit: 8be6f88b9d3f inet: fix IP_TRANSPARENT error handling
First crash: 468d, last: 468d
Cause bisection: introduced by (bisect log) :
commit 4bd0623f04eef65c0a324000fad73c4d3a677f8e
Author: Eric Dumazet <edumazet@google.com>
Date: Wed Aug 16 08:15:41 2023 +0000

  inet: move inet->transparent to inet->inet_flags

Crash: WARNING: bad unlock balance in do_ip_setsockopt (log)
Repro: C syz .config
  

Sample crash report:
=====================================
WARNING: bad unlock balance detected!
6.5.0-rc7-syzkaller-01717-g59da9885767a #0 Not tainted
-------------------------------------
syz-executor151/5028 is trying to release lock (sk_lock-AF_INET) at:
[<ffffffff88213983>] sockopt_release_sock+0x53/0x70 net/core/sock.c:1073
but there are no more locks to release!

other info that might help us debug this:
1 lock held by syz-executor151/5028:
 #0: ffff888078c780b0 (slock-AF_INET){+.-.}-{2:2}, at: spin_lock_bh include/linux/spinlock.h:356 [inline]
 #0: ffff888078c780b0 (slock-AF_INET){+.-.}-{2:2}, at: release_sock+0x1f/0x1b0 net/core/sock.c:3517

stack backtrace:
CPU: 0 PID: 5028 Comm: syz-executor151 Not tainted 6.5.0-rc7-syzkaller-01717-g59da9885767a #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 07/26/2023
Call Trace:
 <TASK>
 __dump_stack lib/dump_stack.c:88 [inline]
 dump_stack_lvl+0xd9/0x1b0 lib/dump_stack.c:106
 __lock_release kernel/locking/lockdep.c:5438 [inline]
 lock_release+0x4b5/0x680 kernel/locking/lockdep.c:5781
 sock_release_ownership include/net/sock.h:1824 [inline]
 release_sock+0x175/0x1b0 net/core/sock.c:3527
 sockopt_release_sock+0x53/0x70 net/core/sock.c:1073
 do_ip_setsockopt+0x12c1/0x3640 net/ipv4/ip_sockglue.c:1364
 ip_setsockopt+0x59/0xe0 net/ipv4/ip_sockglue.c:1419
 raw_setsockopt+0x218/0x290 net/ipv4/raw.c:833
 __sys_setsockopt+0x2cd/0x5b0 net/socket.c:2305
 __do_sys_setsockopt net/socket.c:2316 [inline]
 __se_sys_setsockopt net/socket.c:2313 [inline]
 __x64_sys_setsockopt+0xbd/0x150 net/socket.c:2313
 do_syscall_x64 arch/x86/entry/common.c:50 [inline]
 do_syscall_64+0x38/0xb0 arch/x86/entry/common.c:80
 entry_SYSCALL_64_after_hwframe+0x63/0xcd
RIP: 0033:0x7f0b4801fcf9
Code: 28 00 00 00 75 05 48 83 c4 28 c3 e8 c1 17 00 00 90 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 b0 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007f0b47fc1238 EFLAGS: 00000246 ORIG_RAX: 0000000000000036


Crashes (2):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2023/08/25 02:25 net-next 59da9885767a 49be837e .config strace log report syz C ci-upstream-net-kasan-gce WARNING: bad unlock balance in sockopt_release_sock
2023/08/25 02:10 net-next 59da9885767a 49be837e .config console log report info ci-upstream-net-kasan-gce WARNING: bad unlock balance in sockopt_release_sock
* Struck through repros no longer work on HEAD.