================================================================== BUG: KASAN: slab-out-of-bounds in sysv_new_block+0x7a7/0xa50 fs/sysv/balloc.c:113 Read of size 4 at addr ffff888021a9c0c8 by task syz-executor.1/9555 CPU: 2 PID: 9555 Comm: syz-executor.1 Not tainted 6.9.0-syzkaller-12333-g54f71b0369c9 #0 Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.2-debian-1.16.2-1 04/01/2014 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 sysv_new_block+0x7a7/0xa50 fs/sysv/balloc.c:113 alloc_branch fs/sysv/itree.c:135 [inline] get_block+0x261/0x1570 fs/sysv/itree.c:254 __block_write_begin_int+0x4fb/0x16e0 fs/buffer.c:2128 __block_write_begin fs/buffer.c:2177 [inline] block_write_begin+0xb1/0x4a0 fs/buffer.c:2236 sysv_write_begin+0x31/0xe0 fs/sysv/itree.c:490 page_symlink+0x3b9/0x440 fs/namei.c:5236 sysv_symlink+0xd3/0x180 fs/sysv/namei.c:86 vfs_symlink fs/namei.c:4489 [inline] vfs_symlink+0x3e8/0x660 fs/namei.c:4473 do_symlinkat+0x263/0x310 fs/namei.c:4515 __do_sys_symlink fs/namei.c:4536 [inline] __se_sys_symlink fs/namei.c:4534 [inline] __x64_sys_symlink+0x79/0xa0 fs/namei.c:4534 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:0x7fa58987cee9 Code: 28 00 00 00 75 05 48 83 c4 28 c3 e8 e1 20 00 00 90 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 b0 ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007fa58a5db0c8 EFLAGS: 00000246 ORIG_RAX: 0000000000000058 RAX: ffffffffffffffda RBX: 00007fa5899abf80 RCX: 00007fa58987cee9 RDX: 0000000000000000 RSI: 0000000020000e40 RDI: 0000000020001640 RBP: 00007fa5898c949e R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 000000000000000b R14: 00007fa5899abf80 R15: 00007fff33ded118 Allocated by task 4912: kasan_save_stack+0x33/0x60 mm/kasan/common.c:47 kasan_save_track+0x14/0x30 mm/kasan/common.c:68 unpoison_slab_object mm/kasan/common.c:312 [inline] __kasan_slab_alloc+0x89/0x90 mm/kasan/common.c:338 kasan_slab_alloc include/linux/kasan.h:201 [inline] slab_post_alloc_hook mm/slub.c:3940 [inline] slab_alloc_node mm/slub.c:4000 [inline] kmem_cache_alloc_noprof+0x121/0x2f0 mm/slub.c:4007 copy_fs_struct+0x49/0x340 fs/fs_struct.c:114 copy_fs kernel/fork.c:1763 [inline] copy_process+0x35c7/0x8f10 kernel/fork.c:2381 kernel_clone+0xfd/0x980 kernel/fork.c:2797 __do_sys_clone3+0x1f5/0x270 kernel/fork.c:3098 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 11286: 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+0xf7/0x160 mm/kasan/common.c:240 __kasan_slab_free+0x32/0x50 mm/kasan/common.c:256 kasan_slab_free include/linux/kasan.h:184 [inline] slab_free_hook mm/slub.c:2195 [inline] slab_free mm/slub.c:4436 [inline] kmem_cache_free+0x12f/0x3a0 mm/slub.c:4511 free_fs_struct fs/fs_struct.c:92 [inline] exit_fs+0x127/0x170 fs/fs_struct.c:108 do_exit+0xa6f/0x2ba0 kernel/exit.c:870 do_group_exit+0xd3/0x2a0 kernel/exit.c:1023 __do_sys_exit_group kernel/exit.c:1034 [inline] __se_sys_exit_group kernel/exit.c:1032 [inline] __x64_sys_exit_group+0x3e/0x50 kernel/exit.c:1032 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 ffff888021a9c000 which belongs to the cache fs_cache of size 168 The buggy address is located 32 bytes to the right of allocated 168-byte region [ffff888021a9c000, ffff888021a9c0a8) The buggy address belongs to the physical page: page: refcount:1 mapcount:0 mapping:0000000000000000 index:0xffff888021a9c600 pfn:0x21a9c memcg:ffff88804fbe6601 ksm flags: 0xfff00000000000(node=0|zone=1|lastcpupid=0x7ff) page_type: 0xffffefff(slab) raw: 00fff00000000000 ffff8880166c2640 ffffea000086d3c0 dead000000000003 raw: ffff888021a9c600 0000000000100001 00000001ffffefff ffff88804fbe6601 page dumped because: kasan: bad access detected page_owner tracks the page as allocated page last allocated via order 0, migratetype Unmovable, gfp_mask 0x52cc0(GFP_KERNEL|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP), pid 1092, tgid 1092 (kworker/u32:6), ts 9786511439, free_ts 9163502688 set_page_owner include/linux/page_owner.h:32 [inline] post_alloc_hook+0x2d1/0x350 mm/page_alloc.c:1468 prep_new_page mm/page_alloc.c:1476 [inline] get_page_from_freelist+0x136a/0x2df0 mm/page_alloc.c:3402 __alloc_pages_noprof+0x22b/0x2460 mm/page_alloc.c:4660 __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:2264 allocate_slab mm/slub.c:2427 [inline] new_slab+0x84/0x260 mm/slub.c:2480 ___slab_alloc+0xdac/0x1870 mm/slub.c:3666 __slab_alloc.constprop.0+0x56/0xb0 mm/slub.c:3756 __slab_alloc_node mm/slub.c:3809 [inline] slab_alloc_node mm/slub.c:3988 [inline] kmem_cache_alloc_noprof+0x2ae/0x2f0 mm/slub.c:4007 copy_fs_struct+0x49/0x340 fs/fs_struct.c:114 copy_fs kernel/fork.c:1763 [inline] copy_process+0x35c7/0x8f10 kernel/fork.c:2381 kernel_clone+0xfd/0x980 kernel/fork.c:2797 user_mode_thread+0xb4/0xf0 kernel/fork.c:2875 call_usermodehelper_exec_work kernel/umh.c:172 [inline] call_usermodehelper_exec_work+0xcb/0x170 kernel/umh.c:158 process_one_work+0x9fb/0x1b60 kernel/workqueue.c:3231 process_scheduled_works kernel/workqueue.c:3312 [inline] worker_thread+0x6c8/0xf70 kernel/workqueue.c:3393 kthread+0x2c1/0x3a0 kernel/kthread.c:389 page last free pid 57 tgid 57 stack trace: reset_page_owner include/linux/page_owner.h:25 [inline] free_pages_prepare mm/page_alloc.c:1088 [inline] free_unref_page+0x64a/0xe40 mm/page_alloc.c:2565 vfree+0x181/0x7a0 mm/vmalloc.c:3346 delayed_vfree_work+0x56/0x70 mm/vmalloc.c:3267 process_one_work+0x9fb/0x1b60 kernel/workqueue.c:3231 process_scheduled_works kernel/workqueue.c:3312 [inline] worker_thread+0x6c8/0xf70 kernel/workqueue.c:3393 kthread+0x2c1/0x3a0 kernel/kthread.c:389 ret_from_fork+0x45/0x80 arch/x86/kernel/process.c:147 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:244 Memory state around the buggy address: ffff888021a9bf80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffff888021a9c000: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff888021a9c080: fb fb fb fb fb fc fc fc fc fc fc fc fc fc fc fc ^ ffff888021a9c100: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff888021a9c180: fb fb fb fb fb fc fc fc fc fc fc fc fc fc fc fc ==================================================================