================================================================== BUG: KASAN: slab-out-of-bounds in consumer_filter kernel/events/uprobes.c:869 [inline] BUG: KASAN: slab-out-of-bounds in filter_chain+0xf6/0x110 kernel/events/uprobes.c:880 Read of size 8 at addr ffff8880239b34b0 by task syz.2.3185/15700 CPU: 0 PID: 15700 Comm: syz.2.3185 Not tainted 6.10.0-syzkaller-04472-g51835949dda3 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 06/07/2024 Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0x116/0x1f0 lib/dump_stack.c:114 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 consumer_filter kernel/events/uprobes.c:869 [inline] filter_chain+0xf6/0x110 kernel/events/uprobes.c:880 uprobe_mmap+0x46b/0x1240 kernel/events/uprobes.c:1387 mmap_region+0x1228/0x2760 mm/mmap.c:2987 do_mmap+0xbc7/0xf60 mm/mmap.c:1397 vm_mmap_pgoff+0x1ba/0x360 mm/util.c:578 ksys_mmap_pgoff+0x332/0x5d0 mm/mmap.c:1443 __do_sys_mmap arch/x86/kernel/sys_x86_64.c:86 [inline] __se_sys_mmap arch/x86/kernel/sys_x86_64.c:79 [inline] __x64_sys_mmap+0x125/0x190 arch/x86/kernel/sys_x86_64.c:79 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:0x7f7451575a99 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:00007f7450fff048 EFLAGS: 00000246 ORIG_RAX: 0000000000000009 RAX: ffffffffffffffda RBX: 00007f7451703f60 RCX: 00007f7451575a99 RDX: 0000000000000001 RSI: 0000000000003000 RDI: 0000000020000000 RBP: 00007f74515e4e5d R08: 0000000000000004 R09: 0000000000000000 R10: 0000000000000012 R11: 0000000000000246 R12: 0000000000000000 R13: 000000000000000b R14: 00007f7451703f60 R15: 00007ffd6c994378 Allocated by task 15467: 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:370 [inline] __kasan_kmalloc+0xaa/0xb0 mm/kasan/common.c:387 kmalloc_noprof include/linux/slab.h:660 [inline] kzalloc_noprof include/linux/slab.h:778 [inline] mpls_add_dev net/mpls/af_mpls.c:1444 [inline] mpls_dev_notify+0x33d/0xa10 net/mpls/af_mpls.c:1601 notifier_call_chain+0xb9/0x410 kernel/notifier.c:93 call_netdevice_notifiers_info+0xbe/0x140 net/core/dev.c:1994 call_netdevice_notifiers_extack net/core/dev.c:2032 [inline] call_netdevice_notifiers net/core/dev.c:2046 [inline] register_netdevice+0x17a0/0x1e90 net/core/dev.c:10468 nsim_init_netdevsim drivers/net/netdevsim/netdev.c:690 [inline] nsim_create+0x740/0xb20 drivers/net/netdevsim/netdev.c:750 __nsim_dev_port_add+0x42c/0x7d0 drivers/net/netdevsim/dev.c:1390 nsim_dev_port_add_all drivers/net/netdevsim/dev.c:1446 [inline] nsim_drv_probe+0xdbf/0x1490 drivers/net/netdevsim/dev.c:1604 call_driver_probe drivers/base/dd.c:578 [inline] really_probe+0x23e/0xa90 drivers/base/dd.c:656 __driver_probe_device+0x1de/0x440 drivers/base/dd.c:798 driver_probe_device+0x4c/0x1b0 drivers/base/dd.c:828 __device_attach_driver+0x1df/0x310 drivers/base/dd.c:956 bus_for_each_drv+0x157/0x1e0 drivers/base/bus.c:457 __device_attach+0x1e8/0x4b0 drivers/base/dd.c:1028 bus_probe_device+0x17f/0x1c0 drivers/base/bus.c:532 device_add+0x114b/0x1a70 drivers/base/core.c:3679 nsim_bus_dev_new drivers/net/netdevsim/bus.c:442 [inline] new_device_store+0x41d/0x730 drivers/net/netdevsim/bus.c:173 bus_attr_store+0x76/0xa0 drivers/base/bus.c:170 sysfs_kf_write+0x117/0x170 fs/sysfs/file.c:136 kernfs_fop_write_iter+0x343/0x500 fs/kernfs/file.c:334 new_sync_write fs/read_write.c:497 [inline] vfs_write+0x6b6/0x1140 fs/read_write.c:590 ksys_write+0x12f/0x260 fs/read_write.c:643 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 ffff8880239b3480 which belongs to the cache kmalloc-64 of size 64 The buggy address is located 0 bytes to the right of allocated 48-byte region [ffff8880239b3480, ffff8880239b34b0) The buggy address belongs to the physical page: page: refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x239b3 flags: 0xfff00000000000(node=0|zone=1|lastcpupid=0x7ff) page_type: 0xffffefff(slab) raw: 00fff00000000000 ffff8880154418c0 ffffea0000b94f80 dead000000000006 raw: 0000000000000000 0000000000200020 00000001ffffefff 0000000000000000 page dumped because: kasan: bad access detected page_owner tracks the page as allocated page last allocated via order 0, migratetype Unmovable, gfp_mask 0x52c40(GFP_NOFS|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP), pid 4539, tgid 4539 (udevd), ts 62977124961, free_ts 62909068815 set_page_owner include/linux/page_owner.h:32 [inline] post_alloc_hook+0x2d1/0x350 mm/page_alloc.c:1473 prep_new_page mm/page_alloc.c:1481 [inline] get_page_from_freelist+0x1353/0x2e50 mm/page_alloc.c:3425 __alloc_pages_noprof+0x22b/0x2460 mm/page_alloc.c:4683 __alloc_pages_node_noprof include/linux/gfp.h:269 [inline] alloc_pages_node_noprof include/linux/gfp.h:296 [inline] alloc_slab_page+0x56/0x110 mm/slub.c:2265 allocate_slab mm/slub.c:2428 [inline] new_slab+0x84/0x260 mm/slub.c:2481 ___slab_alloc+0xdac/0x1870 mm/slub.c:3667 __slab_alloc.constprop.0+0x56/0xb0 mm/slub.c:3757 __slab_alloc_node mm/slub.c:3810 [inline] slab_alloc_node mm/slub.c:3990 [inline] __do_kmalloc_node mm/slub.c:4122 [inline] __kmalloc_noprof+0x36d/0x410 mm/slub.c:4136 kmalloc_noprof include/linux/slab.h:664 [inline] kzalloc_noprof include/linux/slab.h:778 [inline] tomoyo_encode2+0x100/0x3e0 security/tomoyo/realpath.c:45 tomoyo_encode+0x29/0x50 security/tomoyo/realpath.c:80 tomoyo_realpath_from_path+0x19d/0x720 security/tomoyo/realpath.c:283 tomoyo_get_realpath security/tomoyo/file.c:151 [inline] tomoyo_path_perm+0x273/0x450 security/tomoyo/file.c:822 security_inode_getattr+0xf4/0x160 security/security.c:2269 vfs_getattr fs/stat.c:204 [inline] vfs_fstat+0x53/0xd0 fs/stat.c:229 vfs_fstatat+0x146/0x160 fs/stat.c:338 __do_sys_newfstatat+0xa2/0x130 fs/stat.c:505 page last free pid 4547 tgid 4547 stack trace: reset_page_owner include/linux/page_owner.h:25 [inline] free_pages_prepare mm/page_alloc.c:1093 [inline] free_unref_page+0x64a/0xe40 mm/page_alloc.c:2588 qlink_free mm/kasan/quarantine.c:163 [inline] qlist_free_all+0x4e/0x140 mm/kasan/quarantine.c:179 kasan_quarantine_reduce+0x192/0x1e0 mm/kasan/quarantine.c:286 __kasan_slab_alloc+0x69/0x90 mm/kasan/common.c:322 kasan_slab_alloc include/linux/kasan.h:201 [inline] slab_post_alloc_hook mm/slub.c:3940 [inline] slab_alloc_node mm/slub.c:4002 [inline] kmem_cache_alloc_noprof+0x121/0x2f0 mm/slub.c:4009 getname_flags.part.0+0x4c/0x550 fs/namei.c:139 getname_flags+0x93/0xf0 include/linux/audit.h:322 do_readlinkat+0xb5/0x390 fs/stat.c:536 __do_sys_readlink fs/stat.c:574 [inline] __se_sys_readlink fs/stat.c:571 [inline] __x64_sys_readlink+0x78/0xc0 fs/stat.c:571 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 Memory state around the buggy address: ffff8880239b3380: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc ffff8880239b3400: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc >ffff8880239b3480: 00 00 00 00 00 00 fc fc fc fc fc fc fc fc fc fc ^ ffff8880239b3500: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc ffff8880239b3580: 00 00 00 00 00 00 00 00 fc fc fc fc fc fc fc fc ==================================================================