================================================================== BUG: KASAN: use-after-free in sysv_new_inode+0xecc/0x1190 fs/sysv/ialloc.c:153 Read of size 2 at addr ffff888000c3a1ce by task syz-executor.1/10773 CPU: 2 PID: 10773 Comm: syz-executor.1 Not tainted 6.9.0-rc6-syzkaller-00022-g98369dccd2f8 #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_inode+0xecc/0x1190 fs/sysv/ialloc.c:153 sysv_mknod fs/sysv/namei.c:53 [inline] sysv_create+0x20/0xf0 fs/sysv/namei.c:67 lookup_open.isra.0+0x10a1/0x13c0 fs/namei.c:3497 open_last_lookups fs/namei.c:3566 [inline] path_openat+0x92f/0x2990 fs/namei.c:3796 do_filp_open+0x1dc/0x430 fs/namei.c:3826 do_sys_openat2+0x17a/0x1e0 fs/open.c:1406 do_sys_open fs/open.c:1421 [inline] __do_sys_creat fs/open.c:1497 [inline] __se_sys_creat fs/open.c:1491 [inline] __ia32_sys_creat+0xcc/0x120 fs/open.c:1491 do_syscall_32_irqs_on arch/x86/entry/common.c:165 [inline] __do_fast_syscall_32+0x75/0x120 arch/x86/entry/common.c:386 do_fast_syscall_32+0x32/0x80 arch/x86/entry/common.c:411 entry_SYSENTER_compat_after_hwframe+0x84/0x8e RIP: 0023:0xf7321579 Code: b8 01 10 06 03 74 b4 01 10 07 03 74 b0 01 10 08 03 74 d8 01 00 00 00 00 00 00 00 00 00 00 00 00 00 51 52 55 89 e5 0f 34 cd 80 <5d> 5a 59 c3 90 90 90 90 8d b4 26 00 00 00 00 8d b4 26 00 00 00 00 RSP: 002b:00000000f5ef25ac EFLAGS: 00000292 ORIG_RAX: 0000000000000008 RAX: ffffffffffffffda RBX: 0000000020000240 RCX: 0000000000000000 RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000000000000 RBP: 0000000000000000 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000292 R12: 0000000000000000 R13: 0000000000000000 R14: 0000000000000000 R15: 0000000000000000 The buggy address belongs to the physical page: page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x1 pfn:0xc3a flags: 0x7ff00000000000(node=0|zone=0|lastcpupid=0x7ff) page_type: 0xffffffff() raw: 007ff00000000000 0000000000000000 dead000000000122 0000000000000000 raw: 0000000000000001 0000000000000000 00000000ffffffff 0000000000000000 page dumped because: kasan: bad access detected page_owner tracks the page as freed page last allocated via order 3, migratetype Reclaimable, gfp_mask 0x1d20d0(__GFP_IO|__GFP_FS|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC|__GFP_HARDWALL|__GFP_RECLAIMABLE), pid 12734, tgid -1551633909 (syz-executor.2), ts 12734, free_ts 322218046482 set_page_owner include/linux/page_owner.h:32 [inline] post_alloc_hook+0x2d4/0x350 mm/page_alloc.c:1534 prep_new_page mm/page_alloc.c:1541 [inline] get_page_from_freelist+0xa28/0x3780 mm/page_alloc.c:3317 __alloc_pages+0x22b/0x2460 mm/page_alloc.c:4575 __alloc_pages_node include/linux/gfp.h:238 [inline] alloc_pages_node include/linux/gfp.h:261 [inline] alloc_slab_page mm/slub.c:2175 [inline] allocate_slab mm/slub.c:2338 [inline] new_slab+0xcc/0x3a0 mm/slub.c:2391 ___slab_alloc+0x670/0x16d0 mm/slub.c:3525 __slab_alloc.constprop.0+0x56/0xb0 mm/slub.c:3610 __slab_alloc_node mm/slub.c:3663 [inline] slab_alloc_node mm/slub.c:3835 [inline] kmem_cache_alloc_lru+0x377/0x6f0 mm/slub.c:3864 alloc_inode_sb include/linux/fs.h:3091 [inline] sock_alloc_inode+0x25/0x1c0 net/socket.c:308 alloc_inode+0x5d/0x230 fs/inode.c:261 new_inode_pseudo+0x16/0x80 fs/inode.c:1007 sock_alloc+0x40/0x280 net/socket.c:634 __sock_create+0xc0/0x800 net/socket.c:1535 sock_create net/socket.c:1622 [inline] __sys_socket_create net/socket.c:1659 [inline] __sys_socket+0x14f/0x260 net/socket.c:1706 __do_compat_sys_socketcall+0x57e/0x700 net/compat.c:448 do_syscall_32_irqs_on arch/x86/entry/common.c:165 [inline] __do_fast_syscall_32+0x75/0x120 arch/x86/entry/common.c:386 do_fast_syscall_32+0x32/0x80 arch/x86/entry/common.c:411 page last free pid 12750 tgid 12749 stack trace: reset_page_owner include/linux/page_owner.h:25 [inline] free_pages_prepare mm/page_alloc.c:1141 [inline] free_unref_page_prepare+0x527/0xb10 mm/page_alloc.c:2347 free_unref_page+0x33/0x3c0 mm/page_alloc.c:2487 __put_partials+0x14c/0x170 mm/slub.c:2906 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:3798 [inline] slab_alloc_node mm/slub.c:3845 [inline] kmem_cache_alloc+0x136/0x320 mm/slub.c:3852 kmem_cache_zalloc include/linux/slab.h:739 [inline] alloc_buffer_head+0x21/0x160 fs/buffer.c:3001 folio_alloc_buffers+0x2c8/0x7d0 fs/buffer.c:924 create_empty_buffers+0x36/0x480 fs/buffer.c:1650 folio_create_buffers+0x109/0x150 fs/buffer.c:1761 block_read_full_folio+0x20a/0xa70 fs/buffer.c:2365 filemap_read_folio+0xe5/0x2c0 mm/filemap.c:2331 do_read_cache_folio+0x203/0x540 mm/filemap.c:3747 do_read_cache_page mm/filemap.c:3813 [inline] read_cache_page+0x5b/0x160 mm/filemap.c:3822 read_mapping_page include/linux/pagemap.h:888 [inline] dir_get_page fs/sysv/dir.c:64 [inline] sysv_readdir+0x180/0x7e0 fs/sysv/dir.c:92 Memory state around the buggy address: ffff888000c3a080: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ffff888000c3a100: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff >ffff888000c3a180: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ^ ffff888000c3a200: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ffff888000c3a280: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ================================================================== ---------------- Code disassembly (best guess), 2 bytes skipped: 0: 10 06 adc %al,(%rsi) 2: 03 74 b4 01 add 0x1(%rsp,%rsi,4),%esi 6: 10 07 adc %al,(%rdi) 8: 03 74 b0 01 add 0x1(%rax,%rsi,4),%esi c: 10 08 adc %cl,(%rax) e: 03 74 d8 01 add 0x1(%rax,%rbx,8),%esi 1e: 00 51 52 add %dl,0x52(%rcx) 21: 55 push %rbp 22: 89 e5 mov %esp,%ebp 24: 0f 34 sysenter 26: cd 80 int $0x80 * 28: 5d pop %rbp <-- trapping instruction 29: 5a pop %rdx 2a: 59 pop %rcx 2b: c3 ret 2c: 90 nop 2d: 90 nop 2e: 90 nop 2f: 90 nop 30: 8d b4 26 00 00 00 00 lea 0x0(%rsi,%riz,1),%esi 37: 8d b4 26 00 00 00 00 lea 0x0(%rsi,%riz,1),%esi