loop0: detected capacity change from 0 to 32768 ================================================================== BUG: KASAN: slab-use-after-free in dbAllocBits+0x618/0x630 fs/jfs/jfs_dmap.c:2255 Read of size 8 at addr ffff8880205eaeb8 by task syz-executor.0/5485 CPU: 1 PID: 5485 Comm: syz-executor.0 Not tainted 6.7.0-rc4-syzkaller-00358-gf2e8a57ee903 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 11/10/2023 Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0xd9/0x1b0 lib/dump_stack.c:106 print_address_description mm/kasan/report.c:364 [inline] print_report+0xc4/0x620 mm/kasan/report.c:475 kasan_report+0xda/0x110 mm/kasan/report.c:588 dbAllocBits+0x618/0x630 fs/jfs/jfs_dmap.c:2255 dbAllocDmap+0x5c/0x100 fs/jfs/jfs_dmap.c:2032 dbAllocNear fs/jfs/jfs_dmap.c:1258 [inline] dbAlloc+0x780/0xaa0 fs/jfs/jfs_dmap.c:843 ea_get+0xc0d/0x12c0 fs/jfs/xattr.c:514 __jfs_setxattr+0x1ed/0x1060 fs/jfs/xattr.c:718 __jfs_set_acl+0x110/0x1a0 fs/jfs/acl.c:87 jfs_set_acl+0x252/0x330 fs/jfs/acl.c:115 set_posix_acl+0x259/0x320 fs/posix_acl.c:956 vfs_set_acl+0x539/0x900 fs/posix_acl.c:1135 do_set_acl+0xda/0x1b0 fs/posix_acl.c:1280 do_setxattr+0xeb/0x170 fs/xattr.c:627 setxattr+0x159/0x170 fs/xattr.c:653 path_setxattr+0x175/0x1d0 fs/xattr.c:672 __do_sys_lsetxattr fs/xattr.c:695 [inline] __se_sys_lsetxattr fs/xattr.c:691 [inline] __x64_sys_lsetxattr+0xc1/0x160 fs/xattr.c:691 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0x40/0x110 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x63/0x6b RIP: 0033:0x7f4e80a7cb29 Code: 28 00 00 00 75 05 48 83 c4 28 c3 e8 e1 20 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 b0 ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007f4e817420c8 EFLAGS: 00000246 ORIG_RAX: 00000000000000bd RAX: ffffffffffffffda RBX: 00007f4e80b9bf80 RCX: 00007f4e80a7cb29 RDX: 0000000020000180 RSI: 0000000020000040 RDI: 0000000020000000 RBP: 00007f4e80ac847a R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000024 R11: 0000000000000246 R12: 0000000000000000 R13: 000000000000000b R14: 00007f4e80b9bf80 R15: 00007ffca8ca4918 Allocated by task 5468: kasan_save_stack+0x33/0x50 mm/kasan/common.c:45 kasan_set_track+0x25/0x30 mm/kasan/common.c:52 __kasan_slab_alloc+0x81/0x90 mm/kasan/common.c:328 kasan_slab_alloc include/linux/kasan.h:188 [inline] slab_post_alloc_hook mm/slab.h:763 [inline] slab_alloc_node mm/slub.c:3478 [inline] slab_alloc mm/slub.c:3486 [inline] __kmem_cache_alloc_lru mm/slub.c:3493 [inline] kmem_cache_alloc+0x15d/0x2f0 mm/slub.c:3502 getname_flags.part.0+0x50/0x4e0 fs/namei.c:140 getname_flags+0x9c/0xf0 include/linux/audit.h:321 user_path_at_empty+0x2c/0x60 fs/namei.c:2910 user_path_at include/linux/namei.h:57 [inline] user_statfs+0xa3/0x180 fs/statfs.c:103 __do_sys_statfs+0x8a/0x100 fs/statfs.c:195 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0x40/0x110 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x63/0x6b Freed by task 5468: kasan_save_stack+0x33/0x50 mm/kasan/common.c:45 kasan_set_track+0x25/0x30 mm/kasan/common.c:52 kasan_save_free_info+0x2b/0x40 mm/kasan/generic.c:522 ____kasan_slab_free mm/kasan/common.c:236 [inline] ____kasan_slab_free+0x15b/0x1b0 mm/kasan/common.c:200 kasan_slab_free include/linux/kasan.h:164 [inline] slab_free_hook mm/slub.c:1800 [inline] slab_free_freelist_hook+0x114/0x1e0 mm/slub.c:1826 slab_free mm/slub.c:3809 [inline] kmem_cache_free+0xf8/0x350 mm/slub.c:3831 putname+0x12e/0x170 fs/namei.c:274 user_path_at_empty+0x4c/0x60 fs/namei.c:2913 user_path_at include/linux/namei.h:57 [inline] user_statfs+0xa3/0x180 fs/statfs.c:103 __do_sys_statfs+0x8a/0x100 fs/statfs.c:195 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0x40/0x110 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x63/0x6b The buggy address belongs to the object at ffff8880205ea200 which belongs to the cache names_cache of size 4096 The buggy address is located 3256 bytes inside of freed 4096-byte region [ffff8880205ea200, ffff8880205eb200) The buggy address belongs to the physical page: page:ffffea0000817a00 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x205e8 head:ffffea0000817a00 order:3 entire_mapcount:0 nr_pages_mapped:0 pincount:0 anon flags: 0xfff00000000840(slab|head|node=0|zone=1|lastcpupid=0x7ff) page_type: 0xffffffff() raw: 00fff00000000840 ffff888015252780 0000000000000000 dead000000000001 raw: 0000000000000000 0000000000070007 00000001ffffffff 0000000000000000 page dumped because: kasan: bad access detected page_owner tracks the page as allocated page last allocated via order 3, migratetype Unmovable, gfp_mask 0xd20c0(__GFP_IO|__GFP_FS|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC), pid 4521, tgid 4521 (udevd), ts 25728365439, free_ts 25717321495 set_page_owner include/linux/page_owner.h:31 [inline] post_alloc_hook+0x2d0/0x350 mm/page_alloc.c:1537 prep_new_page mm/page_alloc.c:1544 [inline] get_page_from_freelist+0xa25/0x36d0 mm/page_alloc.c:3312 __alloc_pages+0x22e/0x2420 mm/page_alloc.c:4568 alloc_pages_mpol+0x258/0x5f0 mm/mempolicy.c:2133 alloc_slab_page mm/slub.c:1870 [inline] allocate_slab mm/slub.c:2017 [inline] new_slab+0x283/0x3c0 mm/slub.c:2070 ___slab_alloc+0x979/0x1500 mm/slub.c:3223 __slab_alloc.constprop.0+0x56/0xa0 mm/slub.c:3322 __slab_alloc_node mm/slub.c:3375 [inline] slab_alloc_node mm/slub.c:3468 [inline] slab_alloc mm/slub.c:3486 [inline] __kmem_cache_alloc_lru mm/slub.c:3493 [inline] kmem_cache_alloc+0x2dc/0x2f0 mm/slub.c:3502 getname_flags.part.0+0x50/0x4e0 fs/namei.c:140 getname_flags include/linux/audit.h:321 [inline] getname+0x90/0xe0 fs/namei.c:219 do_sys_openat2+0x100/0x1e0 fs/open.c:1434 do_sys_open fs/open.c:1455 [inline] __do_sys_openat fs/open.c:1471 [inline] __se_sys_openat fs/open.c:1466 [inline] __x64_sys_openat+0x175/0x210 fs/open.c:1466 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0x40/0x110 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x63/0x6b page last free stack trace: reset_page_owner include/linux/page_owner.h:24 [inline] free_pages_prepare mm/page_alloc.c:1137 [inline] free_unref_page_prepare+0x4fa/0xaa0 mm/page_alloc.c:2347 free_unref_page+0x33/0x3b0 mm/page_alloc.c:2487 __unfreeze_partials+0x226/0x240 mm/slub.c:2655 qlink_free mm/kasan/quarantine.c:168 [inline] qlist_free_all+0x6a/0x170 mm/kasan/quarantine.c:187 kasan_quarantine_reduce+0x18e/0x1d0 mm/kasan/quarantine.c:294 __kasan_slab_alloc+0x65/0x90 mm/kasan/common.c:305 kasan_slab_alloc include/linux/kasan.h:188 [inline] slab_post_alloc_hook mm/slab.h:763 [inline] slab_alloc_node mm/slub.c:3478 [inline] __kmem_cache_alloc_node+0x195/0x310 mm/slub.c:3517 __do_kmalloc_node mm/slab_common.c:1006 [inline] __kmalloc+0x49/0x90 mm/slab_common.c:1020 kmalloc include/linux/slab.h:604 [inline] tomoyo_realpath_from_path+0xb9/0x710 security/tomoyo/realpath.c:251 tomoyo_get_realpath security/tomoyo/file.c:151 [inline] tomoyo_path_perm+0x26f/0x450 security/tomoyo/file.c:822 security_inode_getattr+0xf1/0x150 security/security.c:2153 vfs_getattr fs/stat.c:173 [inline] vfs_fstat+0x4f/0xc0 fs/stat.c:198 vfs_fstatat+0x130/0x140 fs/stat.c:295 __do_sys_newfstatat+0x98/0x110 fs/stat.c:463 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0x40/0x110 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x63/0x6b Memory state around the buggy address: ffff8880205ead80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff8880205eae00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff8880205eae80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff8880205eaf00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff8880205eaf80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================