memfd_create() without MFD_EXEC nor MFD_NOEXEC_SEAL, pid=4996 'syz-executor295' loop0: detected capacity change from 0 to 32768 ================================================================== BUG: KASAN: slab-out-of-bounds in jfs_readdir+0x3a89/0x4290 fs/jfs/jfs_dtree.c:2889 Read of size 1 at addr ffff888077af7f75 by task syz-executor295/4996 CPU: 1 PID: 4996 Comm: syz-executor295 Not tainted 6.4.0-rc1-next-20230512-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 04/28/2023 Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0xd9/0x150 lib/dump_stack.c:106 print_address_description.constprop.0+0x2c/0x3c0 mm/kasan/report.c:351 print_report mm/kasan/report.c:462 [inline] kasan_report+0x11c/0x130 mm/kasan/report.c:572 jfs_readdir+0x3a89/0x4290 fs/jfs/jfs_dtree.c:2889 iterate_dir+0x1fd/0x6f0 fs/readdir.c:67 __do_sys_getdents64 fs/readdir.c:369 [inline] __se_sys_getdents64 fs/readdir.c:354 [inline] __x64_sys_getdents64+0x13e/0x2c0 fs/readdir.c:354 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x39/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x63/0xcd RIP: 0033:0x7f57540cc539 Code: 28 00 00 00 75 05 48 83 c4 28 c3 e8 d1 17 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 c0 ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007fffe25cbb98 EFLAGS: 00000246 ORIG_RAX: 00000000000000d9 RAX: ffffffffffffffda RBX: 00007fffe25cbbe8 RCX: 00007f57540cc539 RDX: 00000000000000c5 RSI: 0000000020000200 RDI: 0000000000000004 RBP: 0000000000000000 R08: 00007fffe25cbcc0 R09: 00007fffe25cbcc0 R10: 0000000000000000 R11: 0000000000000246 R12: 00007fffe25cbbe0 R13: 00007fffe25cbcc0 R14: 431bde82d7b634db R15: 00007fffe25cbbc0 The buggy address belongs to the object at ffff888077af7800 which belongs to the cache sock_inode_cache of size 1408 The buggy address is located 501 bytes to the right of allocated 1408-byte region [ffff888077af7800, ffff888077af7d80) The buggy address belongs to the physical page: page:ffffea0001debc00 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x77af0 head:ffffea0001debc00 order:3 entire_mapcount:0 nr_pages_mapped:0 pincount:0 flags: 0xfff00000010200(slab|head|node=0|zone=1|lastcpupid=0x7ff) page_type: 0xffffffff() raw: 00fff00000010200 ffff888141a77a00 dead000000000122 0000000000000000 raw: 0000000000000000 0000000080150015 00000001ffffffff 0000000000000000 page dumped because: kasan: bad access detected page_owner tracks the page as allocated page last allocated via order 3, migratetype Reclaimable, gfp_mask 0xd20d0(__GFP_IO|__GFP_FS|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC|__GFP_RECLAIMABLE), pid 4990, tgid 4990 (sshd), ts 48039285235, free_ts 15297579328 set_page_owner include/linux/page_owner.h:31 [inline] post_alloc_hook+0x2db/0x350 mm/page_alloc.c:1731 prep_new_page mm/page_alloc.c:1738 [inline] get_page_from_freelist+0xf7c/0x2aa0 mm/page_alloc.c:3502 __alloc_pages+0x1cb/0x4a0 mm/page_alloc.c:4768 alloc_pages+0x1aa/0x270 mm/mempolicy.c:2279 alloc_slab_page mm/slub.c:1851 [inline] allocate_slab+0x28e/0x380 mm/slub.c:1998 new_slab mm/slub.c:2051 [inline] ___slab_alloc+0xa91/0x1400 mm/slub.c:3192 __slab_alloc.constprop.0+0x56/0xa0 mm/slub.c:3291 __slab_alloc_node mm/slub.c:3344 [inline] slab_alloc_node mm/slub.c:3441 [inline] slab_alloc mm/slub.c:3459 [inline] __kmem_cache_alloc_lru mm/slub.c:3466 [inline] kmem_cache_alloc_lru+0x4a8/0x600 mm/slub.c:3482 alloc_inode_sb include/linux/fs.h:2705 [inline] sock_alloc_inode+0x27/0x1d0 net/socket.c:305 alloc_inode+0x61/0x230 fs/inode.c:260 new_inode_pseudo+0x17/0x80 fs/inode.c:1018 sock_alloc+0x40/0x270 net/socket.c:631 __sock_create+0xbd/0x850 net/socket.c:1512 sock_create net/socket.c:1599 [inline] __sys_socket_create net/socket.c:1636 [inline] __sys_socket_create net/socket.c:1621 [inline] __sys_socket+0x133/0x250 net/socket.c:1664 __do_sys_socket net/socket.c:1677 [inline] __se_sys_socket net/socket.c:1675 [inline] __x64_sys_socket+0x73/0xb0 net/socket.c:1675 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x39/0xb0 arch/x86/entry/common.c:80 page last free stack trace: reset_page_owner include/linux/page_owner.h:24 [inline] free_pages_prepare mm/page_alloc.c:1302 [inline] free_unref_page_prepare+0x4dd/0xb90 mm/page_alloc.c:2564 free_unref_page+0x33/0x370 mm/page_alloc.c:2659 free_contig_range+0xb5/0x180 mm/page_alloc.c:6994 destroy_args+0x6c4/0x920 mm/debug_vm_pgtable.c:1023 debug_vm_pgtable+0x2417/0x4210 mm/debug_vm_pgtable.c:1403 do_one_initcall+0x102/0x540 init/main.c:1246 do_initcall_level init/main.c:1319 [inline] do_initcalls init/main.c:1335 [inline] do_basic_setup init/main.c:1354 [inline] kernel_init_freeable+0x5a4/0x890 init/main.c:1571 kernel_init+0x1e/0x2c0 init/main.c:1462 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:308 Memory state around the buggy address: ffff888077af7e00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff888077af7e80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc >ffff888077af7f00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ^ ffff888077af7f80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff888077af8000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ==================================================================