================================================================== BUG: KASAN: slab-out-of-bounds in sysv_new_inode+0xfd3/0x1170 fs/sysv/ialloc.c:153 Read of size 2 at addr ffff88800e48c1ce by task syz.3.496/7785 CPU: 0 UID: 0 PID: 7785 Comm: syz.3.496 Not tainted 6.11.0-rc4-syzkaller-00019-gb311c1b497e5 #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 sysv_new_inode+0xfd3/0x1170 fs/sysv/ialloc.c:153 sysv_mknod+0x4e/0xe0 fs/sysv/namei.c:53 lookup_open fs/namei.c:3578 [inline] open_last_lookups fs/namei.c:3647 [inline] path_openat+0x1a9c/0x3470 fs/namei.c:3883 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 entry_SYSCALL_64_after_hwframe+0x77/0x7f RIP: 0033:0x7ff591179e79 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:00007ff591eca038 EFLAGS: 00000246 ORIG_RAX: 0000000000000101 RAX: ffffffffffffffda RBX: 00007ff591315f80 RCX: 00007ff591179e79 RDX: 000000000000275a RSI: 0000000020000080 RDI: ffffffffffffff9c RBP: 00007ff5911e7916 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 0000000000000000 R14: 00007ff591315f80 R15: 00007ffdb5415838 Allocated by task 7785: kasan_save_stack mm/kasan/common.c:47 [inline] kasan_save_track+0x3f/0x80 mm/kasan/common.c:68 unpoison_slab_object mm/kasan/common.c:312 [inline] __kasan_slab_alloc+0x66/0x80 mm/kasan/common.c:338 kasan_slab_alloc include/linux/kasan.h:201 [inline] slab_post_alloc_hook mm/slub.c:3988 [inline] slab_alloc_node mm/slub.c:4037 [inline] kmem_cache_alloc_noprof+0x135/0x2a0 mm/slub.c:4044 alloc_buffer_head+0x2a/0x290 fs/buffer.c:3025 folio_alloc_buffers+0x241/0x5b0 fs/buffer.c:929 create_empty_buffers+0x3a/0x740 fs/buffer.c:1671 block_read_full_folio+0x25c/0xcd0 fs/buffer.c:2387 filemap_read_folio+0x1a2/0x790 mm/filemap.c:2355 do_read_cache_folio+0x134/0x820 mm/filemap.c:3789 do_read_cache_page+0x30/0x200 mm/filemap.c:3855 read_mapping_page include/linux/pagemap.h:907 [inline] dir_get_page fs/sysv/dir.c:64 [inline] sysv_find_entry+0x1af/0x410 fs/sysv/dir.c:157 sysv_inode_by_name+0x98/0x1f0 fs/sysv/dir.c:374 sysv_lookup+0x6b/0xe0 fs/sysv/namei.c:38 lookup_open fs/namei.c:3556 [inline] open_last_lookups fs/namei.c:3647 [inline] path_openat+0x11ce/0x3470 fs/namei.c:3883 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 entry_SYSCALL_64_after_hwframe+0x77/0x7f The buggy address belongs to the object at ffff88800e48c0e8 which belongs to the cache buffer_head of size 168 The buggy address is located 62 bytes to the right of allocated 168-byte region [ffff88800e48c0e8, ffff88800e48c190) The buggy address belongs to the physical page: page: refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0xe48c memcg:ffff88805940a901 flags: 0xfff00000000000(node=0|zone=1|lastcpupid=0x7ff) page_type: 0xfdffffff(slab) raw: 00fff00000000000 ffff8880172ddc80 dead000000000122 0000000000000000 raw: 0000000000000000 0000000000110011 00000001fdffffff ffff88805940a901 page dumped because: kasan: bad access detected page_owner tracks the page as allocated page last allocated via order 0, migratetype Reclaimable, gfp_mask 0x152c50(GFP_NOFS|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_HARDWALL|__GFP_RECLAIMABLE), pid 7785, tgid 7784 (syz.3.496), ts 434280115088, free_ts 433306920804 set_page_owner include/linux/page_owner.h:32 [inline] post_alloc_hook+0x1f3/0x230 mm/page_alloc.c:1493 prep_new_page mm/page_alloc.c:1501 [inline] get_page_from_freelist+0x2e4c/0x2f10 mm/page_alloc.c:3439 __alloc_pages_noprof+0x256/0x6c0 mm/page_alloc.c:4695 __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:2321 allocate_slab+0x5a/0x2f0 mm/slub.c:2484 new_slab mm/slub.c:2537 [inline] ___slab_alloc+0xcd1/0x14b0 mm/slub.c:3723 __slab_alloc+0x58/0xa0 mm/slub.c:3813 __slab_alloc_node mm/slub.c:3866 [inline] slab_alloc_node mm/slub.c:4025 [inline] kmem_cache_alloc_noprof+0x1c1/0x2a0 mm/slub.c:4044 alloc_buffer_head+0x2a/0x290 fs/buffer.c:3025 folio_alloc_buffers+0x241/0x5b0 fs/buffer.c:929 create_empty_buffers+0x3a/0x740 fs/buffer.c:1671 block_read_full_folio+0x25c/0xcd0 fs/buffer.c:2387 filemap_read_folio+0x1a2/0x790 mm/filemap.c:2355 do_read_cache_folio+0x134/0x820 mm/filemap.c:3789 do_read_cache_page+0x30/0x200 mm/filemap.c:3855 read_mapping_page include/linux/pagemap.h:907 [inline] dir_get_page fs/sysv/dir.c:64 [inline] sysv_find_entry+0x1af/0x410 fs/sysv/dir.c:157 page last free pid 33 tgid 33 stack trace: reset_page_owner include/linux/page_owner.h:25 [inline] free_pages_prepare mm/page_alloc.c:1094 [inline] free_unref_page+0xd22/0xea0 mm/page_alloc.c:2612 __folio_put+0x2c8/0x440 mm/swap.c:128 migrate_folio_move mm/migrate.c:1330 [inline] migrate_pages_batch+0x2a76/0x3560 mm/migrate.c:1818 migrate_pages_sync mm/migrate.c:1884 [inline] migrate_pages+0x1f59/0x3460 mm/migrate.c:1993 compact_zone+0x3404/0x4af0 mm/compaction.c:2671 compact_node+0x2de/0x460 mm/compaction.c:2935 kcompactd+0x788/0x1530 mm/compaction.c:3233 kthread+0x2f2/0x390 kernel/kthread.c:389 ret_from_fork+0x4d/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: ffff88800e48c080: 00 00 00 00 00 fc fc fc fc fc fc fc fc 00 00 00 ffff88800e48c100: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 >ffff88800e48c180: 00 00 fc fc fc fc fc fc fc fc 00 00 00 00 00 00 ^ ffff88800e48c200: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 fc ffff88800e48c280: fc fc fc fc fc fc fc 00 00 00 00 00 00 00 00 00 ==================================================================