tipc: 32-bit node address hash set to 0 ================================================================== BUG: KASAN: use-after-free in tipc_named_reinit+0x198/0x320 net/tipc/name_distr.c:344 Read of size 8 at addr ffff8881d600e000 by task kworker/1:0/18 CPU: 1 PID: 18 Comm: kworker/1:0 Not tainted 5.4.289-syzkaller-00011-g39762b7a60e9 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 12/27/2024 Workqueue: events tipc_net_finalize_work Call Trace: __dump_stack lib/dump_stack.c:77 [inline] dump_stack+0x1d8/0x241 lib/dump_stack.c:118 print_address_description+0x8c/0x600 mm/kasan/report.c:384 __kasan_report+0xf3/0x120 mm/kasan/report.c:516 kasan_report+0x30/0x60 mm/kasan/common.c:653 tipc_named_reinit+0x198/0x320 net/tipc/name_distr.c:344 tipc_net_finalize+0xc8/0x130 net/tipc/net.c:132 process_one_work+0x765/0xd20 kernel/workqueue.c:2290 worker_thread+0xaef/0x1470 kernel/workqueue.c:2436 kthread+0x2da/0x360 kernel/kthread.c:288 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:354 Allocated by task 1562: save_stack mm/kasan/common.c:70 [inline] set_track mm/kasan/common.c:78 [inline] __kasan_kmalloc+0x171/0x210 mm/kasan/common.c:529 kmalloc include/linux/slab.h:556 [inline] kzalloc include/linux/slab.h:690 [inline] device_private_init drivers/base/core.c:2753 [inline] device_add+0xb6/0xbb0 drivers/base/core.c:2803 netdev_register_kobject+0x176/0x310 net/core/net-sysfs.c:1854 register_netdevice+0xbc5/0x12a0 net/core/dev.c:9209 __ip_tunnel_create+0x2b0/0x370 net/ipv4/ip_tunnel.c:267 ip_tunnel_init_net+0x278/0x740 net/ipv4/ip_tunnel.c:1076 ops_init+0x1d4/0x4a0 net/core/net_namespace.c:141 setup_net+0x214/0x990 net/core/net_namespace.c:348 copy_net_ns+0x30d/0x510 net/core/net_namespace.c:489 create_new_namespaces+0x47a/0x570 kernel/nsproxy.c:103 unshare_nsproxy_namespaces+0x119/0x170 kernel/nsproxy.c:202 ksys_unshare+0x544/0x990 kernel/fork.c:2908 __do_sys_unshare kernel/fork.c:2976 [inline] __se_sys_unshare kernel/fork.c:2974 [inline] __x64_sys_unshare+0x34/0x40 kernel/fork.c:2974 do_syscall_64+0xca/0x1c0 arch/x86/entry/common.c:290 entry_SYSCALL_64_after_hwframe+0x5c/0xc1 Freed by task 0: (stack is not available) The buggy address belongs to the object at ffff8881d600e000 which belongs to the cache kmalloc-256 of size 256 The buggy address is located 0 bytes inside of 256-byte region [ffff8881d600e000, ffff8881d600e100) The buggy address belongs to the page: page:ffffea0007580380 refcount:1 mapcount:0 mapping:ffff8881f5c02780 index:0x0 compound_mapcount: 0 flags: 0x8000000000010200(slab|head) raw: 8000000000010200 dead000000000100 dead000000000122 ffff8881f5c02780 raw: 0000000000000000 0000000000100010 00000001ffffffff 0000000000000000 page dumped because: kasan: bad access detected page_owner tracks the page as allocated page last allocated via order 1, migratetype Unmovable, gfp_mask 0x1d60c0(__GFP_IO|__GFP_FS|__GFP_NOWARN|__GFP_RETRY_MAYFAIL|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC|__GFP_HARDWALL) set_page_owner include/linux/page_owner.h:31 [inline] post_alloc_hook mm/page_alloc.c:2165 [inline] prep_new_page+0x18f/0x370 mm/page_alloc.c:2171 get_page_from_freelist+0x2d13/0x2d90 mm/page_alloc.c:3794 __alloc_pages_nodemask+0x393/0x840 mm/page_alloc.c:4893 alloc_slab_page+0x39/0x3c0 mm/slub.c:343 allocate_slab mm/slub.c:1683 [inline] new_slab+0x97/0x440 mm/slub.c:1749 new_slab_objects mm/slub.c:2505 [inline] ___slab_alloc+0x2fe/0x490 mm/slub.c:2667 __slab_alloc+0x62/0xa0 mm/slub.c:2707 slab_alloc_node mm/slub.c:2792 [inline] slab_alloc mm/slub.c:2837 [inline] __kmalloc+0x19b/0x2e0 mm/slub.c:3909 __kmalloc_node include/linux/slab.h:422 [inline] kmalloc_node include/linux/slab.h:599 [inline] kvmalloc_node+0x7e/0xf0 mm/util.c:596 kvmalloc include/linux/mm.h:761 [inline] kvzalloc include/linux/mm.h:769 [inline] netif_alloc_rx_queues net/core/dev.c:8981 [inline] alloc_netdev_mqs+0x80f/0xc70 net/core/dev.c:9681 rtnl_create_link+0x24a/0x9e0 net/core/rtnetlink.c:2976 veth_newlink+0x287/0xb50 drivers/net/veth.c:1286 __rtnl_newlink net/core/rtnetlink.c:3255 [inline] rtnl_newlink+0x1567/0x2060 net/core/rtnetlink.c:3314 rtnetlink_rcv_msg+0x983/0xc70 net/core/rtnetlink.c:5290 netlink_rcv_skb+0x1d5/0x420 net/netlink/af_netlink.c:2467 netlink_unicast_kernel net/netlink/af_netlink.c:1306 [inline] netlink_unicast+0x936/0xb20 net/netlink/af_netlink.c:1332 page last free stack trace: reset_page_owner include/linux/page_owner.h:24 [inline] free_pages_prepare mm/page_alloc.c:1176 [inline] __free_pages_ok+0x847/0x950 mm/page_alloc.c:1438 free_the_page mm/page_alloc.c:4955 [inline] __free_pages+0x91/0x140 mm/page_alloc.c:4961 tipc_exit_net+0x92/0xf0 net/tipc/core.c:108 ops_exit_list net/core/net_namespace.c:182 [inline] cleanup_net+0x665/0xc90 net/core/net_namespace.c:612 process_one_work+0x765/0xd20 kernel/workqueue.c:2290 worker_thread+0xaef/0x1470 kernel/workqueue.c:2436 kthread+0x2da/0x360 kernel/kthread.c:288 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:354 Memory state around the buggy address: ffff8881d600df00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff8881d600df80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc >ffff8881d600e000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ^ ffff8881d600e080: 00 00 00 00 00 00 00 00 00 00 fc fc fc fc fc fc ffff8881d600e100: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ================================================================== BUG: unable to handle page fault for address: fffffffffffffff0 #PF: supervisor write access in kernel mode #PF: error_code(0x0002) - not-present page PGD 5e11067 P4D 5e11067 PUD 5e13067 PMD 0 Oops: 0002 [#1] PREEMPT SMP KASAN CPU: 1 PID: 18 Comm: kworker/1:0 Tainted: G B 5.4.289-syzkaller-00011-g39762b7a60e9 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 12/27/2024 Workqueue: events tipc_net_finalize_work RIP: 0010:tipc_named_reinit+0x1b4/0x320 net/tipc/name_distr.c:345 Code: 80 3c 28 00 74 08 4c 89 ff e8 38 3a 56 fd 49 8b 1f 49 39 df 74 56 48 8d 7b f0 48 89 f8 48 c1 e8 03 42 0f b6 04 28 84 c0 75 28 <89> 6b f0 48 89 d8 48 c1 e8 03 42 80 3c 28 00 74 08 48 89 df e8 03 RSP: 0018:ffff8881f5e2fd00 EFLAGS: 00010246 RAX: 0000000000000000 RBX: 0000000000000000 RCX: ffff8881f5e12f40 RDX: 0000000000000000 RSI: 0000000000000001 RDI: fffffffffffffff0 RBP: 0000000000000000 R08: ffffffff813ae535 R09: 0000000000000003 R10: ffffffffffffffff R11: dffffc0000000001 R12: ffff8881d600c000 R13: dffffc0000000000 R14: ffff8881d6011160 R15: ffff8881d600e000 FS: 0000000000000000(0000) GS:ffff8881f6f00000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: fffffffffffffff0 CR3: 0000000005e0e000 CR4: 00000000003406a0 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 Call Trace: tipc_net_finalize+0xc8/0x130 net/tipc/net.c:132 process_one_work+0x765/0xd20 kernel/workqueue.c:2290 worker_thread+0xaef/0x1470 kernel/workqueue.c:2436 kthread+0x2da/0x360 kernel/kthread.c:288 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:354 Modules linked in: CR2: fffffffffffffff0 ---[ end trace 8cd6144e032994a1 ]--- RIP: 0010:tipc_named_reinit+0x1b4/0x320 net/tipc/name_distr.c:345 Code: 80 3c 28 00 74 08 4c 89 ff e8 38 3a 56 fd 49 8b 1f 49 39 df 74 56 48 8d 7b f0 48 89 f8 48 c1 e8 03 42 0f b6 04 28 84 c0 75 28 <89> 6b f0 48 89 d8 48 c1 e8 03 42 80 3c 28 00 74 08 48 89 df e8 03 RSP: 0018:ffff8881f5e2fd00 EFLAGS: 00010246 RAX: 0000000000000000 RBX: 0000000000000000 RCX: ffff8881f5e12f40 RDX: 0000000000000000 RSI: 0000000000000001 RDI: fffffffffffffff0 RBP: 0000000000000000 R08: ffffffff813ae535 R09: 0000000000000003 R10: ffffffffffffffff R11: dffffc0000000001 R12: ffff8881d600c000 R13: dffffc0000000000 R14: ffff8881d6011160 R15: ffff8881d600e000 FS: 0000000000000000(0000) GS:ffff8881f6f00000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: fffffffffffffff0 CR3: 0000000005e0e000 CR4: 00000000003406a0 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 ---------------- Code disassembly (best guess): 0: 80 3c 28 00 cmpb $0x0,(%rax,%rbp,1) 4: 74 08 je 0xe 6: 4c 89 ff mov %r15,%rdi 9: e8 38 3a 56 fd call 0xfd563a46 e: 49 8b 1f mov (%r15),%rbx 11: 49 39 df cmp %rbx,%r15 14: 74 56 je 0x6c 16: 48 8d 7b f0 lea -0x10(%rbx),%rdi 1a: 48 89 f8 mov %rdi,%rax 1d: 48 c1 e8 03 shr $0x3,%rax 21: 42 0f b6 04 28 movzbl (%rax,%r13,1),%eax 26: 84 c0 test %al,%al 28: 75 28 jne 0x52 * 2a: 89 6b f0 mov %ebp,-0x10(%rbx) <-- trapping instruction 2d: 48 89 d8 mov %rbx,%rax 30: 48 c1 e8 03 shr $0x3,%rax 34: 42 80 3c 28 00 cmpb $0x0,(%rax,%r13,1) 39: 74 08 je 0x43 3b: 48 89 df mov %rbx,%rdi 3e: e8 .byte 0xe8 3f: 03 .byte 0x3