syzbot


possible deadlock in __sock_release

Status: auto-obsoleted due to no activity on 2023/04/15 01:06
Subsystems: tipc
[Documentation on labels]
Reported-by: syzbot+8e467b009209f1fcf666@syzkaller.appspotmail.com
First crash: 1299d, last: 987d
Cause bisection: introduced by (bisect log) [merge commit]:
commit edea44f5872a14d0e8698e0e0e540320833db9cb
Author: Jiri Kosina <jkosina@suse.cz>
Date: Wed Feb 12 13:20:41 2020 +0000

  Merge branch 'for-5.7/core' into for-next

Crash: WARNING: ODEBUG bug in __do_softirq (log)
Repro: C syz .config
  
Fix bisection: fixed by (bisect log) :
commit 8fb4792f091e608a0a1d353dfdf07ef55a719db5
Author: Paolo Abeni <pabeni@redhat.com>
Date: Tue Jul 20 13:08:40 2021 +0000

  ipv6: fix another slab-out-of-bounds in fib6_nh_flush_exceptions

  
Discussions (1)
Title Replies (including bot) Last reply
possible deadlock in __sock_release 0 (2) 2021/08/05 10:13
Similar bugs (1)
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
linux-4.19 possible deadlock in __sock_release C done 57446 962d 1224d 1/1 fixed on 2021/08/30 09:32
Last patch testing requests (10)
Created Duration User Patch Repo Result
2023/04/15 00:40 19m retest repro linux-next OK log
2023/04/14 22:40 19m (2) retest repro linux-next OK log
2023/04/14 21:40 21m retest repro linux-next OK log
2023/04/14 20:40 18m retest repro linux-next OK log
2023/04/14 19:40 26m retest repro linux-next OK log
2023/04/14 17:40 27m retest repro linux-next OK log
2023/04/14 16:40 27m retest repro linux-next OK log
2023/04/14 15:40 28m retest repro linux-next OK log
2023/04/14 14:40 28m retest repro linux-next OK log
2023/04/14 13:40 18m retest repro linux-next OK log

Sample crash report:
======================================================
WARNING: possible circular locking dependency detected
5.13.0-syzkaller #0 Not tainted
------------------------------------------------------
syz-executor501/8626 is trying to acquire lock:
ffff888039ffec10 (
&sb->s_type->i_mutex_key#13
){+.+.}-{3:3}
, at: inode_lock include/linux/fs.h:774 [inline]
, at: __sock_release+0x86/0x280 net/socket.c:647

but task is already holding lock:
ffff888028d5b520
 (sk_lock-AF_TIPC
){+.+.}-{0:0}
, at: lock_sock include/net/sock.h:1613 [inline]
, at: sock_setsockopt+0x1e3/0x2490 net/core/sock.c:980

which lock already depends on the new lock.


the existing dependency chain (in reverse order) is:

-> #1 (
sk_lock-AF_TIPC){+.+.}-{0:0}
:
       lock_sock_nested+0xca/0x120 net/core/sock.c:3168
       lock_sock include/net/sock.h:1613 [inline]
       tipc_release+0xc2/0x1a00 net/tipc/socket.c:637
       __sock_release+0xcd/0x280 net/socket.c:648
       sock_close+0x18/0x20 net/socket.c:1300
       __fput+0x288/0x920 fs/file_table.c:280
       task_work_run+0xdd/0x1a0 kernel/task_work.c:164
       tracehook_notify_resume include/linux/tracehook.h:189 [inline]
       exit_to_user_mode_loop kernel/entry/common.c:175 [inline]
       exit_to_user_mode_prepare+0x27e/0x290 kernel/entry/common.c:209
       __syscall_exit_to_user_mode_work kernel/entry/common.c:291 [inline]
       syscall_exit_to_user_mode+0x19/0x60 kernel/entry/common.c:302
       do_syscall_64+0x42/0xb0 arch/x86/entry/common.c:86
       entry_SYSCALL_64_after_hwframe+0x44/0xae

