================================================================== BUG: KASAN: use-after-free in cleanup_bearer+0x1b0/0x2a8 net/tipc/udp_media.c:824 Read of size 8 at addr ffff0000dbff4e18 by task kworker/1:2/1960 CPU: 1 PID: 1960 Comm: kworker/1:2 Not tainted 5.15.174-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 11/25/2024 Workqueue: events cleanup_bearer Call trace: dump_backtrace+0x0/0x530 arch/arm64/kernel/stacktrace.c:152 show_stack+0x2c/0x3c arch/arm64/kernel/stacktrace.c:216 __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0x108/0x170 lib/dump_stack.c:106 print_address_description+0x7c/0x3f0 mm/kasan/report.c:248 __kasan_report mm/kasan/report.c:434 [inline] kasan_report+0x174/0x1e4 mm/kasan/report.c:451 __asan_report_load8_noabort+0x44/0x50 mm/kasan/report_generic.c:309 cleanup_bearer+0x1b0/0x2a8 net/tipc/udp_media.c:824 process_one_work+0x790/0x11b8 kernel/workqueue.c:2310 worker_thread+0x910/0x1034 kernel/workqueue.c:2457 kthread+0x37c/0x45c kernel/kthread.c:334 ret_from_fork+0x10/0x20 arch/arm64/kernel/entry.S:870 Allocated by task 4211: kasan_save_stack mm/kasan/common.c:38 [inline] kasan_set_track mm/kasan/common.c:46 [inline] set_alloc_info mm/kasan/common.c:434 [inline] __kasan_slab_alloc+0x8c/0xcc mm/kasan/common.c:467 kasan_slab_alloc include/linux/kasan.h:254 [inline] slab_post_alloc_hook+0x74/0x3f4 mm/slab.h:519 slab_alloc_node mm/slub.c:3220 [inline] slab_alloc mm/slub.c:3228 [inline] kmem_cache_alloc+0x1dc/0x45c mm/slub.c:3233 sock_alloc_inode+0x24/0xc4 net/socket.c:303 alloc_inode fs/inode.c:236 [inline] new_inode_pseudo+0x68/0x200 fs/inode.c:976 sock_alloc net/socket.c:626 [inline] __sock_create+0x134/0x8a0 net/socket.c:1450 sock_create_kern+0x4c/0x64 net/socket.c:1560 udp_sock_create4+0xd4/0x5a4 net/ipv4/udp_tunnel_core.c:20 udp_sock_create+0x94/0xc0 include/net/udp_tunnel.h:59 tipc_udp_enable+0xb88/0x12d8 net/tipc/udp_media.c:774 tipc_enable_bearer net/tipc/bearer.c:333 [inline] __tipc_nl_bearer_enable+0x97c/0xfe8 net/tipc/bearer.c:1049 tipc_nl_bearer_enable+0x2c/0x48 net/tipc/bearer.c:1058 genl_family_rcv_msg_doit net/netlink/genetlink.c:731 [inline] genl_family_rcv_msg net/netlink/genetlink.c:775 [inline] genl_rcv_msg+0xc18/0x1018 net/netlink/genetlink.c:792 netlink_rcv_skb+0x20c/0x3b8 net/netlink/af_netlink.c:2489 genl_rcv+0x38/0x50 net/netlink/genetlink.c:803 netlink_unicast_kernel net/netlink/af_netlink.c:1311 [inline] netlink_unicast+0x664/0x938 net/netlink/af_netlink.c:1337 netlink_sendmsg+0x844/0xb38 net/netlink/af_netlink.c:1905 sock_sendmsg_nosec net/socket.c:704 [inline] __sock_sendmsg net/socket.c:716 [inline] ____sys_sendmsg+0x584/0x870 net/socket.c:2436 ___sys_sendmsg+0x214/0x294 net/socket.c:2490 __sys_sendmsg net/socket.c:2519 [inline] __do_sys_sendmsg net/socket.c:2528 [inline] __se_sys_sendmsg net/socket.c:2526 [inline] __arm64_sys_sendmsg+0x1ac/0x25c net/socket.c:2526 __invoke_syscall arch/arm64/kernel/syscall.c:38 [inline] invoke_syscall+0x98/0x2b8 arch/arm64/kernel/syscall.c:52 el0_svc_common+0x138/0x258 arch/arm64/kernel/syscall.c:142 do_el0_svc+0x58/0x14c arch/arm64/kernel/syscall.c:181 el0_svc+0x7c/0x1f0 arch/arm64/kernel/entry-common.c:608 el0t_64_sync_handler+0x84/0xe4 arch/arm64/kernel/entry-common.c:626 el0t_64_sync+0x1a0/0x1a4 arch/arm64/kernel/entry.S:584 Freed by task 4013: kasan_save_stack mm/kasan/common.c:38 [inline] kasan_set_track+0x4c/0x84 mm/kasan/common.c:46 kasan_set_free_info+0x28/0x4c mm/kasan/generic.c:360 ____kasan_slab_free+0x118/0x164 mm/kasan/common.c:366 __kasan_slab_free+0x18/0x28 mm/kasan/common.c:374 kasan_slab_free include/linux/kasan.h:230 [inline] slab_free_hook mm/slub.c:1705 [inline] slab_free_freelist_hook+0x128/0x1ec mm/slub.c:1731 slab_free mm/slub.c:3499 [inline] kmem_cache_free+0xdc/0x3c4 mm/slub.c:3515 sock_free_inode+0x28/0x38 net/socket.c:324 i_callback+0x50/0x78 fs/inode.c:225 rcu_do_batch kernel/rcu/tree.c:2523 [inline] rcu_core+0x830/0x1b34 kernel/rcu/tree.c:2763 rcu_core_si+0x10/0x1c kernel/rcu/tree.c:2776 handle_softirqs+0x384/0xdbc kernel/softirq.c:558 __do_softirq kernel/softirq.c:592 [inline] do_softirq_own_stack include/asm-generic/softirq_stack.h:10 [inline] invoke_softirq kernel/softirq.c:439 [inline] __irq_exit_rcu+0x268/0x4d8 kernel/softirq.c:641 irq_exit+0x14/0x88 kernel/softirq.c:665 handle_domain_irq+0xf4/0x178 kernel/irq/irqdesc.c:711 gic_handle_irq+0x78/0x1c8 drivers/irqchip/irq-gic-v3.c:765 Last potentially related work creation: kasan_save_stack+0x38/0x68 mm/kasan/common.c:38 kasan_record_aux_stack+0xd4/0x11c mm/kasan/generic.c:348 __call_rcu kernel/rcu/tree.c:3007 [inline] call_rcu+0x118/0xb40 kernel/rcu/tree.c:3087 destroy_inode fs/inode.c:291 [inline] evict+0x7ac/0x894 fs/inode.c:637 iput_final fs/inode.c:1744 [inline] iput+0x744/0x824 fs/inode.c:1770 __sock_release net/socket.c:661 [inline] sock_release+0x110/0x140 net/socket.c:677 udp_tunnel_sock_release+0x74/0x88 net/ipv4/udp_tunnel_core.c:184 cleanup_bearer+0x180/0x2a8 net/tipc/udp_media.c:822 process_one_work+0x790/0x11b8 kernel/workqueue.c:2310 worker_thread+0x910/0x1034 kernel/workqueue.c:2457 kthread+0x37c/0x45c kernel/kthread.c:334 ret_from_fork+0x10/0x20 arch/arm64/kernel/entry.S:870 Second to last potentially related work creation: kasan_save_stack+0x38/0x68 mm/kasan/common.c:38 kasan_record_aux_stack+0xd4/0x11c mm/kasan/generic.c:348 __call_rcu kernel/rcu/tree.c:3007 [inline] call_rcu+0x118/0xb40 kernel/rcu/tree.c:3087 destroy_inode fs/inode.c:291 [inline] evict+0x7ac/0x894 fs/inode.c:637 iput_final fs/inode.c:1744 [inline] iput+0x744/0x824 fs/inode.c:1770 dentry_unlink_inode+0x37c/0x4bc fs/dcache.c:380 __dentry_kill+0x324/0x5e4 fs/dcache.c:586 dentry_kill+0xc8/0x250 dput+0x21c/0x458 fs/dcache.c:893 __fput+0x494/0x800 fs/file_table.c:288 ____fput+0x20/0x30 fs/file_table.c:308 task_work_run+0x130/0x1e4 kernel/task_work.c:188 tracehook_notify_resume include/linux/tracehook.h:189 [inline] do_notify_resume+0x262c/0x32b8 arch/arm64/kernel/signal.c:946 prepare_exit_to_user_mode arch/arm64/kernel/entry-common.c:133 [inline] exit_to_user_mode arch/arm64/kernel/entry-common.c:138 [inline] el0_svc+0xfc/0x1f0 arch/arm64/kernel/entry-common.c:609 el0t_64_sync_handler+0x84/0xe4 arch/arm64/kernel/entry-common.c:626 el0t_64_sync+0x1a0/0x1a4 arch/arm64/kernel/entry.S:584 The buggy address belongs to the object at ffff0000dbff4e00 which belongs to the cache sock_inode_cache of size 1408 The buggy address is located 24 bytes inside of 1408-byte region [ffff0000dbff4e00, ffff0000dbff5380) The buggy address belongs to the page: page:0000000086975516 refcount:1 mapcount:0 mapping:0000000000000000 index:0xffff0000dbff5a00 pfn:0x11bff0 head:0000000086975516 order:3 compound_mapcount:0 compound_pincount:0 memcg:ffff0000c1e7ae01 flags: 0x5ffc00000010200(slab|head|node=0|zone=2|lastcpupid=0x7ff) raw: 05ffc00000010200 fffffc00037aec00 0000000200000002 ffff0000c0862480 raw: ffff0000dbff5a00 000000008015000d 00000001ffffffff ffff0000c1e7ae01 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff0000dbff4d00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff0000dbff4d80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc >ffff0000dbff4e00: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff0000dbff4e80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff0000dbff4f00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ================================================================== Unable to handle kernel paging request at virtual address dfff800000000006 Mem abort info: ESR = 0x0000000096000006 EC = 0x25: DABT (current EL), IL = 32 bits SET = 0, FnV = 0 EA = 0, S1PTW = 0 FSC = 0x06: level 2 translation fault Data abort info: ISV = 0, ISS = 0x00000006 CM = 0, WnR = 0 [dfff800000000006] address between user and kernel address ranges Internal error: Oops: 0000000096000006 [#1] PREEMPT SMP Modules linked in: CPU: 1 PID: 1960 Comm: kworker/1:2 Tainted: G B 5.15.174-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 11/25/2024 Workqueue: events cleanup_bearer pstate: 80400005 (Nzcv daif +PAN -UAO -TCO -DIT -SSBS BTYPE=--) pc : read_pnet include/net/net_namespace.h:333 [inline] pc : sock_net include/net/sock.h:2732 [inline] pc : cleanup_bearer+0x1bc/0x2a8 net/tipc/udp_media.c:824 lr : cleanup_bearer+0x1b0/0x2a8 net/tipc/udp_media.c:824 sp : ffff8000251c7b00 x29: ffff8000251c7b00 x28: ffff0001b41a9100 x27: ffff0000cd3d1018 x26: ffff0000ccd19e18 x25: ffff0001b41ade00 x24: dfff800000000000 x23: 1fffe000199a33c3 x22: ffff800014b6d310 x21: 1fffe000199a33c1 x20: 0000000000000030 x19: ffff0000ccd19e18 x18: 1fffe00036832d8e x17: 1fffe00036832d8e x16: ffff800011b4d2d0 x15: ffff800014c0fac0 x14: ffff0001b4196c80 x13: ffff0001b4196c7c x12: ffff700002e3a364 x11: 0000000000000000 x10: 0000000000000000 x9 : 0000000000000000 x8 : 0000000000000006 x7 : 0000000000000000 x6 : ffff80000826abdc x5 : 0000000000000000 x4 : 0000000000000000 x3 : ffff80000819c3ec x2 : 0000000000000001 x1 : 0000000000000001 x0 : 0000000000000001 Call trace: read_pnet include/net/net_namespace.h:333 [inline] sock_net include/net/sock.h:2732 [inline] cleanup_bearer+0x1bc/0x2a8 net/tipc/udp_media.c:824 process_one_work+0x790/0x11b8 kernel/workqueue.c:2310 worker_thread+0x910/0x1034 kernel/workqueue.c:2457 kthread+0x37c/0x45c kernel/kthread.c:334 ret_from_fork+0x10/0x20 arch/arm64/kernel/entry.S:870 Code: 979f9f3e f9400288 9100c114 d343fe88 (38786908) ---[ end trace 0df3f64b8b8ff6a1 ]--- ---------------- Code disassembly (best guess): 0: 979f9f3e bl 0xfffffffffe7e7cf8 4: f9400288 ldr x8, [x20] 8: 9100c114 add x20, x8, #0x30 c: d343fe88 lsr x8, x20, #3 * 10: 38786908 ldrb w8, [x8, x24] <-- trapping instruction