================================================================== BUG: KASAN: slab-use-after-free in rose_get_neigh+0x1b6/0x6f0 net/rose/rose_route.c:692 Read of size 1 at addr ffff888062b0fc30 by task syz.3.7241/28106 CPU: 1 UID: 0 PID: 28106 Comm: syz.3.7241 Not tainted 6.11.0-syzkaller-01458-g9410645520e9 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 08/06/2024 Call Trace: __dump_stack lib/dump_stack.c:93 [inline] dump_stack_lvl+0x241/0x360 lib/dump_stack.c:119 print_address_description mm/kasan/report.c:377 [inline] print_report+0x169/0x550 mm/kasan/report.c:488 kasan_report+0x143/0x180 mm/kasan/report.c:601 rose_get_neigh+0x1b6/0x6f0 net/rose/rose_route.c:692 rose_connect+0x45a/0x1170 net/rose/af_rose.c:808 __sys_connect_file net/socket.c:2067 [inline] __sys_connect+0x2df/0x310 net/socket.c:2084 __do_sys_connect net/socket.c:2094 [inline] __se_sys_connect net/socket.c:2091 [inline] __x64_sys_connect+0x7a/0x90 net/socket.c:2091 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xf3/0x230 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x77/0x7f RIP: 0033:0x7fca8877def9 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:00007fca89619038 EFLAGS: 00000246 ORIG_RAX: 000000000000002a RAX: ffffffffffffffda RBX: 00007fca88935f80 RCX: 00007fca8877def9 RDX: 000000000000001c RSI: 00000000200003c0 RDI: 0000000000000008 RBP: 00007fca887f0b76 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 0000000000000000 R14: 00007fca88935f80 R15: 00007ffddd319078 Allocated by task 12127: kasan_save_stack mm/kasan/common.c:47 [inline] kasan_save_track+0x3f/0x80 mm/kasan/common.c:68 poison_kmalloc_redzone mm/kasan/common.c:370 [inline] __kasan_kmalloc+0x98/0xb0 mm/kasan/common.c:387 kasan_kmalloc include/linux/kasan.h:211 [inline] __kmalloc_cache_noprof+0x19c/0x2c0 mm/slub.c:4193 kmalloc_noprof include/linux/slab.h:681 [inline] rose_add_node+0x209/0xda0 net/rose/rose_route.c:85 rose_rt_ioctl+0xa6f/0xed0 net/rose/rose_route.c:747 rose_ioctl+0x3cb/0x9d0 net/rose/af_rose.c:1372 sock_do_ioctl+0x158/0x460 net/socket.c:1228 sock_ioctl+0x629/0x8e0 net/socket.c:1347 vfs_ioctl fs/ioctl.c:51 [inline] __do_sys_ioctl fs/ioctl.c:907 [inline] __se_sys_ioctl+0xfc/0x170 fs/ioctl.c:893 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xf3/0x230 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x77/0x7f Freed by task 27728: kasan_save_stack mm/kasan/common.c:47 [inline] kasan_save_track+0x3f/0x80 mm/kasan/common.c:68 kasan_save_free_info+0x40/0x50 mm/kasan/generic.c:579 poison_slab_object+0xe0/0x150 mm/kasan/common.c:240 __kasan_slab_free+0x37/0x60 mm/kasan/common.c:256 kasan_slab_free include/linux/kasan.h:184 [inline] slab_free_hook mm/slub.c:2256 [inline] slab_free mm/slub.c:4477 [inline] kfree+0x149/0x360 mm/slub.c:4598 rose_rt_device_down+0x6e5/0x740 net/rose/rose_route.c:522 rose_device_event+0x604/0x6a0 net/rose/af_rose.c:248 notifier_call_chain+0x19f/0x3e0 kernel/notifier.c:93 __dev_notify_flags+0x207/0x400 dev_change_flags+0xf0/0x1a0 net/core/dev.c:8914 dev_ifsioc+0x7c8/0xe70 net/core/dev_ioctl.c:526 dev_ioctl+0x719/0x1340 net/core/dev_ioctl.c:783 sock_do_ioctl+0x240/0x460 net/socket.c:1242 sock_ioctl+0x629/0x8e0 net/socket.c:1347 vfs_ioctl fs/ioctl.c:51 [inline] __do_sys_ioctl fs/ioctl.c:907 [inline] __se_sys_ioctl+0xfc/0x170 fs/ioctl.c:893 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xf3/0x230 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x77/0x7f The buggy address belongs to the object at ffff888062b0fc00 which belongs to the cache kmalloc-512 of size 512 The buggy address is located 48 bytes inside of freed 512-byte region [ffff888062b0fc00, ffff888062b0fe00) The buggy address belongs to the physical page: page: refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x62b0c head: order:2 mapcount:0 entire_mapcount:0 nr_pages_mapped:0 pincount:0 flags: 0xfff00000000040(head|node=0|zone=1|lastcpupid=0x7ff) page_type: 0xfdffffff(slab) raw: 00fff00000000040 ffff88801ac41c80 dead000000000100 dead000000000122 raw: 0000000000000000 0000000000100010 00000001fdffffff 0000000000000000 head: 00fff00000000040 ffff88801ac41c80 dead000000000100 dead000000000122 head: 0000000000000000 0000000000100010 00000001fdffffff 0000000000000000 head: 00fff00000000002 ffffea00018ac301 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 4686, tgid 4686 (udevd), ts 80702050887, free_ts 80624634168 set_page_owner include/linux/page_owner.h:32 [inline] post_alloc_hook+0x1f3/0x230 mm/page_alloc.c:1500 prep_new_page mm/page_alloc.c:1508 [inline] get_page_from_freelist+0x2e4c/0x2f10 mm/page_alloc.c:3446 __alloc_pages_noprof+0x256/0x6c0 mm/page_alloc.c:4702 __alloc_pages_node_noprof include/linux/gfp.h:269 [inline] alloc_pages_node_noprof include/linux/gfp.h:296 [inline] alloc_slab_page+0x5f/0x120 mm/slub.c:2325 allocate_slab+0x5a/0x2f0 mm/slub.c:2488 new_slab mm/slub.c:2541 [inline] ___slab_alloc+0xcd1/0x14b0 mm/slub.c:3727 __slab_alloc+0x58/0xa0 mm/slub.c:3817 __slab_alloc_node mm/slub.c:3870 [inline] slab_alloc_node mm/slub.c:4029 [inline] __kmalloc_cache_noprof+0x1d5/0x2c0 mm/slub.c:4188 kmalloc_noprof include/linux/slab.h:681 [inline] kzalloc_noprof include/linux/slab.h:807 [inline] kernfs_fop_open+0x3e0/0xd10 fs/kernfs/file.c:623 do_dentry_open+0x970/0x1440 fs/open.c:959 vfs_open+0x3e/0x330 fs/open.c:1089 do_open fs/namei.c:3727 [inline] path_openat+0x2b3e/0x3470 fs/namei.c:3886 do_filp_open+0x235/0x490 fs/namei.c:3913 do_sys_openat2+0x13e/0x1d0 fs/open.c:1416 do_sys_open fs/open.c:1431 [inline] __do_sys_openat fs/open.c:1447 [inline] __se_sys_openat fs/open.c:1442 [inline] __x64_sys_openat+0x247/0x2a0 fs/open.c:1442 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xf3/0x230 arch/x86/entry/common.c:83 page last free pid 5237 tgid 5237 stack trace: reset_page_owner include/linux/page_owner.h:25 [inline] free_pages_prepare mm/page_alloc.c:1101 [inline] free_unref_page+0xd22/0xea0 mm/page_alloc.c:2619 __slab_free+0x31b/0x3d0 mm/slub.c:4388 qlink_free mm/kasan/quarantine.c:163 [inline] qlist_free_all+0x9e/0x140 mm/kasan/quarantine.c:179 kasan_quarantine_reduce+0x14f/0x170 mm/kasan/quarantine.c:286 __kasan_slab_alloc+0x23/0x80 mm/kasan/common.c:322 kasan_slab_alloc include/linux/kasan.h:201 [inline] slab_post_alloc_hook mm/slub.c:3992 [inline] slab_alloc_node mm/slub.c:4041 [inline] __kmalloc_cache_noprof+0x132/0x2c0 mm/slub.c:4188 kmalloc_noprof include/linux/slab.h:681 [inline] netdevice_queue_work drivers/infiniband/core/roce_gid_mgmt.c:642 [inline] netdevice_event+0x37d/0x950 drivers/infiniband/core/roce_gid_mgmt.c:801 notifier_call_chain+0x19f/0x3e0 kernel/notifier.c:93 __dev_notify_flags+0x207/0x400 dev_change_flags+0xf0/0x1a0 net/core/dev.c:8914 do_setlink+0xcd0/0x41f0 net/core/rtnetlink.c:2900 __rtnl_newlink net/core/rtnetlink.c:3696 [inline] rtnl_newlink+0x180d/0x20a0 net/core/rtnetlink.c:3743 rtnetlink_rcv_msg+0x73f/0xcf0 net/core/rtnetlink.c:6646 netlink_rcv_skb+0x1e3/0x430 net/netlink/af_netlink.c:2550 netlink_unicast_kernel net/netlink/af_netlink.c:1331 [inline] netlink_unicast+0x7f6/0x990 net/netlink/af_netlink.c:1357 netlink_sendmsg+0x8e4/0xcb0 net/netlink/af_netlink.c:1901 Memory state around the buggy address: ffff888062b0fb00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff888062b0fb80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc >ffff888062b0fc00: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff888062b0fc80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff888062b0fd00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================