======================================================
WARNING: possible circular locking dependency detected
4.20.0+ #1 Not tainted
------------------------------------------------------
swapper/0/0 is trying to acquire lock:
00000000bfae0c84 (nr_list_lock){+.-.}, at: spin_lock_bh include/linux/spinlock.h:334 [inline]
00000000bfae0c84 (nr_list_lock){+.-.}, at: nr_remove_socket net/netrom/af_netrom.c:96 [inline]
00000000bfae0c84 (nr_list_lock){+.-.}, at: nr_destroy_socket+0x96/0x6e0 net/netrom/af_netrom.c:264
but task is already holding lock:
000000009f72336f (slock-AF_NETROM){+.-.}, at: spin_lock include/linux/spinlock.h:329 [inline]
000000009f72336f (slock-AF_NETROM){+.-.}, at: nr_destroy_timer+0x32/0x90 net/netrom/af_netrom.c:247
which lock already depends on the new lock.
the existing dependency chain (in reverse order) is:
-> #1 (slock-AF_NETROM){+.-.}:
__raw_spin_lock include/linux/spinlock_api_smp.h:142 [inline]
_raw_spin_lock+0x2f/0x40 kernel/locking/spinlock.c:144
spin_lock include/linux/spinlock.h:329 [inline]
nr_find_listener net/netrom/af_netrom.c:156 [inline]
nr_rx_frame+0x60c/0x1d50 net/netrom/af_netrom.c:955
nr_loopback_timer+0x7b/0x170 net/netrom/nr_loopback.c:62
call_timer_fn+0x254/0x900 kernel/time/timer.c:1325
expire_timers kernel/time/timer.c:1362 [inline]
__run_timers+0x6fc/0xd50 kernel/time/timer.c:1681
run_timer_softirq+0x52/0xb0 kernel/time/timer.c:1694
__do_softirq+0x30b/0xb11 kernel/softirq.c:292
invoke_softirq kernel/softirq.c:373 [inline]
irq_exit+0x180/0x1d0 kernel/softirq.c:413
exiting_irq arch/x86/include/asm/apic.h:536 [inline]
smp_apic_timer_interrupt+0x1b7/0x760 arch/x86/kernel/apic/apic.c:1062
apic_timer_interrupt+0xf/0x20 arch/x86/entry/entry_64.S:807
arch_local_irq_restore arch/x86/include/asm/paravirt.h:766 [inline]
lock_acquire+0x259/0x570 kernel/locking/lockdep.c:3844
rcu_lock_acquire include/linux/rcupdate.h:223 [inline]
rcu_read_lock+0x29/0x70 include/linux/rcupdate.h:607
lock_page_memcg+0x75/0x2e0 mm/memcontrol.c:1862
page_add_file_rmap+0xe1/0x1420 mm/rmap.c:1184
alloc_set_pte+0xc2c/0x1e30 mm/memory.c:3222
filemap_map_pages+0x15a5/0x19e0 mm/filemap.c:2588
do_fault_around mm/memory.c:3369 [inline]
do_read_fault mm/memory.c:3403 [inline]
do_fault mm/memory.c:3534 [inline]
handle_pte_fault mm/memory.c:3765 [inline]
__handle_mm_fault+0x3f7e/0x56d0 mm/memory.c:3889
handle_mm_fault+0x4ec/0xc80 mm/memory.c:3926
do_user_addr_fault arch/x86/mm/fault.c:1475 [inline]
__do_page_fault+0x5da/0xd60 arch/x86/mm/fault.c:1541
do_page_fault+0xe6/0x7d8 arch/x86/mm/fault.c:1572
page_fault+0x1e/0x30 arch/x86/entry/entry_64.S:1143
-> #0 (nr_list_lock){+.-.}:
lock_acquire+0x1db/0x570 kernel/locking/lockdep.c:3841
__raw_spin_lock_bh include/linux/spinlock_api_smp.h:135 [inline]
_raw_spin_lock_bh+0x33/0x50 kernel/locking/spinlock.c:168
spin_lock_bh include/linux/spinlock.h:334 [inline]
nr_remove_socket net/netrom/af_netrom.c:96 [inline]
nr_destroy_socket+0x96/0x6e0 net/netrom/af_netrom.c:264
nr_destroy_timer+0x42/0x90 net/netrom/af_netrom.c:249
call_timer_fn+0x254/0x900 kernel/time/timer.c:1325
expire_timers kernel/time/timer.c:1362 [inline]
__run_timers+0x6fc/0xd50 kernel/time/timer.c:1681
run_timer_softirq+0x52/0xb0 kernel/time/timer.c:1694
__do_softirq+0x30b/0xb11 kernel/softirq.c:292
invoke_softirq kernel/softirq.c:373 [inline]
irq_exit+0x180/0x1d0 kernel/softirq.c:413
exiting_irq arch/x86/include/asm/apic.h:536 [inline]
smp_apic_timer_interrupt+0x1b7/0x760 arch/x86/kernel/apic/apic.c:1062
apic_timer_interrupt+0xf/0x20 arch/x86/entry/entry_64.S:807
native_safe_halt+0x2/0x10 arch/x86/include/asm/irqflags.h:57
arch_cpu_idle+0x10/0x20 arch/x86/kernel/process.c:555
default_idle_call+0x36/0x90 kernel/sched/idle.c:93
cpuidle_idle_call kernel/sched/idle.c:153 [inline]
do_idle+0x386/0x5d0 kernel/sched/idle.c:262
cpu_startup_entry+0x1b/0x20 kernel/sched/idle.c:353
rest_init+0x245/0x37b init/main.c:443
arch_call_rest_init+0xe/0x1b
start_kernel+0x882/0x8bd init/main.c:741
x86_64_start_reservations+0x29/0x2b arch/x86/kernel/head64.c:470
x86_64_start_kernel+0x77/0x7b arch/x86/kernel/head64.c:451
secondary_startup_64+0xa4/0xb0 arch/x86/kernel/head_64.S:243
other info that might help us debug this:
Possible unsafe locking scenario:
CPU0 CPU1
---- ----
lock(slock-AF_NETROM);
lock(nr_list_lock);
lock(slock-AF_NETROM);
lock(nr_list_lock);
*** DEADLOCK ***
2 locks held by swapper/0/0:
#0: 00000000f04e1749 ((&sk->sk_timer)#2){+.-.}, at: lockdep_copy_map include/linux/lockdep.h:171 [inline]
#0: 00000000f04e1749 ((&sk->sk_timer)#2){+.-.}, at: call_timer_fn+0x1b4/0x900 kernel/time/timer.c:1315
#1: 000000009f72336f (slock-AF_NETROM){+.-.}, at: spin_lock include/linux/spinlock.h:329 [inline]
#1: 000000009f72336f (slock-AF_NETROM){+.-.}, at: nr_destroy_timer+0x32/0x90 net/netrom/af_netrom.c:247
stack backtrace:
CPU: 0 PID: 0 Comm: swapper/0 Not tainted 4.20.0+ #1
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+0x1db/0x2d0 lib/dump_stack.c:113
print_circular_bug.isra.0.cold+0x1cc/0x28f kernel/locking/lockdep.c:1224
check_prev_add kernel/locking/lockdep.c:1866 [inline]
check_prevs_add kernel/locking/lockdep.c:1979 [inline]
validate_chain kernel/locking/lockdep.c:2350 [inline]
__lock_acquire+0x3014/0x4a30 kernel/locking/lockdep.c:3338
lock_acquire+0x1db/0x570 kernel/locking/lockdep.c:3841
__raw_spin_lock_bh include/linux/spinlock_api_smp.h:135 [inline]
_raw_spin_lock_bh+0x33/0x50 kernel/locking/spinlock.c:168
spin_lock_bh include/linux/spinlock.h:334 [inline]
nr_remove_socket net/netrom/af_netrom.c:96 [inline]
nr_destroy_socket+0x96/0x6e0 net/netrom/af_netrom.c:264
nr_destroy_timer+0x42/0x90 net/netrom/af_netrom.c:249
call_timer_fn+0x254/0x900 kernel/time/timer.c:1325
expire_timers kernel/time/timer.c:1362 [inline]
__run_timers+0x6fc/0xd50 kernel/time/timer.c:1681
run_timer_softirq+0x52/0xb0 kernel/time/timer.c:1694
__do_softirq+0x30b/0xb11 kernel/softirq.c:292
invoke_softirq kernel/softirq.c:373 [inline]
irq_exit+0x180/0x1d0 kernel/softirq.c:413
exiting_irq arch/x86/include/asm/apic.h:536 [inline]
smp_apic_timer_interrupt+0x1b7/0x760 arch/x86/kernel/apic/apic.c:1062
apic_timer_interrupt+0xf/0x20 arch/x86/entry/entry_64.S:807
RIP: 0010:native_safe_halt+0x2/0x10 arch/x86/include/asm/irqflags.h:58
Code: ff ff ff 48 89 c7 48 89 45 d8 e8 29 a9 ce f9 48 8b 45 d8 e9 ce fe ff ff 48 89 df e8 18 a9 ce f9 eb 82 90 90 90 90 90 90 fb f4 0f 1f 00 66 2e 0f 1f 84 00 00 00 00 00 f4 c3 90 90 90 90 90 90
RSP: 0018:ffffffff89807c60 EFLAGS: 00000282 ORIG_RAX: ffffffffffffff13
RAX: 1ffffffff13249f1 RBX: 1ffffffff1300f8f RCX: 0000000000000000
RDX: dffffc0000000000 RSI: 0000000000000001 RDI: ffffffff8987b73c
RBP: ffffffff89807d20 R08: ffffffff8987aec0 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000000 R12: 0000000000000000
R13: ffffffff89807cf8 R14: 0000000000000000 R15: ffffffff89924f78
arch_cpu_idle+0x10/0x20 arch/x86/kernel/process.c:555
default_idle_call+0x36/0x90 kernel/sched/idle.c:93
cpuidle_idle_call kernel/sched/idle.c:153 [inline]
do_idle+0x386/0x5d0 kernel/sched/idle.c:262
cpu_startup_entry+0x1b/0x20 kernel/sched/idle.c:353
rest_init+0x245/0x37b init/main.c:443
arch_call_rest_init+0xe/0x1b
start_kernel+0x882/0x8bd init/main.c:741
x86_64_start_reservations+0x29/0x2b arch/x86/kernel/head64.c:470
x86_64_start_kernel+0x77/0x7b arch/x86/kernel/head64.c:451
secondary_startup_64+0xa4/0xb0 arch/x86/kernel/head_64.S:243