-> #0 (
&sb->s_type->i_mutex_key#13
){+.+.}-{3:3}
:
       check_prev_add kernel/locking/lockdep.c:3051 [inline]
       check_prevs_add kernel/locking/lockdep.c:3174 [inline]
       validate_chain kernel/locking/lockdep.c:3789 [inline]
       __lock_acquire+0x2a07/0x54a0 kernel/locking/lockdep.c:5015
       lock_acquire kernel/locking/lockdep.c:5625 [inline]
       lock_acquire+0x1ab/0x510 kernel/locking/lockdep.c:5590
       down_write+0x92/0x150 kernel/locking/rwsem.c:1406
       inode_lock include/linux/fs.h:774 [inline]
       __sock_release+0x86/0x280 net/socket.c:647
       sock_close+0x18/0x20 net/socket.c:1300
       __fput+0x288/0x920 fs/file_table.c:280
       task_work_run+0xdd/0x1a0 kernel/task_work.c:164
       get_signal+0x1bb0/0x2150 kernel/signal.c:2569
       arch_do_signal_or_restart+0x2a9/0x1eb0 arch/x86/kernel/signal.c:789
       handle_signal_work kernel/entry/common.c:148 [inline]
       exit_to_user_mode_loop kernel/entry/common.c:172 [inline]
       exit_to_user_mode_prepare+0x17d/0x290 kernel/entry/common.c:209
       __syscall_exit_to_user_mode_work kernel/entry/common.c:291 [inline]
       syscall_exit_to_user_mode+0x19/0x60 kernel/entry/common.c:302
       do_syscall_64+0x42/0xb0 arch/x86/entry/common.c:86
       entry_SYSCALL_64_after_hwframe+0x44/0xae

