================================ WARNING: inconsistent lock state 6.13.0-rc3-syzkaller-00762-g9268abe611b0 #0 Not tainted -------------------------------- inconsistent {IN-SOFTIRQ-W} -> {SOFTIRQ-ON-W} usage. syz-executor195/8481 [HC0[0]:SC0[0]:HE1:SE1] takes: ffff88803127fa38 (&rng->jent_lock){+.?.}-{3:3}, at: spin_lock include/linux/spinlock.h:351 [inline] ffff88803127fa38 (&rng->jent_lock){+.?.}-{3:3}, at: jent_kcapi_cleanup+0x2e/0x1f0 crypto/jitterentropy-kcapi.c:204 {IN-SOFTIRQ-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_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 __raw_spin_unlock_irqrestore include/linux/spinlock_api_smp.h:152 [inline] _raw_spin_unlock_irqrestore+0xd8/0x140 kernel/locking/spinlock.c:194 spin_unlock_irqrestore include/linux/spinlock.h:406 [inline] pcpu_alloc_noprof+0xbb9/0x1760 mm/percpu.c:1871 xt_percpu_counter_alloc+0x150/0x1f0 net/netfilter/x_tables.c:1931 find_check_entry net/ipv4/netfilter/ip_tables.c:526 [inline] translate_table+0x12ec/0x2260 net/ipv4/netfilter/ip_tables.c:716 ipt_register_table+0x10f/0x7a0 net/ipv4/netfilter/ip_tables.c:1742 iptable_nat_table_init+0x43/0x2d0 net/ipv4/netfilter/iptable_nat.c:115 xt_find_table_lock+0x322/0x400 net/netfilter/x_tables.c:1260 xt_request_find_table_lock+0x26/0x100 net/netfilter/x_tables.c:1285 get_info net/ipv4/netfilter/ip_tables.c:963 [inline] do_ipt_get_ctl+0x89e/0x1810 net/ipv4/netfilter/ip_tables.c:1659 nf_getsockopt+0x299/0x2c0 net/netfilter/nf_sockopt.c:116 ip_getsockopt+0x222/0x2e0 net/ipv4/ip_sockglue.c:1777 tcp_getsockopt+0x163/0x1c0 net/ipv4/tcp.c:4671 do_sock_getsockopt+0x3c4/0x7e0 net/socket.c:2385 __sys_getsockopt net/socket.c:2414 [inline] __do_sys_getsockopt net/socket.c:2421 [inline] __se_sys_getsockopt net/socket.c:2418 [inline] __x64_sys_getsockopt+0x2a1/0x370 net/socket.c:2418 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: 1379 hardirqs last enabled at (1379): [] syscall_enter_from_user_mode include/linux/entry-common.h:198 [inline] hardirqs last enabled at (1379): [] do_syscall_64+0xb6/0x230 arch/x86/entry/common.c:79 hardirqs last disabled at (1378): [] entry_SYSCALL_64_after_hwframe+0x77/0x7f softirqs last enabled at (1142): [] local_bh_disable include/linux/bottom_half.h:20 [inline] softirqs last enabled at (1142): [] fpregs_lock arch/x86/include/asm/fpu/api.h:72 [inline] softirqs last enabled at (1142): [] fpu_clone+0x25b/0xad0 arch/x86/kernel/fpu/core.c:630 softirqs last disabled at (1140): [] local_bh_disable include/linux/bottom_half.h:20 [inline] softirqs last disabled at (1140): [] fpregs_lock arch/x86/include/asm/fpu/api.h:72 [inline] softirqs last disabled at (1140): [] fpu_clone+0x25b/0xad0 arch/x86/kernel/fpu/core.c:630 other info that might help us debug this: Possible unsafe locking scenario: CPU0 ---- lock(&rng->jent_lock); lock(&rng->jent_lock); *** DEADLOCK *** 1 lock held by syz-executor195/8481: #0: ffff8880721cca08 (&sb->s_type->i_mutex_key#10){+.+.}-{4:4}, at: inode_lock include/linux/fs.h:818 [inline] #0: ffff8880721cca08 (&sb->s_type->i_mutex_key#10){+.+.}-{4:4}, at: __sock_release net/socket.c:639 [inline] #0: ffff8880721cca08 (&sb->s_type->i_mutex_key#10){+.+.}-{4:4}, at: sock_close+0x90/0x240 net/socket.c:1419 stack backtrace: CPU: 0 UID: 0 PID: 8481 Comm: syz-executor195 Not tainted 6.13.0-rc3-syzkaller-00762-g9268abe611b0 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 09/13/2024 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+0x11c5/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 sock_put include/net/sock.h:1907 [inline] af_alg_release+0x82/0xf0 crypto/af_alg.c:125 __sock_release net/socket.c:640 [inline] sock_close+0xbc/0x240 net/socket.c:1419 __fput+0x23c/0xa50 fs/file_table.c:450 __do_sys_close fs/open.c:1554 [inline] __se_sys_close fs/open.c:1539 [inline] __x64_sys_close+0x7f/0x110 fs/open.c:1539 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 RIP: 0033:0x7fccb20a131a Code: 48 3d 00 f0 ff ff 77 48 c3 0f 1f 80 00 00 00 00 48 83 ec 18 89 7c 24 0c e8 83 6a 02 00 8b 7c 24 0c 89 c2 b8 03 00 00 00 0f 05 <48> 3d 00 f0 ff ff 77 36 89 d7 89 44 24 0c e8 e3 6a 02 00 8b 44 24 RSP: 002b:00007ffe2196a0d0 EFLAGS: 00000293 ORIG_RAX: 0000000000000003 RAX: ffffffffffffffda RBX: 0000000000000004 RCX: 00007fccb20a131a RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000000000003 RBP: 0000000000012c72 R08: 7fffffffffffffff R09: 0000000500000000 R10: 00007ffe2196a110 R11: 0000000000000293 R12: 00007fccb213118c R13: 00007ffe2196a130 R14: 00007fccb206bed0 R15: 00007ffe2196a1a0