================================================================== BUG: KFENCE: use-after-free read in cleanup_bearer+0x1ce/0x2b0 net/tipc/udp_media.c:815 Use-after-free read at 0xffff88823ff32cd8 (in kfence-#49): cleanup_bearer+0x1ce/0x2b0 net/tipc/udp_media.c:815 process_one_work+0x6dc/0xbd0 kernel/workqueue.c:2301 worker_thread+0xaea/0x1510 kernel/workqueue.c:2447 kthread+0x34b/0x3d0 kernel/kthread.c:313 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:298 kfence-#49 [0xffff88823ff32cc0-0xffff88823ff32fff, size=832, cache=sock_inode_cache] allocated by task 5249: sock_alloc_inode+0x1b/0xb0 net/socket.c:253 alloc_inode fs/inode.c:233 [inline] new_inode_pseudo+0x64/0x220 fs/inode.c:968 sock_alloc net/socket.c:574 [inline] __sock_create+0x135/0x760 net/socket.c:1400 sock_create_kern+0x3b/0x50 net/socket.c:1505 udp_sock_create6+0xe1/0x850 net/ipv6/ip6_udp_tunnel.c:23 udp_sock_create+0x63/0xb0 include/net/udp_tunnel.h:62 tipc_udp_enable+0xeb6/0x1670 net/tipc/udp_media.c:765 tipc_enable_bearer net/tipc/bearer.c:323 [inline] __tipc_nl_bearer_enable+0x9d5/0x1140 net/tipc/bearer.c:1020 tipc_nl_bearer_enable+0x22/0x30 net/tipc/bearer.c:1029 genl_family_rcv_msg_doit net/netlink/genetlink.c:739 [inline] genl_family_rcv_msg net/netlink/genetlink.c:783 [inline] genl_rcv_msg+0x115d/0x16e0 net/netlink/genetlink.c:800 netlink_rcv_skb+0x1cf/0x410 net/netlink/af_netlink.c:2485 genl_rcv+0x28/0x40 net/netlink/genetlink.c:811 netlink_unicast_kernel net/netlink/af_netlink.c:1307 [inline] netlink_unicast+0x8df/0xac0 net/netlink/af_netlink.c:1333 netlink_sendmsg+0xa46/0xd00 net/netlink/af_netlink.c:1901 sock_sendmsg_nosec net/socket.c:652 [inline] __sock_sendmsg net/socket.c:664 [inline] ____sys_sendmsg+0x59e/0x8f0 net/socket.c:2376 ___sys_sendmsg+0x252/0x2e0 net/socket.c:2430 __sys_sendmsg net/socket.c:2459 [inline] __do_sys_sendmsg net/socket.c:2468 [inline] __se_sys_sendmsg+0x1b1/0x280 net/socket.c:2466 __x64_sys_sendmsg+0x7b/0x90 net/socket.c:2466 do_syscall_64+0x34/0x70 entry_SYSCALL_64_after_hwframe+0x61/0xcb freed by task 12: sock_free_inode+0x20/0x30 net/socket.c:274 i_callback+0x4b/0x70 fs/inode.c:222 rcu_do_batch+0x597/0xc40 kernel/rcu/tree.c:2494 rcu_core+0x5ad/0xe40 kernel/rcu/tree.c:2735 rcu_core_si+0x9/0x10 kernel/rcu/tree.c:2748 __do_softirq+0x268/0x5bb kernel/softirq.c:309 run_ksoftirqd+0x23/0x30 kernel/softirq.c:670 smpboot_thread_fn+0x545/0x930 kernel/smpboot.c:164 kthread+0x34b/0x3d0 kernel/kthread.c:313 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:298 CPU: 0 PID: 15 Comm: kworker/0:1 Not tainted 5.10.231-syzkaller-00700-g4055d754db6f #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 09/13/2024 Workqueue: events cleanup_bearer RIP: 0010:cleanup_bearer+0x1ce/0x2b0 net/tipc/udp_media.c:815 Code: 3c 2b 00 74 08 4c 89 f7 e8 5f 16 0a fd 49 8b 1e 48 83 c3 18 48 89 d8 48 c1 e8 03 42 80 3c 28 00 74 08 48 89 df e8 42 16 0a fd <48> 8b 1b 48 83 c3 30 48 89 d8 48 c1 e8 03 42 80 3c 28 00 74 08 48 RSP: 0018:ffffc900000f7cf0 EFLAGS: 00010246 RAX: 1ffff11047fe659b RBX: ffff88823ff32cd8 RCX: 1ffff9200001ef34 RDX: dffffc0000000000 RSI: ffffc900000f79c0 RDI: 0000000000000001 RBP: ffffc900000f7d30 R08: dffffc0000000000 R09: 0000000000000003 R10: fffff5200001ef18 R11: dffffc0000000001 R12: ffff888119c71c80 R13: dffffc0000000000 R14: ffff8881190ea708 R15: ffff8881190ea718 FS: 0000000000000000(0000) GS:ffff8881f7000000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: ffff88823ff32cd8 CR3: 0000000114f1f000 CR4: 00000000003506b0 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 Call Trace: process_one_work+0x6dc/0xbd0 kernel/workqueue.c:2301 worker_thread+0xaea/0x1510 kernel/workqueue.c:2447 kthread+0x34b/0x3d0 kernel/kthread.c:313 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:298 ================================================================== general protection fault, probably for non-canonical address 0xdffffc0000000006: 0000 [#1] PREEMPT SMP KASAN KASAN: null-ptr-deref in range [0x0000000000000030-0x0000000000000037] CPU: 0 PID: 15 Comm: kworker/0:1 Tainted: G B 5.10.231-syzkaller-00700-g4055d754db6f #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 09/13/2024 Workqueue: events cleanup_bearer RIP: 0010:read_pnet include/net/net_namespace.h:335 [inline] RIP: 0010:sock_net include/net/sock.h:2653 [inline] RIP: 0010:cleanup_bearer+0x1dc/0x2b0 net/tipc/udp_media.c:815 Code: 8b 1e 48 83 c3 18 48 89 d8 48 c1 e8 03 42 80 3c 28 00 74 08 48 89 df e8 42 16 0a fd 48 8b 1b 48 83 c3 30 48 89 d8 48 c1 e8 03 <42> 80 3c 28 00 74 08 48 89 df e8 25 16 0a fd 4c 8b 33 48 c7 c0 80 RSP: 0018:ffffc900000f7cf0 EFLAGS: 00010206 RAX: 0000000000000006 RBX: 0000000000000030 RCX: 1ffff9200001ef34 RDX: dffffc0000000000 RSI: ffffc900000f79c0 RDI: 0000000000000001 RBP: ffffc900000f7d30 R08: dffffc0000000000 R09: 0000000000000003 R10: fffff5200001ef18 R11: dffffc0000000001 R12: ffff888119c71c80 R13: dffffc0000000000 R14: ffff8881190ea708 R15: ffff8881190ea718 FS: 0000000000000000(0000) GS:ffff8881f7000000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 00007ff60741f178 CR3: 000000012262e000 CR4: 00000000003506b0 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 Call Trace: process_one_work+0x6dc/0xbd0 kernel/workqueue.c:2301 worker_thread+0xaea/0x1510 kernel/workqueue.c:2447 kthread+0x34b/0x3d0 kernel/kthread.c:313 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:298 Modules linked in: ---[ end trace e758cb391dc23403 ]--- RIP: 0010:read_pnet include/net/net_namespace.h:335 [inline] RIP: 0010:sock_net include/net/sock.h:2653 [inline] RIP: 0010:cleanup_bearer+0x1dc/0x2b0 net/tipc/udp_media.c:815 Code: 8b 1e 48 83 c3 18 48 89 d8 48 c1 e8 03 42 80 3c 28 00 74 08 48 89 df e8 42 16 0a fd 48 8b 1b 48 83 c3 30 48 89 d8 48 c1 e8 03 <42> 80 3c 28 00 74 08 48 89 df e8 25 16 0a fd 4c 8b 33 48 c7 c0 80 RSP: 0018:ffffc900000f7cf0 EFLAGS: 00010206 RAX: 0000000000000006 RBX: 0000000000000030 RCX: 1ffff9200001ef34 RDX: dffffc0000000000 RSI: ffffc900000f79c0 RDI: 0000000000000001 RBP: ffffc900000f7d30 R08: dffffc0000000000 R09: 0000000000000003 R10: fffff5200001ef18 R11: dffffc0000000001 R12: ffff888119c71c80 R13: dffffc0000000000 R14: ffff8881190ea708 R15: ffff8881190ea718 FS: 0000000000000000(0000) GS:ffff8881f7000000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 00007ff60741f178 CR3: 000000010c905000 CR4: 00000000003506b0 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 ---------------- Code disassembly (best guess): 0: 3c 2b cmp $0x2b,%al 2: 00 74 08 4c add %dh,0x4c(%rax,%rcx,1) 6: 89 f7 mov %esi,%edi 8: e8 5f 16 0a fd call 0xfd0a166c d: 49 8b 1e mov (%r14),%rbx 10: 48 83 c3 18 add $0x18,%rbx 14: 48 89 d8 mov %rbx,%rax 17: 48 c1 e8 03 shr $0x3,%rax 1b: 42 80 3c 28 00 cmpb $0x0,(%rax,%r13,1) 20: 74 08 je 0x2a 22: 48 89 df mov %rbx,%rdi 25: e8 42 16 0a fd call 0xfd0a166c * 2a: 48 8b 1b mov (%rbx),%rbx <-- trapping instruction 2d: 48 83 c3 30 add $0x30,%rbx 31: 48 89 d8 mov %rbx,%rax 34: 48 c1 e8 03 shr $0x3,%rax 38: 42 80 3c 28 00 cmpb $0x0,(%rax,%r13,1) 3d: 74 08 je 0x47 3f: 48 rex.W