================================================================== BUG: KASAN: slab-use-after-free in rose_get_neigh+0x549/0x640 net/rose/rose_route.c:692 Read of size 1 at addr ffff88807f539830 by task syz.5.579/8487 CPU: 1 UID: 0 PID: 8487 Comm: syz.5.579 Not tainted 6.12.0-syzkaller-00971-g158f238aa69d #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 10/30/2024 Call Trace: __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:377 [inline] print_report+0xc3/0x620 mm/kasan/report.c:488 kasan_report+0xd9/0x110 mm/kasan/report.c:601 rose_get_neigh+0x549/0x640 net/rose/rose_route.c:692 rose_connect+0x2d2/0x14e0 net/rose/af_rose.c:808 __sys_connect_file+0x13e/0x1a0 net/socket.c:2053 __sys_connect+0x14f/0x170 net/socket.c:2072 __do_sys_connect net/socket.c:2078 [inline] __se_sys_connect net/socket.c:2075 [inline] __x64_sys_connect+0x72/0xb0 net/socket.c:2075 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 RIP: 0033:0x7f741877e759 Code: ff ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 40 00 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 c7 c1 a8 ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007f7416bd5038 EFLAGS: 00000246 ORIG_RAX: 000000000000002a RAX: ffffffffffffffda RBX: 00007f7418936130 RCX: 00007f741877e759 RDX: 000000000000001c RSI: 0000000020000200 RDI: 0000000000000007 RBP: 00007f74187f175e R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 0000000000000000 R14: 00007f7418936130 R15: 00007fff7e7f8a28 Allocated by task 7433: kasan_save_stack+0x33/0x60 mm/kasan/common.c:47 kasan_save_track+0x14/0x30 mm/kasan/common.c:68 poison_kmalloc_redzone mm/kasan/common.c:377 [inline] __kasan_kmalloc+0xaa/0xb0 mm/kasan/common.c:394 kmalloc_noprof include/linux/slab.h:878 [inline] rose_add_node net/rose/rose_route.c:85 [inline] rose_rt_ioctl+0x8a0/0x1dc0 net/rose/rose_route.c:747 rose_ioctl+0x64f/0x7d0 net/rose/af_rose.c:1372 sock_do_ioctl+0x116/0x280 net/socket.c:1209 sock_ioctl+0x228/0x6c0 net/socket.c:1328 vfs_ioctl fs/ioctl.c:51 [inline] __do_sys_ioctl fs/ioctl.c:906 [inline] __se_sys_ioctl fs/ioctl.c:892 [inline] __x64_sys_ioctl+0x190/0x200 fs/ioctl.c:892 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 8377: kasan_save_stack+0x33/0x60 mm/kasan/common.c:47 kasan_save_track+0x14/0x30 mm/kasan/common.c:68 kasan_save_free_info+0x3b/0x60 mm/kasan/generic.c:579 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:230 [inline] slab_free_hook mm/slub.c:2342 [inline] slab_free mm/slub.c:4579 [inline] kfree+0x14f/0x4b0 mm/slub.c:4727 rose_remove_neigh+0x25e/0x370 net/rose/rose_route.c:240 rose_rt_device_down+0x2eb/0x3d0 net/rose/rose_route.c:522 rose_device_event+0xfc/0x120 net/rose/af_rose.c:248 notifier_call_chain+0xb9/0x410 kernel/notifier.c:93 call_netdevice_notifiers_info+0xbe/0x140 net/core/dev.c:1996 call_netdevice_notifiers_extack net/core/dev.c:2034 [inline] call_netdevice_notifiers net/core/dev.c:2048 [inline] dev_close_many+0x333/0x6a0 net/core/dev.c:1589 dev_close net/core/dev.c:1611 [inline] dev_close+0x181/0x230 net/core/dev.c:1605 bpq_device_event+0x820/0xaf0 drivers/net/hamradio/bpqether.c:547 notifier_call_chain+0xb9/0x410 kernel/notifier.c:93 call_netdevice_notifiers_info+0xbe/0x140 net/core/dev.c:1996 call_netdevice_notifiers_extack net/core/dev.c:2034 [inline] call_netdevice_notifiers net/core/dev.c:2048 [inline] __dev_notify_flags+0x1f9/0x2e0 net/core/dev.c:8886 dev_change_flags+0x10c/0x160 net/core/dev.c:8922 dev_ifsioc+0x9c8/0x10b0 net/core/dev_ioctl.c:526 dev_ioctl+0x224/0x10c0 net/core/dev_ioctl.c:783 sock_do_ioctl+0x19e/0x280 net/socket.c:1223 sock_ioctl+0x228/0x6c0 net/socket.c:1328 vfs_ioctl fs/ioctl.c:51 [inline] __do_sys_ioctl fs/ioctl.c:906 [inline] __se_sys_ioctl fs/ioctl.c:892 [inline] __x64_sys_ioctl+0x190/0x200 fs/ioctl.c:892 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 The buggy address belongs to the object at ffff88807f539800 which belongs to the cache kmalloc-512 of size 512 The buggy address is located 48 bytes inside of freed 512-byte region [ffff88807f539800, ffff88807f539a00) The buggy address belongs to the physical page: page: refcount:1 mapcount:0 mapping:0000000000000000 index:0xffff88807f53bc00 pfn:0x7f538 head: order:2 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) raw: 00fff00000000240 ffff88801b041c80 ffffea0000c7b210 ffffea0000ce4810 raw: ffff88807f53bc00 0000000000100007 00000001f5000000 0000000000000000 head: 00fff00000000240 ffff88801b041c80 ffffea0000c7b210 ffffea0000ce4810 head: ffff88807f53bc00 0000000000100007 00000001f5000000 0000000000000000 head: 00fff00000000002 ffffea0001fd4e01 ffffffffffffffff 0000000000000000 head: 0000000000000004 0000000000000000 00000000ffffffff 0000000000000000 page dumped because: kasan: bad access detected page_owner tracks the page as allocated page last allocated via order 2, migratetype Unmovable, gfp_mask 0xd20c0(__GFP_IO|__GFP_FS|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC), pid 5832, tgid 5832 (syz-executor), ts 54527813650, free_ts 54471449345 set_page_owner include/linux/page_owner.h:32 [inline] post_alloc_hook+0x2d1/0x350 mm/page_alloc.c:1556 prep_new_page mm/page_alloc.c:1564 [inline] get_page_from_freelist+0xfce/0x2f80 mm/page_alloc.c:3474 __alloc_pages_noprof+0x223/0x25a0 mm/page_alloc.c:4751 alloc_pages_mpol_noprof+0x2c9/0x610 mm/mempolicy.c:2265 alloc_slab_page mm/slub.c:2412 [inline] allocate_slab mm/slub.c:2578 [inline] new_slab+0x2c9/0x410 mm/slub.c:2631 ___slab_alloc+0xdac/0x1880 mm/slub.c:3818 __slab_alloc.constprop.0+0x56/0xb0 mm/slub.c:3908 __slab_alloc_node mm/slub.c:3961 [inline] slab_alloc_node mm/slub.c:4122 [inline] __do_kmalloc_node mm/slub.c:4263 [inline] __kmalloc_noprof+0x367/0x400 mm/slub.c:4276 kmalloc_noprof include/linux/slab.h:882 [inline] kzalloc_noprof include/linux/slab.h:1014 [inline] fib6_info_alloc+0x40/0x160 net/ipv6/ip6_fib.c:155 ip6_route_info_create+0x337/0x1910 net/ipv6/route.c:3761 ip6_route_add+0x26/0x1c0 net/ipv6/route.c:3853 addrconf_prefix_route+0x2fe/0x510 net/ipv6/addrconf.c:2486 add_v4_addrs+0x6ce/0x9f0 net/ipv6/addrconf.c:3271 addrconf_gre_config net/ipv6/addrconf.c:3546 [inline] addrconf_init_auto_addrs+0x18a/0x820 net/ipv6/addrconf.c:3564 addrconf_notify+0xe91/0x19c0 net/ipv6/addrconf.c:3745 notifier_call_chain+0xb9/0x410 kernel/notifier.c:93 page last free pid 5880 tgid 5880 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:3145 qlink_free mm/kasan/quarantine.c:163 [inline] qlist_free_all+0x4e/0x120 mm/kasan/quarantine.c:179 kasan_quarantine_reduce+0x192/0x1e0 mm/kasan/quarantine.c:286 __kasan_slab_alloc+0x69/0x90 mm/kasan/common.c:329 kasan_slab_alloc include/linux/kasan.h:247 [inline] slab_post_alloc_hook mm/slub.c:4085 [inline] slab_alloc_node mm/slub.c:4134 [inline] kmem_cache_alloc_noprof+0x121/0x2f0 mm/slub.c:4141 mt_alloc_one lib/maple_tree.c:162 [inline] mas_alloc_nodes+0x176/0x860 lib/maple_tree.c:1241 mas_node_count_gfp+0x105/0x130 lib/maple_tree.c:1321 mas_preallocate+0x53b/0xcd0 lib/maple_tree.c:5546 vma_iter_prealloc mm/vma.h:438 [inline] __split_vma+0x474/0x1160 mm/vma.c:396 vms_gather_munmap_vmas+0x38f/0x1750 mm/vma.c:1230 __mmap_region+0x36c/0x21c0 mm/mmap.c:1386 mmap_region+0x127/0x320 mm/mmap.c:1603 do_mmap+0xc00/0xfc0 mm/mmap.c:496 vm_mmap_pgoff+0x1ba/0x360 mm/util.c:588 ksys_mmap_pgoff+0x32c/0x5c0 mm/mmap.c:542 Memory state around the buggy address: ffff88807f539700: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff88807f539780: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc >ffff88807f539800: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff88807f539880: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff88807f539900: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================