other info that might help us debug this:

 Possible unsafe locking scenario:

       CPU0                    CPU1
       ----                    ----
  lock(sk_lock-AF_TIPC
);
                               lock(
&sb->s_type->i_mutex_key#13
);
                               lock(
sk_lock-AF_TIPC);
  lock(&sb->s_type->i_mutex_key
#13);

 *** DEADLOCK ***

1 lock held by syz-executor501/8626:
 #0: ffff888028d5b520
 (sk_lock-AF_TIPC
){+.+.}-{0:0}
, at: lock_sock include/net/sock.h:1613 [inline]
, at: sock_setsockopt+0x1e3/0x2490 net/core/sock.c:980

stack backtrace:
CPU: 1 PID: 8626 Comm: syz-executor501 Not tainted 5.13.0-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
Call Trace:
 __dump_stack lib/dump_stack.c:79 [inline]
 dump_stack_lvl+0xcd/0x134 lib/dump_stack.c:96
 check_noncircular+0x25f/0x2e0 kernel/locking/lockdep.c:2131
 check_prev_add kernel/locking/lockdep.c:3051 [inline]
 check_prevs_add kernel/locking/lockdep.c:3174 [inline]
 validate_chain kernel/locking/lockdep.c:3789 [inline]
 __lock_acquire+0x2a07/0x54a0 kernel/locking/lockdep.c:5015
 lock_acquire kernel/locking/lockdep.c:5625 [inline]
 lock_acquire+0x1ab/0x510 kernel/locking/lockdep.c:5590
 down_write+0x92/0x150 kernel/locking/rwsem.c:1406
 inode_lock include/linux/fs.h:774 [inline]
 __sock_release+0x86/0x280 net/socket.c:647
 sock_close+0x18/0x20 net/socket.c:1300
 __fput+0x288/0x920 fs/file_table.c:280
 task_work_run+0xdd/0x1a0 kernel/task_work.c:164
 get_signal+0x1bb0/0x2150 kernel/signal.c:2569
 arch_do_signal_or_restart+0x2a9/0x1eb0 arch/x86/kernel/signal.c:789
 handle_signal_work kernel/entry/common.c:148 [inline]
 exit_to_user_mode_loop kernel/entry/common.c:172 [inline]
 exit_to_user_mode_prepare+0x17d/0x290 kernel/entry/common.c:209
 __syscall_exit_to_user_mode_work kernel/entry/common.c:291 [inline]
 syscall_exit_to_user_mode+0x19/0x60 kernel/entry/common.c:302
 do_syscall_64+0x42/0xb0 arch/x86/entry/common.c:86
 entry_SYSCALL_64_after_hwframe+0x44/0xae
RIP: 0033:0x44ed49
Code: 28 00 00 00 75 05 48 83 c4 28 c3 e8 c1 18 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 bc ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007f943c11b208 EFLAGS: 00000246 ORIG_RAX: 0000000000000036
RAX: fffffffffffffff2 RBX: 00000000004cd4a8 RCX: 000000000044ed49
RDX: 0000000000000025 RSI: 0000000000000001 RDI: 0000000000000005
RBP: 00000000004cd4a0 R08: 0000000000000008 R09: 0000000000000000
R10: 00000000200001c0 R11: 0000000000000246 R12: 00000000004cd4ac
R13: 00007ffc4809da7f R14: 00007f943c11b300 R15: 0000000000022000

Crashes (2728):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2021/07/06 03:55 net-old c6c205ed442e 55aa55c2 .config console log report syz C ci-upstream-net-this-kasan-gce possible deadlock in __sock_release
2020/09/07 21:40 linux-next 7a6956579ce6 abf9ba4f .config console log report syz C ci-upstream-linux-next-kasan-gce-root
2020/09/06 15:00 linux-next 7a6956579ce6 abf9ba4f .config console log report syz C ci-upstream-linux-next-kasan-gce-root
2020/08/31 09:48 linux-next b36c969764ab d5a3ae1f .config console log report syz C ci-upstream-linux-next-kasan-gce-root
2020/08/30 14:20 linux-next b36c969764ab d5a3ae1f .config console log report syz C ci-upstream-linux-next-kasan-gce-root
2020/08/30 13:00 linux-next b36c969764ab d5a3ae1f .config console log report syz C ci-upstream-linux-next-kasan-gce-root
2020/08/30 12:39 linux-next b36c969764ab d5a3ae1f .config console log report syz C ci-upstream-linux-next-kasan-gce-root
2020/08/30 12:00 linux-next b36c969764ab d5a3ae1f .config console log report syz C ci-upstream-linux-next-kasan-gce-root
2020/08/29 01:53 linux-next b36c969764ab d5a3ae1f .config console log report syz C ci-upstream-linux-next-kasan-gce-root
2020/08/28 23:59 linux-next b36c969764ab d5a3ae1f .config console log report syz C ci-upstream-linux-next-kasan-gce-root
2020/08/28 22:52 linux-next b36c969764ab d5a3ae1f .config console log report syz C ci-upstream-linux-next-kasan-gce-root
2020/08/28 21:23 linux-next b36c969764ab d5a3ae1f .config console log report syz C ci-upstream-linux-next-kasan-gce-root
2020/08/28 13:16 linux-next b36c969764ab 816e0689 .config console log report syz C ci-upstream-linux-next-kasan-gce-root
2020/08/29 11:28 linux-next b36c969764ab d5a3ae1f .config console log report syz ci-upstream-linux-next-kasan-gce-root
2020/09/22 14:55 bpf-next a8a717963fe5 3e8f6c27 .config console log report info ci-upstream-bpf-next-kasan-gce
2020/09/07 16:06 net-next-old 02a20d4fef3d abf9ba4f .config console log report ci-upstream-net-kasan-gce
2020/08/27 20:48 net-next-old 50aba46c234e 816e0689 .config console log report ci-upstream-net-kasan-gce
2020/09/08 17:27 linux-next 7a6956579ce6 abf9ba4f .config console log report ci-upstream-linux-next-kasan-gce-root
2020/09/08 17:15 linux-next 7a6956579ce6 abf9ba4f .config console log report ci-upstream-linux-next-kasan-gce-root
2020/09/08 16:09 linux-next 7a6956579ce6 abf9ba4f .config console log report ci-upstream-linux-next-kasan-gce-root
2020/09/08 15:17 linux-next 7a6956579ce6 abf9ba4f .config console log report ci-upstream-linux-next-kasan-gce-root
2020/09/08 14:37 linux-next 7a6956579ce6 abf9ba4f .config console log report ci-upstream-linux-next-kasan-gce-root
2020/09/08 12:39 linux-next 7a6956579ce6 abf9ba4f .config console log report ci-upstream-linux-next-kasan-gce-root
2020/09/08 12:05 linux-next 7a6956579ce6 abf9ba4f .config console log report ci-upstream-linux-next-kasan-gce-root
2020/09/08 11:23 linux-next 7a6956579ce6 abf9ba4f .config console log report ci-upstream-linux-next-kasan-gce-root
2020/09/08 11:17 linux-next 7a6956579ce6 abf9ba4f .config console log report ci-upstream-linux-next-kasan-gce-root
2020/09/08 10:16 linux-next 7a6956579ce6 abf9ba4f .config console log report ci-upstream-linux-next-kasan-gce-root
2020/09/08 09:45 linux-next 7a6956579ce6 abf9ba4f .config console log report ci-upstream-linux-next-kasan-gce-root
2020/09/08 09:18 linux-next 7a6956579ce6 abf9ba4f .config console log report ci-upstream-linux-next-kasan-gce-root
2020/09/08 08:47 linux-next 7a6956579ce6 abf9ba4f .config console log report ci-upstream-linux-next-kasan-gce-root
2020/09/08 08:07 linux-next 7a6956579ce6 abf9ba4f .config console log report ci-upstream-linux-next-kasan-gce-root
2020/09/08 07:35 linux-next 7a6956579ce6 abf9ba4f .config console log report ci-upstream-linux-next-kasan-gce-root
2020/09/08 07:01 linux-next 7a6956579ce6 abf9ba4f .config console log report ci-upstream-linux-next-kasan-gce-root
2020/09/08 05:28 linux-next 7a6956579ce6 abf9ba4f .config console log report ci-upstream-linux-next-kasan-gce-root
2020/09/08 05:06 linux-next 7a6956579ce6 abf9ba4f .config console log report ci-upstream-linux-next-kasan-gce-root
2020/09/08 03:46 linux-next 7a6956579ce6 abf9ba4f .config console log report ci-upstream-linux-next-kasan-gce-root
2020/09/08 03:46 linux-next 7a6956579ce6 abf9ba4f .config console log report ci-upstream-linux-next-kasan-gce-root
2020/09/08 02:42 linux-next 7a6956579ce6 abf9ba4f .config console log report ci-upstream-linux-next-kasan-gce-root
2020/09/08 01:52 linux-next 7a6956579ce6 abf9ba4f .config console log report ci-upstream-linux-next-kasan-gce-root
2020/09/08 00:23 linux-next 7a6956579ce6 abf9ba4f .config console log report ci-upstream-linux-next-kasan-gce-root
2020/09/07 23:42 linux-next 7a6956579ce6 abf9ba4f .config console log report ci-upstream-linux-next-kasan-gce-root
2020/09/07 23:09 linux-next 7a6956579ce6 abf9ba4f .config console log report ci-upstream-linux-next-kasan-gce-root
2020/09/07 22:41 linux-next 7a6956579ce6 abf9ba4f .config console log report ci-upstream-linux-next-kasan-gce-root
2020/09/07 22:41 linux-next 7a6956579ce6 abf9ba4f .config console log report ci-upstream-linux-next-kasan-gce-root
2020/09/07 21:09 linux-next 7a6956579ce6 abf9ba4f .config console log report ci-upstream-linux-next-kasan-gce-root
2020/09/07 20:08 linux-next 7a6956579ce6 abf9ba4f .config console log report ci-upstream-linux-next-kasan-gce-root
2020/09/07 19:24 linux-next 7a6956579ce6 abf9ba4f .config console log report ci-upstream-linux-next-kasan-gce-root
2020/09/07 19:17 linux-next 7a6956579ce6 abf9ba4f .config console log report ci-upstream-linux-next-kasan-gce-root
2020/09/07 18:13 linux-next 7a6956579ce6 abf9ba4f .config console log report ci-upstream-linux-next-kasan-gce-root
2020/09/07 18:05 linux-next 7a6956579ce6 abf9ba4f .config console log report ci-upstream-linux-next-kasan-gce-root
2020/09/07 17:02 linux-next 7a6956579ce6 abf9ba4f .config console log report ci-upstream-linux-next-kasan-gce-root
2020/09/07 14:00 linux-next 7a6956579ce6 abf9ba4f .config console log report ci-upstream-linux-next-kasan-gce-root
2020/09/07 12:37 linux-next 7a6956579ce6 abf9ba4f .config console log report ci-upstream-linux-next-kasan-gce-root
2020/09/07 11:04 linux-next 7a6956579ce6 abf9ba4f .config console log report ci-upstream-linux-next-kasan-gce-root
2020/09/07 10:04 linux-next 7a6956579ce6 abf9ba4f .config console log report ci-upstream-linux-next-kasan-gce-root
2020/09/07 09:30 linux-next 7a6956579ce6 abf9ba4f .config console log report ci-upstream-linux-next-kasan-gce-root
2020/09/07 08:40 linux-next 7a6956579ce6 abf9ba4f .config console log report ci-upstream-linux-next-kasan-gce-root
2020/09/07 07:16 linux-next 7a6956579ce6 abf9ba4f .config console log report ci-upstream-linux-next-kasan-gce-root
* Struck through repros no longer work on HEAD.