================================ WARNING: inconsistent lock state 6.13.0-rc3-syzkaller-00762-g9268abe611b0 #0 Not tainted -------------------------------- inconsistent {SOFTIRQ-ON-W} -> {IN-SOFTIRQ-W} usage. kworker/u8:0/11 [HC0[0]:SC1[1]:HE1:SE0] takes: ffff888026f6f738 (&rng->jent_lock){+.?.}-{3:3}, at: spin_lock include/linux/spinlock.h:351 [inline] ffff888026f6f738 (&rng->jent_lock){+.?.}-{3:3}, at: jent_kcapi_cleanup+0x2e/0x1f0 crypto/jitterentropy-kcapi.c:204 {SOFTIRQ-ON-W} state was registered at: lock_acquire+0x1ed/0x550 kernel/locking/lockdep.c:5849 __raw_spin_lock include/linux/spinlock_api_smp.h:133 [inline] _raw_spin_lock+0x2e/0x40 kernel/locking/spinlock.c:154 spin_lock include/linux/spinlock.h:351 [inline] jent_kcapi_random+0x24/0x100 crypto/jitterentropy-kcapi.c:281 crypto_rng_generate include/crypto/rng.h:146 [inline] crypto_rng_get_bytes include/crypto/rng.h:163 [inline] drbg_seed+0x303/0xa60 crypto/drbg.c:1185 drbg_instantiate crypto/drbg.c:1597 [inline] drbg_kcapi_seed+0x454/0xfb0 crypto/drbg.c:1970 crypto_rng_reset crypto/rng.c:47 [inline] crypto_get_default_rng+0x159/0x200 crypto/rng.c:121 aead_init_geniv+0x63/0x260 crypto/geniv.c:118 crypto_create_tfm_node+0x167/0x3d0 crypto/api.c:539 crypto_alloc_tfm_node+0x161/0x360 crypto/api.c:640 esp_init_aead net/ipv4/esp4.c:1023 [inline] esp_init_state+0x387/0x10b0 net/ipv4/esp4.c:1150 __xfrm_init_state+0x9db/0xea0 net/xfrm/xfrm_state.c:3056 xfrm_state_construct net/xfrm/xfrm_user.c:854 [inline] xfrm_add_sa+0x2c6e/0x3d70 net/xfrm/xfrm_user.c:912 xfrm_user_rcv_msg+0x890/0xb90 net/xfrm/xfrm_user.c:3373 netlink_rcv_skb+0x1e3/0x430 net/netlink/af_netlink.c:2543 xfrm_netlink_rcv+0x79/0x90 net/xfrm/xfrm_user.c:3395 netlink_unicast_kernel net/netlink/af_netlink.c:1322 [inline] netlink_unicast+0x7f6/0x990 net/netlink/af_netlink.c:1348 netlink_sendmsg+0x8e4/0xcb0 net/netlink/af_netlink.c:1892 sock_sendmsg_nosec net/socket.c:711 [inline] __sock_sendmsg+0x221/0x270 net/socket.c:726 ____sys_sendmsg+0x52a/0x7e0 net/socket.c:2594 ___sys_sendmsg net/socket.c:2648 [inline] __sys_sendmsg+0x269/0x350 net/socket.c:2680 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xf3/0x230 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x77/0x7f irq event stamp: 3492656 hardirqs last enabled at (3492656): [] __raw_spin_unlock_irqrestore include/linux/spinlock_api_smp.h:151 [inline] hardirqs last enabled at (3492656): [] _raw_spin_unlock_irqrestore+0x8f/0x140 kernel/locking/spinlock.c:194 hardirqs last disabled at (3492655): [] __raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:108 [inline] hardirqs last disabled at (3492655): [] _raw_spin_lock_irqsave+0xb0/0x120 kernel/locking/spinlock.c:162 softirqs last enabled at (3492520): [] spin_unlock_bh include/linux/spinlock.h:396 [inline] softirqs last enabled at (3492520): [] igmpv3_clear_delrec+0x6d/0x730 net/ipv4/igmp.c:1270 softirqs last disabled at (3492547): [] __do_softirq kernel/softirq.c:595 [inline] softirqs last disabled at (3492547): [] invoke_softirq kernel/softirq.c:435 [inline] softirqs last disabled at (3492547): [] __irq_exit_rcu+0xf7/0x220 kernel/softirq.c:662 other info that might help us debug this: Possible unsafe locking scenario: CPU0 ---- lock(&rng->jent_lock); lock(&rng->jent_lock); *** DEADLOCK *** 8 locks held by kworker/u8:0/11: #0: ffff88801baf5948 ((wq_completion)netns){+.+.}-{0:0}, at: process_one_work kernel/workqueue.c:3204 [inline] #0: ffff88801baf5948 ((wq_completion)netns){+.+.}-{0:0}, at: process_scheduled_works+0x93b/0x1840 kernel/workqueue.c:3310 #1: ffffc90000107d00 (net_cleanup_work){+.+.}-{0:0}, at: process_one_work kernel/workqueue.c:3205 [inline] #1: ffffc90000107d00 (net_cleanup_work){+.+.}-{0:0}, at: process_scheduled_works+0x976/0x1840 kernel/workqueue.c:3310 #2: ffffffff8fca74d0 (pernet_ops_rwsem){++++}-{4:4}, at: cleanup_net+0x16a/0xd50 net/core/net_namespace.c:602 #3: ffff88805d2d40e8 (&dev->mutex){....}-{4:4}, at: device_lock include/linux/device.h:1014 [inline] #3: ffff88805d2d40e8 (&dev->mutex){....}-{4:4}, at: devl_dev_lock net/devlink/devl_internal.h:108 [inline] #3: ffff88805d2d40e8 (&dev->mutex){....}-{4:4}, at: devlink_pernet_pre_exit+0x13b/0x440 net/devlink/core.c:506 #4: ffff88805d2d2250 (&devlink->lock_key#9){+.+.}-{4:4}, at: devl_lock net/devlink/core.c:276 [inline] #4: ffff88805d2d2250 (&devlink->lock_key#9){+.+.}-{4:4}, at: devl_dev_lock net/devlink/devl_internal.h:109 [inline] #4: ffff88805d2d2250 (&devlink->lock_key#9){+.+.}-{4:4}, at: devlink_pernet_pre_exit+0x14d/0x440 net/devlink/core.c:506 #5: ffffffff8fcb3988 (rtnl_mutex){+.+.}-{4:4}, at: nsim_destroy+0x71/0x5c0 drivers/net/netdevsim/netdev.c:816 #6: ffffffff8fd80f90 ((inetaddr_chain).rwsem){++++}-{4:4}, at: blocking_notifier_call_chain+0x53/0x90 kernel/notifier.c:379 #7: ffffffff8e937ba0 (rcu_callback){....}-{0:0}, at: rcu_lock_acquire include/linux/rcupdate.h:337 [inline] #7: ffffffff8e937ba0 (rcu_callback){....}-{0:0}, at: rcu_do_batch kernel/rcu/tree.c:2561 [inline] #7: ffffffff8e937ba0 (rcu_callback){....}-{0:0}, at: rcu_core+0xa37/0x17a0 kernel/rcu/tree.c:2823 stack backtrace: CPU: 1 UID: 0 PID: 11 Comm: kworker/u8:0 Not tainted 6.13.0-rc3-syzkaller-00762-g9268abe611b0 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 09/13/2024 Workqueue: netns cleanup_net Call Trace: __dump_stack lib/dump_stack.c:94 [inline] dump_stack_lvl+0x241/0x360 lib/dump_stack.c:120 print_usage_bug+0x62e/0x8b0 kernel/locking/lockdep.c:4038 valid_state+0x13a/0x1c0 kernel/locking/lockdep.c:4052 mark_lock_irq+0xbb/0xc20 kernel/locking/lockdep.c:4263 mark_lock+0x223/0x360 kernel/locking/lockdep.c:4749 __lock_acquire+0xc02/0x2100 kernel/locking/lockdep.c:5180 lock_acquire+0x1ed/0x550 kernel/locking/lockdep.c:5849 __raw_spin_lock include/linux/spinlock_api_smp.h:133 [inline] _raw_spin_lock+0x2e/0x40 kernel/locking/spinlock.c:154 spin_lock include/linux/spinlock.h:351 [inline] jent_kcapi_cleanup+0x2e/0x1f0 crypto/jitterentropy-kcapi.c:204 crypto_destroy_tfm+0x132/0x2b0 crypto/api.c:680 crypto_free_rng include/crypto/rng.h:125 [inline] rng_release+0x44/0x80 crypto/algif_rng.c:225 alg_do_release crypto/af_alg.c:118 [inline] alg_sock_destruct+0x86/0xc0 crypto/af_alg.c:502 __sk_destruct+0x58/0x5f0 net/core/sock.c:2273 rcu_do_batch kernel/rcu/tree.c:2567 [inline] rcu_core+0xaaa/0x17a0 kernel/rcu/tree.c:2823 handle_softirqs+0x2d4/0x9b0 kernel/softirq.c:561 __do_softirq kernel/softirq.c:595 [inline] invoke_softirq kernel/softirq.c:435 [inline] __irq_exit_rcu+0xf7/0x220 kernel/softirq.c:662 irq_exit_rcu+0x9/0x30 kernel/softirq.c:678 instr_sysvec_apic_timer_interrupt arch/x86/kernel/apic/apic.c:1049 [inline] sysvec_apic_timer_interrupt+0xa6/0xc0 arch/x86/kernel/apic/apic.c:1049 asm_sysvec_apic_timer_interrupt+0x1a/0x20 arch/x86/include/asm/idtentry.h:702 RIP: 0010:queue_work_on+0x269/0x380 kernel/workqueue.c:2395 Code: 75 19 e8 1a fc 37 00 eb 18 e8 13 fc 37 00 e8 ce 02 64 0a 48 83 7c 24 10 00 74 e7 e8 01 fc 37 00 fb 48 c7 44 24 20 0e 36 e0 45 <4b> c7 04 37 00 00 00 00 43 c7 44 37 09 00 00 00 00 66 43 c7 44 37 RSP: 0018:ffffc900001070c0 EFLAGS: 00000293 RAX: ffffffff816777ef RBX: 0000000000000000 RCX: ffff88801d2c3c00 RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000000000000 RBP: ffffc900001071b0 R08: ffffffff816777bf R09: 1ffffffff2857918 R10: dffffc0000000000 R11: fffffbfff2857919 R12: 001fffffffc00001 R13: 0000000000000046 R14: 1ffff92000020e1c R15: dffffc0000000000 inetaddr_event+0x11d/0x1b0 drivers/infiniband/core/roce_gid_mgmt.c:890 notifier_call_chain+0x1a5/0x3f0 kernel/notifier.c:85 blocking_notifier_call_chain+0x69/0x90 kernel/notifier.c:380 __inet_del_ifa+0x884/0x1040 net/ipv4/devinet.c:459 inet_del_ifa net/ipv4/devinet.c:496 [inline] inetdev_destroy net/ipv4/devinet.c:336 [inline] inetdev_event+0x6a5/0x1550 net/ipv4/devinet.c:1663 notifier_call_chain+0x1a5/0x3f0 kernel/notifier.c:85 call_netdevice_notifiers_extack net/core/dev.c:2034 [inline] call_netdevice_notifiers net/core/dev.c:2048 [inline] unregister_netdevice_many_notify+0xedd/0x1da0 net/core/dev.c:11526 unregister_netdevice_many net/core/dev.c:11590 [inline] unregister_netdevice_queue+0x303/0x370 net/core/dev.c:11462 unregister_netdevice include/linux/netdevice.h:3236 [inline] nsim_destroy+0x180/0x5c0 drivers/net/netdevsim/netdev.c:821 __nsim_dev_port_del+0x14b/0x1b0 drivers/net/netdevsim/dev.c:1428 nsim_dev_port_del_all drivers/net/netdevsim/dev.c:1440 [inline] nsim_dev_reload_destroy+0x28a/0x490 drivers/net/netdevsim/dev.c:1661 nsim_dev_reload_down+0x98/0xd0 drivers/net/netdevsim/dev.c:968 devlink_reload+0x18b/0x870 net/devlink/dev.c:461 devlink_pernet_pre_exit+0x1f3/0x440 net/devlink/core.c:509 ops_pre_exit_list net/core/net_namespace.c:162 [inline] cleanup_net+0x615/0xd50 net/core/net_namespace.c:628 process_one_work kernel/workqueue.c:3229 [inline] process_scheduled_works+0xa66/0x1840 kernel/workqueue.c:3310 worker_thread+0x870/0xd30 kernel/workqueue.c:3391 kthread+0x2f0/0x390 kernel/kthread.c:389 ret_from_fork+0x4b/0x80 arch/x86/kernel/process.c:147 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:244 ---------------- Code disassembly (best guess): 0: 75 19 jne 0x1b 2: e8 1a fc 37 00 call 0x37fc21 7: eb 18 jmp 0x21 9: e8 13 fc 37 00 call 0x37fc21 e: e8 ce 02 64 0a call 0xa6402e1 13: 48 83 7c 24 10 00 cmpq $0x0,0x10(%rsp) 19: 74 e7 je 0x2 1b: e8 01 fc 37 00 call 0x37fc21 20: fb sti 21: 48 c7 44 24 20 0e 36 movq $0x45e0360e,0x20(%rsp) 28: e0 45 * 2a: 4b c7 04 37 00 00 00 movq $0x0,(%r15,%r14,1) <-- trapping instruction 31: 00 32: 43 c7 44 37 09 00 00 movl $0x0,0x9(%r15,%r14,1) 39: 00 00 3b: 66 data16 3c: 43 rex.XB 3d: c7 .byte 0xc7 3e: 44 37 rex.R (bad)