Hello,
syzbot found the following issue on:
HEAD commit: d7543167affd Linux 6.1.82
git tree: linux-6.1.y
console output:
https://syzkaller.appspot.com/x/log.txt?x=17d19546180000
kernel config:
https://syzkaller.appspot.com/x/.config?x=59059e181681c079
dashboard link:
https://syzkaller.appspot.com/bug?extid=e4bf1416ef54504e4c07
compiler: Debian clang version 15.0.6, GNU ld (GNU Binutils for Debian) 2.40
Unfortunately, I don't have any reproducer for this issue yet.
Downloadable assets:
disk image:
https://storage.googleapis.com/syzbot-assets/a2421980b49a/disk-d7543167.raw.xz
vmlinux:
https://storage.googleapis.com/syzbot-assets/52a6bb44161f/vmlinux-d7543167.xz
kernel image:
https://storage.googleapis.com/syzbot-assets/9b3723bf43a9/bzImage-d7543167.xz
IMPORTANT: if you fix the issue, please add the following tag to the commit:
Reported-by:
syzbot+e4bf14...@syzkaller.appspotmail.com
======================================================
WARNING: possible circular locking dependency detected
6.1.82-syzkaller #0 Not tainted
------------------------------------------------------
syz-fuzzer/11553 is trying to acquire lock:
ffff888074075a18
(&htab->buckets[i].lock
){+...}-{2:2}
, at: sock_hash_delete_elem+0xac/0x2f0 net/core/sock_map.c:932
but task is already holding lock:
ffff8880b982a4d8
(hrtimer_bases.lock
){-.-.}-{2:2}
, at: lock_hrtimer_base kernel/time/hrtimer.c:173 [inline]
, at: hrtimer_start_range_ns+0xd8/0xc50 kernel/time/hrtimer.c:1297
which lock already depends on the new lock.
the existing dependency chain (in reverse order) is:
-> #2 (
hrtimer_bases.lock){-.-.}-{2:2}
:
lock_acquire+0x1f8/0x5a0 kernel/locking/lockdep.c:5662
__raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:110 [inline]
_raw_spin_lock_irqsave+0xd1/0x120 kernel/locking/spinlock.c:162
lock_hrtimer_base kernel/time/hrtimer.c:173 [inline]
hrtimer_start_range_ns+0xd8/0xc50 kernel/time/hrtimer.c:1297
hrtimer_start include/linux/hrtimer.h:420 [inline]
run_page_cache_worker kernel/rcu/tree.c:3292 [inline]
kvfree_call_rcu+0x72b/0x8c0 kernel/rcu/tree.c:3403
rtnl_register_internal+0x489/0x580 net/core/rtnetlink.c:260
rtnl_register+0x32/0x70 net/core/rtnetlink.c:310
ip_rt_init+0x335/0x3c7 net/ipv4/route.c:3768
ip_init+0xa/0x14 net/ipv4/ip_output.c:1767
inet_init+0x2ae/0x3c0 net/ipv4/af_inet.c:2031
do_one_initcall+0x265/0x8f0 init/main.c:1296
do_initcall_level+0x157/0x207 init/main.c:1369
do_initcalls+0x49/0x86 init/main.c:1385
kernel_init_freeable+0x45c/0x60f init/main.c:1624
kernel_init+0x19/0x290 init/main.c:1512
ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:307
-> #1 (
krc.lock){..-.}-{2:2}
:
lock_acquire+0x1f8/0x5a0 kernel/locking/lockdep.c:5662
__raw_spin_lock include/linux/spinlock_api_smp.h:133 [inline]
_raw_spin_lock+0x2a/0x40 kernel/locking/spinlock.c:154
krc_this_cpu_lock kernel/rcu/tree.c:2990 [inline]
add_ptr_to_bulk_krc_lock kernel/rcu/tree.c:3310 [inline]
kvfree_call_rcu+0x1b2/0x8c0 kernel/rcu/tree.c:3401
sock_hash_free_elem net/core/sock_map.c:893 [inline]
sock_hash_delete_from_link net/core/sock_map.c:916 [inline]
sock_map_unlink net/core/sock_map.c:1550 [inline]
sock_map_remove_links+0x46f/0x550 net/core/sock_map.c:1562
sock_map_close+0x118/0x2d0 net/core/sock_map.c:1627
unix_release+0x7e/0xc0 net/unix/af_unix.c:1038
__sock_release net/socket.c:654 [inline]
sock_close+0xcd/0x230 net/socket.c:1400
__fput+0x3b7/0x890 fs/file_table.c:320
task_work_run+0x246/0x300 kernel/task_work.c:179
resume_user_mode_work include/linux/resume_user_mode.h:49 [inline]
exit_to_user_mode_loop+0xde/0x100 kernel/entry/common.c:171
exit_to_user_mode_prepare+0xb1/0x140 kernel/entry/common.c:204
__syscall_exit_to_user_mode_work kernel/entry/common.c:286 [inline]
syscall_exit_to_user_mode+0x60/0x270 kernel/entry/common.c:297
do_syscall_64+0x49/0xb0 arch/x86/entry/common.c:87
entry_SYSCALL_64_after_hwframe+0x63/0xcd
-> #0 (
&htab->buckets[i].lock
){+...}-{2:2}
:
check_prev_add kernel/locking/lockdep.c:3090 [inline]
check_prevs_add kernel/locking/lockdep.c:3209 [inline]
validate_chain+0x1661/0x5950 kernel/locking/lockdep.c:3825
__lock_acquire+0x125b/0x1f80 kernel/locking/lockdep.c:5049
lock_acquire+0x1f8/0x5a0 kernel/locking/lockdep.c:5662
__raw_spin_lock_bh include/linux/spinlock_api_smp.h:126 [inline]
_raw_spin_lock_bh+0x31/0x40 kernel/locking/spinlock.c:178
sock_hash_delete_elem+0xac/0x2f0 net/core/sock_map.c:932
bpf_prog_2c29ac5cdc6b1842+0x3a/0x3e
bpf_dispatcher_nop_func include/linux/bpf.h:989 [inline]
__bpf_prog_run include/linux/filter.h:600 [inline]
bpf_prog_run include/linux/filter.h:607 [inline]
__bpf_trace_run kernel/trace/bpf_trace.c:2273 [inline]
bpf_trace_run2+0x1fd/0x410 kernel/trace/bpf_trace.c:2312
trace_hrtimer_start include/trace/events/timer.h:202 [inline]
debug_activate kernel/time/hrtimer.c:476 [inline]
enqueue_hrtimer+0x382/0x410 kernel/time/hrtimer.c:1084
__hrtimer_start_range_ns kernel/time/hrtimer.c:1259 [inline]
hrtimer_start_range_ns+0xa9c/0xc50 kernel/time/hrtimer.c:1299
hrtimer_start_expires include/linux/hrtimer.h:434 [inline]
hrtimer_sleeper_start_expires kernel/time/hrtimer.c:1966 [inline]
schedule_hrtimeout_range_clock+0x272/0x480 kernel/time/hrtimer.c:2305
ep_poll fs/eventpoll.c:1884 [inline]
do_epoll_wait+0x1be9/0x1e60 fs/eventpoll.c:2262
do_epoll_pwait+0x56/0x1d0 fs/eventpoll.c:2296
__do_sys_epoll_pwait fs/eventpoll.c:2309 [inline]
__se_sys_epoll_pwait fs/eventpoll.c:2303 [inline]
__x64_sys_epoll_pwait+0x2b4/0x300 fs/eventpoll.c:2303
do_syscall_x64 arch/x86/entry/common.c:51 [inline]
do_syscall_64+0x3d/0xb0 arch/x86/entry/common.c:81
entry_SYSCALL_64_after_hwframe+0x63/0xcd
other info that might help us debug this:
Chain exists of:
&htab->buckets[i].lock
--> krc.lock
--> hrtimer_bases.lock
Possible unsafe locking scenario:
CPU0 CPU1
---- ----
lock(hrtimer_bases.lock
);
lock(
krc.lock);
lock(hrtimer_bases.lock
);
lock(
&htab->buckets[i].lock);
*** DEADLOCK ***
2 locks held by syz-fuzzer/11553:
#0: ffff8880b982a4d8
(hrtimer_bases.lock
){-.-.}-{2:2}
, at: lock_hrtimer_base kernel/time/hrtimer.c:173 [inline]
, at: hrtimer_start_range_ns+0xd8/0xc50 kernel/time/hrtimer.c:1297
#1: ffffffff8d12a940
(rcu_read_lock
){....}-{1:2}
, at: rcu_lock_acquire include/linux/rcupdate.h:319 [inline]
, at: rcu_read_lock include/linux/rcupdate.h:760 [inline]
, at: __bpf_trace_run kernel/trace/bpf_trace.c:2272 [inline]
, at: bpf_trace_run2+0x110/0x410 kernel/trace/bpf_trace.c:2312
stack backtrace:
CPU: 0 PID: 11553 Comm: syz-fuzzer Not tainted 6.1.82-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 02/29/2024
Call Trace:
<TASK>
__dump_stack lib/dump_stack.c:88 [inline]
dump_stack_lvl+0x1e3/0x2cb lib/dump_stack.c:106
check_noncircular+0x2fa/0x3b0 kernel/locking/lockdep.c:2170
check_prev_add kernel/locking/lockdep.c:3090 [inline]
check_prevs_add kernel/locking/lockdep.c:3209 [inline]
validate_chain+0x1661/0x5950 kernel/locking/lockdep.c:3825
__lock_acquire+0x125b/0x1f80 kernel/locking/lockdep.c:5049
lock_acquire+0x1f8/0x5a0 kernel/locking/lockdep.c:5662
__raw_spin_lock_bh include/linux/spinlock_api_smp.h:126 [inline]
_raw_spin_lock_bh+0x31/0x40 kernel/locking/spinlock.c:178
sock_hash_delete_elem+0xac/0x2f0 net/core/sock_map.c:932
bpf_prog_2c29ac5cdc6b1842+0x3a/0x3e
bpf_dispatcher_nop_func include/linux/bpf.h:989 [inline]
__bpf_prog_run include/linux/filter.h:600 [inline]
bpf_prog_run include/linux/filter.h:607 [inline]
__bpf_trace_run kernel/trace/bpf_trace.c:2273 [inline]
bpf_trace_run2+0x1fd/0x410 kernel/trace/bpf_trace.c:2312
trace_hrtimer_start include/trace/events/timer.h:202 [inline]
debug_activate kernel/time/hrtimer.c:476 [inline]
enqueue_hrtimer+0x382/0x410 kernel/time/hrtimer.c:1084
__hrtimer_start_range_ns kernel/time/hrtimer.c:1259 [inline]
hrtimer_start_range_ns+0xa9c/0xc50 kernel/time/hrtimer.c:1299
hrtimer_start_expires include/linux/hrtimer.h:434 [inline]
hrtimer_sleeper_start_expires kernel/time/hrtimer.c:1966 [inline]
schedule_hrtimeout_range_clock+0x272/0x480 kernel/time/hrtimer.c:2305
ep_poll fs/eventpoll.c:1884 [inline]
do_epoll_wait+0x1be9/0x1e60 fs/eventpoll.c:2262
do_epoll_pwait+0x56/0x1d0 fs/eventpoll.c:2296
__do_sys_epoll_pwait fs/eventpoll.c:2309 [inline]
__se_sys_epoll_pwait fs/eventpoll.c:2303 [inline]
__x64_sys_epoll_pwait+0x2b4/0x300 fs/eventpoll.c:2303
do_syscall_x64 arch/x86/entry/common.c:51 [inline]
do_syscall_64+0x3d/0xb0 arch/x86/entry/common.c:81
entry_SYSCALL_64_after_hwframe+0x63/0xcd
RIP: 0033:0x40720e
Code: 48 83 ec 38 e8 13 00 00 00 48 83 c4 38 5d c3 cc cc cc cc cc cc cc cc cc cc cc cc cc 49 89 f2 48 89 fa 48 89 ce 48 89 df 0f 05 <48> 3d 01 f0 ff ff 76 15 48 f7 d8 48 89 c1 48 c7 c0 ff ff ff ff 48
RSP: 002b:000000c00b3ab748 EFLAGS: 00000246 ORIG_RAX: 0000000000000119
RAX: ffffffffffffffda RBX: 0000000000000004 RCX: 000000000040720e
RDX: 0000000000000080 RSI: 000000c00b3ab818 RDI: 0000000000000004
RBP: 000000c00b3ab790 R08: 0000000000000000 R09: 0000000000000000
R10: 000000000000004b R11: 0000000000000246 R12: 000000c00b3ab820
R13: 000000c013f3b95c R14: 000000c00addf1e0 R15: 0000000000000000