================================================================== BUG: KASAN: slab-out-of-bounds in __rb_map_vma+0x9ab/0xae0 kernel/trace/ring_buffer.c:7058 Read of size 8 at addr ffff88805633d638 by task syz.0.4478/23734 CPU: 1 UID: 8 PID: 23734 Comm: syz.0.4478 Not tainted 6.13.0-rc3-syzkaller-00026-g59dbb9d81adf #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 11/25/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:378 [inline] print_report+0xc3/0x620 mm/kasan/report.c:489 kasan_report+0xd9/0x110 mm/kasan/report.c:602 __rb_map_vma+0x9ab/0xae0 kernel/trace/ring_buffer.c:7058 ring_buffer_map+0x56e/0x9b0 kernel/trace/ring_buffer.c:7138 tracing_buffers_mmap+0xa6/0x120 kernel/trace/trace.c:8482 call_mmap include/linux/fs.h:2183 [inline] mmap_file mm/internal.h:124 [inline] __mmap_new_file_vma mm/vma.c:2291 [inline] __mmap_new_vma mm/vma.c:2355 [inline] __mmap_region+0x1786/0x2670 mm/vma.c:2456 mmap_region+0x127/0x320 mm/mmap.c:1348 do_mmap+0xc00/0xfc0 mm/mmap.c:496 vm_mmap_pgoff+0x1ba/0x360 mm/util.c:580 ksys_mmap_pgoff+0x32c/0x5c0 mm/mmap.c:542 __do_sys_mmap arch/x86/kernel/sys_x86_64.c:89 [inline] __se_sys_mmap arch/x86/kernel/sys_x86_64.c:82 [inline] __x64_sys_mmap+0x125/0x190 arch/x86/kernel/sys_x86_64.c:82 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:0x7f9feab85d29 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:00007f9feb98a038 EFLAGS: 00000246 ORIG_RAX: 0000000000000009 RAX: ffffffffffffffda RBX: 00007f9fead75fa0 RCX: 00007f9feab85d29 RDX: 0000000000000001 RSI: 0000000000002000 RDI: 0000000020ffb000 RBP: 00007f9feac01a20 R08: 0000000000000003 R09: 0000000000080000 R10: 000000000008e051 R11: 0000000000000246 R12: 0000000000000000 R13: 0000000000000000 R14: 00007f9fead75fa0 R15: 00007ffedb2038a8 Allocated by task 23733: 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 kasan_kmalloc include/linux/kasan.h:260 [inline] __do_kmalloc_node mm/slub.c:4298 [inline] __kmalloc_node_track_caller_noprof+0x21d/0x520 mm/slub.c:4317 kmemdup_noprof+0x29/0x60 mm/util.c:135 shmem_symlink+0x248/0x720 mm/shmem.c:3938 vfs_symlink fs/namei.c:4669 [inline] vfs_symlink+0x3e8/0x660 fs/namei.c:4653 do_symlinkat+0x263/0x310 fs/namei.c:4695 __do_sys_symlinkat fs/namei.c:4711 [inline] __se_sys_symlinkat fs/namei.c:4708 [inline] __x64_sys_symlinkat+0x93/0xc0 fs/namei.c:4708 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 ffff88805633d600 which belongs to the cache kmalloc-32 of size 32 The buggy address is located 36 bytes to the right of allocated 20-byte region [ffff88805633d600, ffff88805633d614) The buggy address belongs to the physical page: page: refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x5633d flags: 0xfff00000000000(node=0|zone=1|lastcpupid=0x7ff) page_type: f5(slab) raw: 00fff00000000000 ffff88801ac41780 ffffea0000badb80 dead000000000002 raw: 0000000000000000 0000000080400040 00000001f5000000 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 0x52800(GFP_NOWAIT|__GFP_NORETRY|__GFP_COMP), pid 21203, tgid 21202 (syz.0.3913), ts 1197200265561, free_ts 1197170397932 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/0x25b0 mm/page_alloc.c:4751 alloc_pages_mpol_noprof+0x2c9/0x610 mm/mempolicy.c:2269 alloc_slab_page mm/slub.c:2423 [inline] allocate_slab mm/slub.c:2589 [inline] new_slab+0x2c9/0x410 mm/slub.c:2642 ___slab_alloc+0xce2/0x1650 mm/slub.c:3830 __slab_alloc.constprop.0+0x56/0xb0 mm/slub.c:3920 __slab_alloc_node mm/slub.c:3995 [inline] slab_alloc_node mm/slub.c:4156 [inline] __kmalloc_cache_noprof+0xf6/0x420 mm/slub.c:4324 kmalloc_noprof include/linux/slab.h:901 [inline] slab_free_hook mm/slub.c:2305 [inline] slab_free mm/slub.c:4613 [inline] kmem_cache_free+0x2ef/0x4c0 mm/slub.c:4715 anon_vma_free mm/rmap.c:137 [inline] __put_anon_vma+0x114/0x3a0 mm/rmap.c:2568 put_anon_vma include/linux/rmap.h:116 [inline] unlink_anon_vmas+0x58a/0x820 mm/rmap.c:444 free_pgtables+0x33c/0x950 mm/memory.c:407 exit_mmap+0x3d7/0xb20 mm/mmap.c:1679 __mmput+0x12a/0x4c0 kernel/fork.c:1353 mmput+0x62/0x70 kernel/fork.c:1375 exit_mm kernel/exit.c:570 [inline] do_exit+0x9bf/0x2d70 kernel/exit.c:925 page last free pid 21197 tgid 21196 stack trace: reset_page_owner include/linux/page_owner.h:25 [inline] free_pages_prepare mm/page_alloc.c:1127 [inline] free_unref_folios+0xa7b/0x14f0 mm/page_alloc.c:2704 folios_put_refs+0x587/0x7b0 mm/swap.c:962 folio_batch_release include/linux/pagevec.h:101 [inline] truncate_inode_pages_range+0x313/0xea0 mm/truncate.c:330 kill_bdev block/bdev.c:91 [inline] blkdev_flush_mapping+0xfb/0x290 block/bdev.c:671 blkdev_put_whole+0xc4/0xf0 block/bdev.c:678 bdev_release+0x47e/0x6d0 block/bdev.c:1103 blkdev_release+0x15/0x20 block/fops.c:635 __fput+0x3f8/0xb60 fs/file_table.c:450 task_work_run+0x14e/0x250 kernel/task_work.c:239 resume_user_mode_work include/linux/resume_user_mode.h:50 [inline] exit_to_user_mode_loop kernel/entry/common.c:114 [inline] exit_to_user_mode_prepare include/linux/entry-common.h:329 [inline] __syscall_exit_to_user_mode_work kernel/entry/common.c:207 [inline] syscall_exit_to_user_mode+0x27b/0x2a0 kernel/entry/common.c:218 do_syscall_64+0xda/0x250 arch/x86/entry/common.c:89 entry_SYSCALL_64_after_hwframe+0x77/0x7f Memory state around the buggy address: ffff88805633d500: 00 00 00 00 fc fc fc fc fa fb fb fb fc fc fc fc ffff88805633d580: fa fb fb fb fc fc fc fc fa fb fb fb fc fc fc fc >ffff88805633d600: 00 00 04 fc fc fc fc fc fa fb fb fb fc fc fc fc ^ ffff88805633d680: fa fb fb fb fc fc fc fc fa fb fb fb fc fc fc fc ffff88805633d700: fa fb fb fb fc fc fc fc fa fb fb fb fc fc fc fc ==================================================================