================================================================== BUG: KASAN: slab-use-after-free in cleanup_bearer+0x368/0x390 net/tipc/udp_media.c:820 Read of size 8 at addr ffff888035a63c18 by task kworker/0:2/834 CPU: 0 UID: 0 PID: 834 Comm: kworker/0:2 Not tainted 6.13.0-rc2-syzkaller-00036-g231825b2e1ff #0 Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2~bpo12+1 04/01/2014 Workqueue: events cleanup_bearer __dump_stack lib/dump_stack.c:94 [inline] dump_stack_lvl+0x116/0x1f0 lib/dump_stack.c:120 print_address_description mm/kasan/report.c:378 [inline] print_report+0xc3/0x620 mm/kasan/report.c:489 cleanup_bearer+0x368/0x390 net/tipc/udp_media.c:820 process_scheduled_works kernel/workqueue.c:3310 [inline] worker_thread+0x6c8/0xf00 kernel/workqueue.c:3391 ret_from_fork+0x45/0x80 arch/x86/kernel/process.c:147 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:244 Allocated by task 8948: kasan_save_stack+0x33/0x60 mm/kasan/common.c:47 sock_alloc_inode+0x25/0x1c0 net/socket.c:307 alloc_inode+0x5d/0x230 fs/inode.c:336 sock_alloc+0x40/0x280 net/socket.c:615 __sock_create+0xc1/0x8d0 net/socket.c:1522 udp_sock_create include/net/udp_tunnel.h:62 [inline] tipc_udp_enable+0x954/0x10d0 net/tipc/udp_media.c:770 __tipc_nl_bearer_enable+0x32a/0x420 net/tipc/bearer.c:1047 tipc_nl_bearer_enable+0x21/0x40 net/tipc/bearer.c:1056 genl_family_rcv_msg net/netlink/genetlink.c:1195 [inline] genl_rcv_msg+0x565/0x800 net/netlink/genetlink.c:1210 genl_rcv+0x28/0x40 net/netlink/genetlink.c:1219 netlink_unicast_kernel net/netlink/af_netlink.c:1321 [inline] netlink_unicast+0x53c/0x7f0 net/netlink/af_netlink.c:1347 netlink_sendmsg+0x8b8/0xd70 net/netlink/af_netlink.c:1891 sock_sendmsg_nosec net/socket.c:711 [inline] __sock_sendmsg net/socket.c:726 [inline] ____sys_sendmsg+0xaaf/0xc90 net/socket.c:2583 ___sys_sendmsg+0x135/0x1e0 net/socket.c:2637 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xcd/0x250 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x77/0x7f Freed by task 68: kasan_save_free_info+0x3b/0x60 mm/kasan/generic.c:582 poison_slab_object mm/kasan/common.c:247 [inline] __kasan_slab_free+0x51/0x70 mm/kasan/common.c:264 kasan_slab_free include/linux/kasan.h:233 [inline] slab_free_hook mm/slub.c:2338 [inline] slab_free mm/slub.c:4598 [inline] kmem_cache_free+0x152/0x4c0 mm/slub.c:4700 i_callback+0x43/0x70 fs/inode.c:325 handle_softirqs+0x213/0x8f0 kernel/softirq.c:561 irq_exit_rcu+0x9/0x30 kernel/softirq.c:678 instr_sysvec_apic_timer_interrupt arch/x86/kernel/apic/apic.c:1049 [inline] sysvec_apic_timer_interrupt+0xa4/0xc0 arch/x86/kernel/apic/apic.c:1049 asm_sysvec_apic_timer_interrupt+0x1a/0x20 arch/x86/include/asm/idtentry.h:702 kasan_save_stack+0x33/0x60 mm/kasan/common.c:47 __kasan_record_aux_stack+0xba/0xd0 mm/kasan/generic.c:544 __call_rcu_common.constprop.0+0x99/0x7a0 kernel/rcu/tree.c:3086 evict+0x5ed/0x960 fs/inode.c:827 cleanup_bearer+0x1d7/0x390 net/tipc/udp_media.c:818 The buggy address belongs to the object at ffff888035a63c00 which belongs to the cache sock_inode_cache of size 1408 The buggy address is located 24 bytes inside of freed 1408-byte region [ffff888035a63c00, ffff888035a64180) head: order:3 mapcount:0 entire_mapcount:0 nr_pages_mapped:0 pincount:0 flags: 0xfff00000000240(workingset|head|node=0|zone=1|lastcpupid=0x7ff) page_type: f5(slab) head: 00fff00000000240 ffff888100afac80 ffffea0000d69210 ffffea0000d6ac10 head: 00fff00000000003 ffffea0000d69801 ffffffffffffffff 0000000000000000 head: 0000000000000008 0000000000000000 00000000ffffffff 0000000000000000 page dumped because: kasan: bad access detected set_page_owner include/linux/page_owner.h:32 [inline] post_alloc_hook+0x2d1/0x350 mm/page_alloc.c:1556 __alloc_pages_noprof+0x223/0x25b0 mm/page_alloc.c:4751 alloc_slab_page mm/slub.c:2408 [inline] allocate_slab mm/slub.c:2574 [inline] new_slab+0x2c9/0x410 mm/slub.c:2627 ___slab_alloc+0xdac/0x1870 mm/slub.c:3815 __slab_alloc.constprop.0+0x56/0xb0 mm/slub.c:3905 __sock_create+0xc1/0x8d0 net/socket.c:1522 sock_create net/socket.c:1616 [inline] __sys_socket_create net/socket.c:1653 [inline] __sys_socket+0x14f/0x260 net/socket.c:1700 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xcd/0x250 arch/x86/entry/common.c:83 page last free pid 7527 tgid 7527 stack trace: reset_page_owner include/linux/page_owner.h:25 [inline] free_pages_prepare mm/page_alloc.c:1127 [inline] free_unref_page+0x661/0x1080 mm/page_alloc.c:2657 __put_partials+0x14c/0x170 mm/slub.c:3142 kasan_quarantine_reduce+0x195/0x1e0 mm/kasan/quarantine.c:286 __kasan_slab_alloc+0x69/0x90 mm/kasan/common.c:329 vm_area_dup+0x21/0x2f0 kernel/fork.c:487 __split_vma+0x181/0x1160 mm/vma.c:434 vms_gather_munmap_vmas+0x1c3/0x1730 mm/vma.c:1267 __mmap_prepare mm/vma.c:2241 [inline] __mmap_region+0x31d/0x2670 mm/vma.c:2443 do_mmap+0xc00/0xfc0 mm/mmap.c:496 Memory state around the buggy address: ffff888035a63b00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff888035a63c00: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff888035a63c80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff888035a63d00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb