================================================================== BUG: KFENCE: use-after-free write in arch_test_and_set_bit arch/x86/include/asm/bitops.h:137 [inline] BUG: KFENCE: use-after-free write in test_and_set_bit include/asm-generic/bitops/instrumented-atomic.h:72 [inline] BUG: KFENCE: use-after-free write in l2tp_session_delete+0x2a/0x9e0 net/l2tp/l2tp_core.c:1639 Use-after-free write at 0xffff88823bdeec08 (in kfence-#246): arch_test_and_set_bit arch/x86/include/asm/bitops.h:137 [inline] test_and_set_bit include/asm-generic/bitops/instrumented-atomic.h:72 [inline] l2tp_session_delete+0x2a/0x9e0 net/l2tp/l2tp_core.c:1639 l2tp_tunnel_closeall net/l2tp/l2tp_core.c:1302 [inline] l2tp_tunnel_del_work+0x1cb/0x330 net/l2tp/l2tp_core.c:1334 process_one_work kernel/workqueue.c:3248 [inline] process_scheduled_works+0xa2c/0x1830 kernel/workqueue.c:3329 worker_thread+0x86d/0xd50 kernel/workqueue.c:3409 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 kfence-#246: 0xffff88823bdeec00-0xffff88823bdeee5f, size=608, cache=kmalloc-1k allocated by task 5848 on cpu 0 at 78.795211s: kmalloc_noprof include/linux/slab.h:664 [inline] kzalloc_noprof include/linux/slab.h:778 [inline] l2tp_session_create+0x3b/0xc20 net/l2tp/l2tp_core.c:1675 pppol2tp_connect+0xca3/0x17a0 net/l2tp/l2tp_ppp.c:782 __sys_connect_file net/socket.c:2049 [inline] __sys_connect+0x2df/0x310 net/socket.c:2066 __do_sys_connect net/socket.c:2076 [inline] __se_sys_connect net/socket.c:2073 [inline] __x64_sys_connect+0x7a/0x90 net/socket.c:2073 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 freed by task 24 on cpu 1 at 79.075180s: __sk_destruct+0x58/0x5f0 net/core/sock.c:2191 rcu_do_batch kernel/rcu/tree.c:2535 [inline] rcu_core+0xafd/0x1830 kernel/rcu/tree.c:2809 handle_softirqs+0x2c4/0x970 kernel/softirq.c:554 run_ksoftirqd+0xca/0x130 kernel/softirq.c:928 smpboot_thread_fn+0x544/0xa30 kernel/smpboot.c:164 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 CPU: 0 PID: 51 Comm: kworker/u8:3 Not tainted 6.10.0-rc5-syzkaller-01137-g1c5fc27bc48a #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 06/07/2024 Workqueue: l2tp l2tp_tunnel_del_work RIP: 0010:arch_test_and_set_bit arch/x86/include/asm/bitops.h:137 [inline] RIP: 0010:test_and_set_bit include/asm-generic/bitops/instrumented-atomic.h:72 [inline] RIP: 0010:l2tp_session_delete+0x2a/0x9e0 net/l2tp/l2tp_core.c:1639 Code: f3 0f 1e fa 55 41 57 41 56 41 55 41 54 53 48 83 ec 30 49 89 fd e8 66 98 e3 f6 49 8d 7d 08 be 08 00 00 00 e8 18 69 49 f7 31 db 49 0f ba 6d 08 00 40 0f 93 c5 0f 92 c3 bf 02 00 00 00 89 de e8 RSP: 0018:ffffc90000bb7b00 EFLAGS: 00010246 RAX: ffffffff8ab28e01 RBX: 0000000000000000 RCX: ffffffff8ab28ea8 RDX: 0000000000000001 RSI: 0000000000000008 RDI: ffff88823bdeec08 RBP: ffff88823bdeec00 R08: ffff88823bdeec0f R09: 1ffff110477bdd81 R10: dffffc0000000000 R11: ffffed10477bdd82 R12: ffff88823bdeecb8 R13: ffff88823bdeec00 R14: dffffc0000000000 R15: 1ffff110477bdd97 FS: 0000000000000000(0000) GS:ffff8880b9400000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: ffff88823bdeec08 CR3: 000000006177e000 CR4: 00000000003506f0 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 Call Trace: l2tp_tunnel_closeall net/l2tp/l2tp_core.c:1302 [inline] l2tp_tunnel_del_work+0x1cb/0x330 net/l2tp/l2tp_core.c:1334 process_one_work kernel/workqueue.c:3248 [inline] process_scheduled_works+0xa2c/0x1830 kernel/workqueue.c:3329 worker_thread+0x86d/0xd50 kernel/workqueue.c:3409 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: f3 0f 1e fa endbr64 4: 55 push %rbp 5: 41 57 push %r15 7: 41 56 push %r14 9: 41 55 push %r13 b: 41 54 push %r12 d: 53 push %rbx e: 48 83 ec 30 sub $0x30,%rsp 12: 49 89 fd mov %rdi,%r13 15: e8 66 98 e3 f6 call 0xf6e39880 1a: 49 8d 7d 08 lea 0x8(%r13),%rdi 1e: be 08 00 00 00 mov $0x8,%esi 23: e8 18 69 49 f7 call 0xf7496940 28: 31 db xor %ebx,%ebx * 2a: f0 49 0f ba 6d 08 00 lock btsq $0x0,0x8(%r13) <-- trapping instruction 31: 40 0f 93 c5 setae %bpl 35: 0f 92 c3 setb %bl 38: bf 02 00 00 00 mov $0x2,%edi 3d: 89 de mov %ebx,%esi 3f: e8 .byte 0xe8