================================================================== BUG: KASAN: slab-out-of-bounds in jfs_readdir+0x375e/0x4230 fs/jfs/jfs_dtree.c:2889 Read of size 1 at addr ffff888086997f75 by task syz-executor.4/11859 CPU: 1 PID: 11859 Comm: syz-executor.4 Not tainted 6.2.0-rc3-syzkaller-00030-ge8f60cd7db24 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 10/26/2022 Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0xd1/0x138 lib/dump_stack.c:106 print_address_description mm/kasan/report.c:306 [inline] print_report+0x15e/0x45d mm/kasan/report.c:417 kasan_report+0xbf/0x1f0 mm/kasan/report.c:517 jfs_readdir+0x375e/0x4230 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:0x7fe15f68c0c9 Code: 28 00 00 00 75 05 48 83 c4 28 c3 e8 f1 19 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 b8 ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007fe15e1fe168 EFLAGS: 00000246 ORIG_RAX: 00000000000000d9 RAX: ffffffffffffffda RBX: 00007fe15f7abf80 RCX: 00007fe15f68c0c9 RDX: 00000000000000c5 RSI: 0000000020000200 RDI: 0000000000000004 RBP: 00007fe15f6e7ae9 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 00007fff3b5eee6f R14: 00007fe15e1fe300 R15: 0000000000022000 Allocated by task 11333: kasan_save_stack+0x22/0x40 mm/kasan/common.c:45 kasan_set_track+0x25/0x30 mm/kasan/common.c:52 __kasan_slab_alloc+0x82/0x90 mm/kasan/common.c:325 kasan_slab_alloc include/linux/kasan.h:201 [inline] slab_post_alloc_hook mm/slab.h:761 [inline] slab_alloc_node mm/slub.c:3452 [inline] slab_alloc mm/slub.c:3460 [inline] __kmem_cache_alloc_lru mm/slub.c:3467 [inline] kmem_cache_alloc_lru+0x26d/0x760 mm/slub.c:3483 alloc_inode_sb include/linux/fs.h:3119 [inline] ext4_alloc_inode+0x28/0x680 fs/ext4/super.c:1321 alloc_inode+0x61/0x230 fs/inode.c:259 new_inode_pseudo fs/inode.c:1018 [inline] new_inode+0x2b/0x280 fs/inode.c:1046 __ext4_new_inode+0x399/0x57d0 fs/ext4/ialloc.c:959 ext4_symlink+0x5ac/0xa00 fs/ext4/namei.c:3373 vfs_symlink fs/namei.c:4401 [inline] vfs_symlink+0x369/0x5c0 fs/namei.c:4386 do_symlinkat+0x250/0x2c0 fs/namei.c:4430 __do_sys_symlinkat fs/namei.c:4447 [inline] __se_sys_symlinkat fs/namei.c:4444 [inline] __x64_sys_symlinkat+0x97/0xc0 fs/namei.c:4444 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 Last potentially related work creation: kasan_save_stack+0x22/0x40 mm/kasan/common.c:45 __kasan_record_aux_stack+0xbc/0xd0 mm/kasan/generic.c:488 __call_rcu_common.constprop.0+0x99/0x820 kernel/rcu/tree.c:2755 destroy_inode+0x129/0x1b0 fs/inode.c:314 iput_final fs/inode.c:1747 [inline] iput.part.0+0x59b/0x880 fs/inode.c:1773 iput+0x5c/0x80 fs/inode.c:1763 do_unlinkat+0x406/0x640 fs/namei.c:4327 __do_sys_unlink fs/namei.c:4368 [inline] __se_sys_unlink fs/namei.c:4366 [inline] __x64_sys_unlink+0xca/0x110 fs/namei.c:4366 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 Second to last potentially related work creation: kasan_save_stack+0x22/0x40 mm/kasan/common.c:45 __kasan_record_aux_stack+0xbc/0xd0 mm/kasan/generic.c:488 __call_rcu_common.constprop.0+0x99/0x820 kernel/rcu/tree.c:2755 destroy_inode+0x129/0x1b0 fs/inode.c:314 iput_final fs/inode.c:1747 [inline] iput.part.0+0x59b/0x880 fs/inode.c:1773 iput+0x5c/0x80 fs/inode.c:1763 do_unlinkat+0x406/0x640 fs/namei.c:4327 __do_sys_unlink fs/namei.c:4368 [inline] __se_sys_unlink fs/namei.c:4366 [inline] __x64_sys_unlink+0xca/0x110 fs/namei.c:4366 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 The buggy address belongs to the object at ffff888086996e58 which belongs to the cache ext4_inode_cache of size 2440 The buggy address is located 1941 bytes to the right of 2440-byte region [ffff888086996e58, ffff8880869977e0) The buggy address belongs to the physical page: page:ffffea00021a6400 refcount:1 mapcount:0 mapping:0000000000000000 index:0xffff888086990a08 pfn:0x86990 head:ffffea00021a6400 order:3 compound_mapcount:0 subpages_mapcount:0 compound_pincount:0 memcg:ffff88802868b701 flags: 0xfff00000010200(slab|head|node=0|zone=1|lastcpupid=0x7ff) raw: 00fff00000010200 ffff8880194da780 ffffea0002198410 ffffea00021aaa10 raw: ffff888086990a08 00000000000c0009 00000001ffffffff ffff88802868b701 page dumped because: kasan: bad access detected page_owner tracks the page as allocated page last allocated via order 3, migratetype Reclaimable, gfp_mask 0x1d2050(__GFP_IO|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC|__GFP_HARDWALL|__GFP_RECLAIMABLE), pid 5107, tgid 5107 (syz-executor.4), ts 1186280786200, free_ts 1168198321405 prep_new_page mm/page_alloc.c:2531 [inline] get_page_from_freelist+0x119c/0x2ce0 mm/page_alloc.c:4283 __alloc_pages+0x1cb/0x5b0 mm/page_alloc.c:5549 alloc_pages+0x1aa/0x270 mm/mempolicy.c:2286 alloc_slab_page mm/slub.c:1851 [inline] allocate_slab+0x25f/0x350 mm/slub.c:1998 new_slab mm/slub.c:2051 [inline] ___slab_alloc+0xa91/0x1400 mm/slub.c:3193 __slab_alloc.constprop.0+0x56/0xa0 mm/slub.c:3292 __slab_alloc_node mm/slub.c:3345 [inline] slab_alloc_node mm/slub.c:3442 [inline] slab_alloc mm/slub.c:3460 [inline] __kmem_cache_alloc_lru mm/slub.c:3467 [inline] kmem_cache_alloc_lru+0x4dc/0x760 mm/slub.c:3483 alloc_inode_sb include/linux/fs.h:3119 [inline] ext4_alloc_inode+0x28/0x680 fs/ext4/super.c:1321 alloc_inode+0x61/0x230 fs/inode.c:259 new_inode_pseudo fs/inode.c:1018 [inline] new_inode+0x2b/0x280 fs/inode.c:1046 __ext4_new_inode+0x399/0x57d0 fs/ext4/ialloc.c:959 ext4_mkdir+0x33e/0xb20 fs/ext4/namei.c:2992 vfs_mkdir+0x48d/0x740 fs/namei.c:4036 do_mkdirat+0x27b/0x2f0 fs/namei.c:4061 __do_sys_mkdirat fs/namei.c:4076 [inline] __se_sys_mkdirat fs/namei.c:4074 [inline] __x64_sys_mkdirat+0x119/0x170 fs/namei.c:4074 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:1446 [inline] free_pcp_prepare+0x65c/0xc00 mm/page_alloc.c:1496 free_unref_page_prepare mm/page_alloc.c:3369 [inline] free_unref_page+0x1d/0x490 mm/page_alloc.c:3464 qlink_free mm/kasan/quarantine.c:168 [inline] qlist_free_all+0x6a/0x170 mm/kasan/quarantine.c:187 kasan_quarantine_reduce+0x192/0x220 mm/kasan/quarantine.c:294 __kasan_slab_alloc+0x66/0x90 mm/kasan/common.c:302 kasan_slab_alloc include/linux/kasan.h:201 [inline] slab_post_alloc_hook mm/slab.h:761 [inline] slab_alloc_node mm/slub.c:3452 [inline] slab_alloc mm/slub.c:3460 [inline] __kmem_cache_alloc_lru mm/slub.c:3467 [inline] kmem_cache_alloc+0x1e4/0x430 mm/slub.c:3476 kmem_cache_zalloc include/linux/slab.h:710 [inline] __kernfs_new_node+0xd4/0x8b0 fs/kernfs/dir.c:614 kernfs_new_node+0x97/0x120 fs/kernfs/dir.c:676 __kernfs_create_file+0x55/0x350 fs/kernfs/file.c:1047 sysfs_add_file_mode_ns+0x213/0x3f0 fs/sysfs/file.c:294 create_files fs/sysfs/group.c:64 [inline] internal_create_group+0x322/0xb10 fs/sysfs/group.c:148 internal_create_groups.part.0+0x90/0x140 fs/sysfs/group.c:188 internal_create_groups fs/sysfs/group.c:184 [inline] sysfs_create_groups+0x29/0x50 fs/sysfs/group.c:214 setup_gid_attrs drivers/infiniband/core/sysfs.c:1169 [inline] ib_setup_port_attrs+0x3eb/0x5b0 drivers/infiniband/core/sysfs.c:1446 add_one_compat_dev drivers/infiniband/core/device.c:969 [inline] add_one_compat_dev+0x54f/0x830 drivers/infiniband/core/device.c:920 rdma_dev_init_net+0x2b9/0x4b0 drivers/infiniband/core/device.c:1185 Memory state around the buggy address: ffff888086997e00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff888086997e80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc >ffff888086997f00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ^ ffff888086997f80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff888086998000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ==================================================================