================================================================== BUG: KASAN: slab-out-of-bounds in sysv_new_inode+0xfd3/0x1170 fs/sysv/ialloc.c:153 Read of size 2 at addr ffff888075a221ce by task syz.1.2169/14699 CPU: 0 UID: 0 PID: 14699 Comm: syz.1.2169 Not tainted 6.10.0-rc7-next-20240712-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 06/07/2024 Call Trace: __dump_stack lib/dump_stack.c:94 [inline] dump_stack_lvl+0x241/0x360 lib/dump_stack.c:120 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:3535 [inline] open_last_lookups fs/namei.c:3604 [inline] path_openat+0x1a9a/0x3470 fs/namei.c:3840 do_filp_open+0x235/0x490 fs/namei.c:3870 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:0x7fe128975bd9 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:00007fe1297f8048 EFLAGS: 00000246 ORIG_RAX: 0000000000000101 RAX: ffffffffffffffda RBX: 00007fe128b03f60 RCX: 00007fe128975bd9 RDX: 00000000000026e1 RSI: 0000000020000180 RDI: ffffffffffffff9c RBP: 00007fe1289e4e60 R08: 0000000000000000 R09: 0000000000000000 R10: 000000001c000012 R11: 0000000000000246 R12: 0000000000000000 R13: 000000000000000b R14: 00007fe128b03f60 R15: 00007ffcd48532d8 Allocated by task 14699: 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+0x1a0/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:3513 [inline] open_last_lookups fs/namei.c:3604 [inline] path_openat+0x11cc/0x3470 fs/namei.c:3840 do_filp_open+0x235/0x490 fs/namei.c:3870 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 ffff888075a220e8 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 [ffff888075a220e8, ffff888075a22190) The buggy address belongs to the physical page: page: refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x75a22 memcg:ffff888029119a01 flags: 0xfff00000000000(node=0|zone=1|lastcpupid=0x7ff) page_type: 0xfdffffff(slab) raw: 00fff00000000000 ffff888016addc80 dead000000000122 0000000000000000 raw: 0000000000000000 0000000000110011 00000001fdffffff ffff888029119a01 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 14699, tgid 14698 (syz.1.2169), ts 1067455631737, free_ts 1065023972835 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+0x2ccb/0x2d80 mm/page_alloc.c:3474 __alloc_pages_noprof+0x256/0x6c0 mm/page_alloc.c:4732 __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+0x1a0/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 4545 tgid 4545 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:2644 discard_slab mm/slub.c:2583 [inline] __put_partials+0xeb/0x130 mm/slub.c:3051 put_cpu_partial+0x17c/0x250 mm/slub.c:3126 __slab_free+0x2ea/0x3d0 mm/slub.c:4343 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:3988 [inline] slab_alloc_node mm/slub.c:4037 [inline] kmem_cache_alloc_node_noprof+0x16b/0x320 mm/slub.c:4080 __alloc_skb+0x1c3/0x440 net/core/skbuff.c:664 alloc_skb include/linux/skbuff.h:1320 [inline] alloc_skb_with_frags+0xc3/0x770 net/core/skbuff.c:6526 sock_alloc_send_pskb+0x91a/0xa60 net/core/sock.c:2815 unix_dgram_sendmsg+0x6d3/0x1f80 net/unix/af_unix.c:2030 sock_sendmsg_nosec net/socket.c:730 [inline] __sock_sendmsg+0x221/0x270 net/socket.c:745 __sys_sendto+0x3a4/0x4f0 net/socket.c:2204 __do_sys_sendto net/socket.c:2216 [inline] __se_sys_sendto net/socket.c:2212 [inline] __x64_sys_sendto+0xde/0x100 net/socket.c:2212 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xf3/0x230 arch/x86/entry/common.c:83 Memory state around the buggy address: ffff888075a22080: 00 00 00 00 00 fc fc fc fc fc fc fc fc 00 00 00 ffff888075a22100: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 >ffff888075a22180: 00 00 fc fc fc fc fc fc fc fc 00 00 00 00 00 00 ^ ffff888075a22200: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 fc ffff888075a22280: fc fc fc fc fc fc fc 00 00 00 00 00 00 00 00 00 ==================================================================