================================================================== BUG: KASAN: use-after-free in cleanup_bearer+0x1b0/0x294 net/tipc/udp_media.c:824 Read of size 8 at addr ffff0000e2cd3618 by task kworker/0:10/4975 CPU: 0 PID: 4975 Comm: kworker/0:10 Tainted: G W 6.1.120-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 09/13/2024 Workqueue: events cleanup_bearer Call trace: dump_backtrace+0x1c8/0x1f4 arch/arm64/kernel/stacktrace.c:158 show_stack+0x2c/0x3c arch/arm64/kernel/stacktrace.c:165 __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0x108/0x170 lib/dump_stack.c:106 print_address_description mm/kasan/report.c:316 [inline] print_report+0x174/0x4c0 mm/kasan/report.c:427 kasan_report+0xd4/0x130 mm/kasan/report.c:531 __asan_report_load8_noabort+0x2c/0x38 mm/kasan/report_generic.c:351 cleanup_bearer+0x1b0/0x294 net/tipc/udp_media.c:824 process_one_work+0x7ac/0x1404 kernel/workqueue.c:2292 worker_thread+0x8e4/0xfec kernel/workqueue.c:2439 kthread+0x250/0x2d8 kernel/kthread.c:376 ret_from_fork+0x10/0x20 arch/arm64/kernel/entry.S:864 Allocated by task 5558: kasan_save_stack mm/kasan/common.c:45 [inline] kasan_set_track+0x4c/0x80 mm/kasan/common.c:52 kasan_save_alloc_info+0x24/0x30 mm/kasan/generic.c:505 __kasan_slab_alloc+0x74/0x8c mm/kasan/common.c:328 kasan_slab_alloc include/linux/kasan.h:201 [inline] slab_post_alloc_hook+0x74/0x458 mm/slab.h:737 slab_alloc_node mm/slub.c:3398 [inline] slab_alloc mm/slub.c:3406 [inline] __kmem_cache_alloc_lru mm/slub.c:3413 [inline] kmem_cache_alloc_lru+0x1ac/0x2f8 mm/slub.c:3429 alloc_inode_sb include/linux/fs.h:3245 [inline] sock_alloc_inode+0x2c/0xcc net/socket.c:306 alloc_inode fs/inode.c:261 [inline] new_inode_pseudo+0x68/0x1d0 fs/inode.c:1063 sock_alloc net/socket.c:631 [inline] __sock_create+0x134/0x8a0 net/socket.c:1514 sock_create_kern+0x4c/0x64 net/socket.c:1624 udp_sock_create4+0xd4/0x5a4 net/ipv4/udp_tunnel_core.c:17 udp_sock_create+0x94/0xc0 include/net/udp_tunnel.h:59 tipc_udp_enable+0xb74/0x12c4 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:756 [inline] genl_family_rcv_msg net/netlink/genetlink.c:833 [inline] genl_rcv_msg+0x948/0xc2c net/netlink/genetlink.c:850 netlink_rcv_skb+0x20c/0x3b8 net/netlink/af_netlink.c:2493 genl_rcv+0x38/0x50 net/netlink/genetlink.c:861 netlink_unicast_kernel net/netlink/af_netlink.c:1311 [inline] netlink_unicast+0x65c/0x898 net/netlink/af_netlink.c:1337 netlink_sendmsg+0x834/0xb18 net/netlink/af_netlink.c:1859 sock_sendmsg_nosec net/socket.c:718 [inline] __sock_sendmsg net/socket.c:730 [inline] ____sys_sendmsg+0x55c/0x848 net/socket.c:2519 ___sys_sendmsg net/socket.c:2573 [inline] __sys_sendmsg+0x26c/0x33c net/socket.c:2602 __do_sys_sendmsg net/socket.c:2611 [inline] __se_sys_sendmsg net/socket.c:2609 [inline] __arm64_sys_sendmsg+0x80/0x94 net/socket.c:2609 __invoke_syscall arch/arm64/kernel/syscall.c:38 [inline] invoke_syscall+0x98/0x2bc arch/arm64/kernel/syscall.c:52 el0_svc_common+0x1fc/0x258 arch/arm64/kernel/syscall.c:140 do_el0_svc+0x58/0x13c arch/arm64/kernel/syscall.c:204 el0_svc+0x58/0x168 arch/arm64/kernel/entry-common.c:637 el0t_64_sync_handler+0x84/0xf0 arch/arm64/kernel/entry-common.c:655 el0t_64_sync+0x18c/0x190 arch/arm64/kernel/entry.S:585 Freed by task 4781: kasan_save_stack mm/kasan/common.c:45 [inline] kasan_set_track+0x4c/0x80 mm/kasan/common.c:52 kasan_save_free_info+0x38/0x5c mm/kasan/generic.c:516 ____kasan_slab_free+0x144/0x1c0 mm/kasan/common.c:236 __kasan_slab_free+0x18/0x28 mm/kasan/common.c:244 kasan_slab_free include/linux/kasan.h:177 [inline] slab_free_hook mm/slub.c:1724 [inline] slab_free_freelist_hook mm/slub.c:1750 [inline] slab_free mm/slub.c:3661 [inline] kmem_cache_free+0x2f0/0x588 mm/slub.c:3683 sock_free_inode+0x28/0x38 net/socket.c:327 i_callback+0x50/0x78 fs/inode.c:250 rcu_do_batch kernel/rcu/tree.c:2297 [inline] rcu_core+0x880/0x1c48 kernel/rcu/tree.c:2557 rcu_core_si+0x10/0x1c kernel/rcu/tree.c:2574 handle_softirqs+0x318/0xd58 kernel/softirq.c:571 __do_softirq+0x14/0x20 kernel/softirq.c:605 Last potentially related work creation: kasan_save_stack+0x40/0x70 mm/kasan/common.c:45 __kasan_record_aux_stack+0xcc/0xe8 mm/kasan/generic.c:486 kasan_record_aux_stack_noalloc+0x14/0x20 mm/kasan/generic.c:496 call_rcu+0xfc/0xa40 kernel/rcu/tree.c:2845 destroy_inode fs/inode.c:316 [inline] evict+0x7ac/0x894 fs/inode.c:720 iput_final fs/inode.c:1834 [inline] iput+0x7c0/0x8a4 fs/inode.c:1860 __sock_release net/socket.c:666 [inline] sock_release+0x110/0x140 net/socket.c:682 udp_tunnel_sock_release+0x74/0x88 net/ipv4/udp_tunnel_core.c:181 cleanup_bearer+0x180/0x294 net/tipc/udp_media.c:822 process_one_work+0x7ac/0x1404 kernel/workqueue.c:2292 worker_thread+0x8e4/0xfec kernel/workqueue.c:2439 kthread+0x250/0x2d8 kernel/kthread.c:376 ret_from_fork+0x10/0x20 arch/arm64/kernel/entry.S:864 Second to last potentially related work creation: kasan_save_stack+0x40/0x70 mm/kasan/common.c:45 __kasan_record_aux_stack+0xcc/0xe8 mm/kasan/generic.c:486 kasan_record_aux_stack_noalloc+0x14/0x20 mm/kasan/generic.c:496 call_rcu+0xfc/0xa40 kernel/rcu/tree.c:2845 destroy_inode fs/inode.c:316 [inline] evict+0x7ac/0x894 fs/inode.c:720 iput_final fs/inode.c:1834 [inline] iput+0x7c0/0x8a4 fs/inode.c:1860 dentry_unlink_inode+0x37c/0x4bc fs/dcache.c:405 __dentry_kill+0x324/0x5e4 fs/dcache.c:611 dentry_kill+0xc8/0x250 dput+0x218/0x454 fs/dcache.c:918 __fput+0x488/0x7c8 fs/file_table.c:328 ____fput+0x20/0x30 fs/file_table.c:348 task_work_run+0x240/0x2f0 kernel/task_work.c:203 resume_user_mode_work include/linux/resume_user_mode.h:49 [inline] do_notify_resume+0x2080/0x2cb8 arch/arm64/kernel/signal.c:1132 prepare_exit_to_user_mode arch/arm64/kernel/entry-common.c:137 [inline] exit_to_user_mode arch/arm64/kernel/entry-common.c:142 [inline] el0_svc+0x9c/0x168 arch/arm64/kernel/entry-common.c:638 el0t_64_sync_handler+0x84/0xf0 arch/arm64/kernel/entry-common.c:655 el0t_64_sync+0x18c/0x190 arch/arm64/kernel/entry.S:585 The buggy address belongs to the object at ffff0000e2cd3600 which belongs to the cache sock_inode_cache of size 1408 The buggy address is located 24 bytes inside of 1408-byte region [ffff0000e2cd3600, ffff0000e2cd3b80) The buggy address belongs to the physical page: page:00000000261d2724 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x122cd0 head:00000000261d2724 order:3 compound_mapcount:0 compound_pincount:0 memcg:ffff0000cf925e01 flags: 0x5ffc00000010200(slab|head|node=0|zone=2|lastcpupid=0x7ff) raw: 05ffc00000010200 dead000000000100 dead000000000122 ffff0000c0b72900 raw: 0000000000000000 0000000000150015 00000001ffffffff ffff0000cf925e01 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff0000e2cd3500: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff0000e2cd3580: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc >ffff0000e2cd3600: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff0000e2cd3680: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff0000e2cd3700: 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 KASAN: null-ptr-deref in range [0x0000000000000030-0x0000000000000037] 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: 0 PID: 4975 Comm: kworker/0:10 Tainted: G B W 6.1.120-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 09/13/2024 Workqueue: events cleanup_bearer pstate: 80400005 (Nzcv daif +PAN -UAO -TCO -DIT -SSBS BTYPE=--) pc : read_pnet include/net/net_namespace.h:369 [inline] pc : sock_net include/net/sock.h:647 [inline] pc : cleanup_bearer+0x1bc/0x294 net/tipc/udp_media.c:824 lr : cleanup_bearer+0x1b0/0x294 net/tipc/udp_media.c:824 sp : ffff800021757b00 x29: ffff800021757b00 x28: ffff0001b3cf9800 x27: ffff0000e719b898 x26: ffff0000e719b898 x25: dead000000000122 x24: dfff800000000000 x23: ffff0000d9720a00 x22: ffff0000d9720a40 x21: 1fffe0001ce33701 x20: 0000000000000030 x19: ffff0000e719b818 x18: 1fffe0003679c376 x17: ffff800015a7d000 x16: ffff800012328af4 x15: ffff800008973f9c x14: ffff800008973df4 x13: ffff800008975ccc x12: 0000000000000001 x11: 0000000000ff0100 x10: 0000000000000000 x9 : 0000000000000000 x8 : 0000000000000006 x7 : ffff800011e44ac4 x6 : ffff800008975ccc x5 : ffff0000cb5c36a8 x4 : ffff800021757140 x3 : ffff8000081a9738 x2 : 0000000000000001 x1 : 0000000000000000 x0 : 0000000000000001 Call trace: read_pnet include/net/net_namespace.h:369 [inline] sock_net include/net/sock.h:647 [inline] cleanup_bearer+0x1bc/0x294 net/tipc/udp_media.c:824 process_one_work+0x7ac/0x1404 kernel/workqueue.c:2292 worker_thread+0x8e4/0xfec kernel/workqueue.c:2439 kthread+0x250/0x2d8 kernel/kthread.c:376 ret_from_fork+0x10/0x20 arch/arm64/kernel/entry.S:864 Code: 97839264 f9400288 9100c114 d343fe88 (38786908) ---[ end trace 0000000000000000 ]--- ---------------- Code disassembly (best guess): 0: 97839264 bl 0xfffffffffe0e4990 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