Hello,
syzbot found the following issue on:
HEAD commit: c61bd26ae81a Linux 5.15.160
git tree: linux-5.15.y
console output:
https://syzkaller.appspot.com/x/log.txt?x=1341fa9a980000
kernel config:
https://syzkaller.appspot.com/x/.config?x=235f0e81ca937c17
dashboard link:
https://syzkaller.appspot.com/bug?extid=73c586d849966dd9a6b1
compiler: Debian clang version 15.0.6, GNU ld (GNU Binutils for Debian) 2.40
Unfortunately, I don't have any reproducer for this issue yet.
Downloadable assets:
disk image:
https://storage.googleapis.com/syzbot-assets/d61a97eef8b9/disk-c61bd26a.raw.xz
vmlinux:
https://storage.googleapis.com/syzbot-assets/ab4908b4b59b/vmlinux-c61bd26a.xz
kernel image:
https://storage.googleapis.com/syzbot-assets/d818fd46802b/bzImage-c61bd26a.xz
IMPORTANT: if you fix the issue, please add the following tag to the commit:
Reported-by:
syzbot+73c586...@syzkaller.appspotmail.com
==================================================================
BUG: KASAN: use-after-free in ext4_xattr_delete_inode+0xcd0/0xce0 fs/ext4/xattr.c:2904
Read of size 4 at addr ffff88801f5ea000 by task syz-executor.2/3534
CPU: 0 PID: 3534 Comm: syz-executor.2 Not tainted 5.15.160-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 04/02/2024
Call Trace:
<TASK>
__dump_stack lib/dump_stack.c:88 [inline]
dump_stack_lvl+0x1e3/0x2d0 lib/dump_stack.c:106
print_address_description+0x63/0x3b0 mm/kasan/report.c:248
__kasan_report mm/kasan/report.c:434 [inline]
kasan_report+0x16b/0x1c0 mm/kasan/report.c:451
ext4_xattr_delete_inode+0xcd0/0xce0 fs/ext4/xattr.c:2904
ext4_evict_inode+0xcb7/0x1100 fs/ext4/inode.c:299
evict+0x2a4/0x620 fs/inode.c:587
d_delete_notify include/linux/fsnotify.h:261 [inline]
vfs_rmdir+0x33c/0x460 fs/namei.c:4162
do_rmdir+0x368/0x670 fs/namei.c:4210
__do_sys_unlinkat fs/namei.c:4390 [inline]
__se_sys_unlinkat fs/namei.c:4384 [inline]
__x64_sys_unlinkat+0xdc/0xf0 fs/namei.c:4384
do_syscall_x64 arch/x86/entry/common.c:50 [inline]
do_syscall_64+0x3b/0xb0 arch/x86/entry/common.c:80
entry_SYSCALL_64_after_hwframe+0x66/0xd0
RIP: 0033:0x7fa6704a16c7
Code: 73 01 c3 48 c7 c1 b0 ff ff ff f7 d8 64 89 01 48 83 c8 ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 44 00 00 b8 07 01 00 00 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:00007ffd70456b48 EFLAGS: 00000207 ORIG_RAX: 0000000000000107
RAX: ffffffffffffffda RBX: 0000000000000065 RCX: 00007fa6704a16c7
RDX: 0000000000000200 RSI: 00007ffd70457cf0 RDI: 00000000ffffff9c
RBP: 00007fa6704ed336 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000100 R11: 0000000000000207 R12: 00007ffd70457cf0
R13: 00007fa6704ed336 R14: 000000000000f6db R15: 0000000000000009
</TASK>
Allocated by task 3572:
kasan_save_stack mm/kasan/common.c:38 [inline]
kasan_set_track mm/kasan/common.c:46 [inline]
set_alloc_info mm/kasan/common.c:434 [inline]
____kasan_kmalloc+0xba/0xf0 mm/kasan/common.c:513
kasan_kmalloc include/linux/kasan.h:264 [inline]
__kmalloc+0x168/0x300 mm/slub.c:4407
kmalloc include/linux/slab.h:596 [inline]
kzalloc include/linux/slab.h:721 [inline]
tomoyo_encode2 security/tomoyo/realpath.c:45 [inline]
tomoyo_encode+0x26b/0x530 security/tomoyo/realpath.c:80
tomoyo_realpath_from_path+0x5a2/0x5e0 security/tomoyo/realpath.c:288
tomoyo_get_realpath security/tomoyo/file.c:151 [inline]
tomoyo_path_perm+0x273/0x6b0 security/tomoyo/file.c:822
security_inode_getattr+0xcf/0x120 security/security.c:1348
vfs_getattr+0x26/0x360 fs/stat.c:157
vfs_statx+0x18f/0x3b0 fs/stat.c:225
vfs_fstatat fs/stat.c:243 [inline]
__do_sys_newfstatat fs/stat.c:411 [inline]
__se_sys_newfstatat fs/stat.c:405 [inline]
__x64_sys_newfstatat+0x12c/0x1b0 fs/stat.c:405
do_syscall_x64 arch/x86/entry/common.c:50 [inline]
do_syscall_64+0x3b/0xb0 arch/x86/entry/common.c:80
entry_SYSCALL_64_after_hwframe+0x66/0xd0
Freed by task 3572:
kasan_save_stack mm/kasan/common.c:38 [inline]
kasan_set_track+0x4b/0x80 mm/kasan/common.c:46
kasan_set_free_info+0x1f/0x40 mm/kasan/generic.c:360
____kasan_slab_free+0xd8/0x120 mm/kasan/common.c:366
kasan_slab_free include/linux/kasan.h:230 [inline]
slab_free_hook mm/slub.c:1705 [inline]
slab_free_freelist_hook+0xdd/0x160 mm/slub.c:1731
slab_free mm/slub.c:3499 [inline]
kfree+0xf1/0x270 mm/slub.c:4559
tomoyo_path_perm+0x555/0x6b0 security/tomoyo/file.c:842
security_inode_getattr+0xcf/0x120 security/security.c:1348
vfs_getattr+0x26/0x360 fs/stat.c:157
vfs_statx+0x18f/0x3b0 fs/stat.c:225
vfs_fstatat fs/stat.c:243 [inline]
__do_sys_newfstatat fs/stat.c:411 [inline]
__se_sys_newfstatat fs/stat.c:405 [inline]
__x64_sys_newfstatat+0x12c/0x1b0 fs/stat.c:405
do_syscall_x64 arch/x86/entry/common.c:50 [inline]
do_syscall_64+0x3b/0xb0 arch/x86/entry/common.c:80
entry_SYSCALL_64_after_hwframe+0x66/0xd0
The buggy address belongs to the object at ffff88801f5ea000
which belongs to the cache kmalloc-64 of size 64
The buggy address is located 0 bytes inside of
64-byte region [ffff88801f5ea000, ffff88801f5ea040)
The buggy address belongs to the page:
page:ffffea00007d7a80 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x1f5ea
flags: 0xfff00000000200(slab|node=0|zone=1|lastcpupid=0x7ff)
raw: 00fff00000000200 ffffea0001e34080 0000000b0000000b ffff888011c41640
raw: 0000000000000000 0000000000200020 00000001ffffffff 0000000000000000
page dumped because: kasan: bad access detected
page_owner tracks the page as allocated
page last allocated via order 0, migratetype Unmovable, gfp_mask 0x12cc0(GFP_KERNEL|__GFP_NOWARN|__GFP_NORETRY), pid 154, ts 9923158225, free_ts 9919513771
prep_new_page mm/page_alloc.c:2426 [inline]
get_page_from_freelist+0x322a/0x33c0 mm/page_alloc.c:4159
__alloc_pages+0x272/0x700 mm/page_alloc.c:5423
alloc_slab_page mm/slub.c:1775 [inline]
allocate_slab mm/slub.c:1912 [inline]
new_slab+0xbb/0x4b0 mm/slub.c:1975
___slab_alloc+0x6f6/0xe10 mm/slub.c:3008
__slab_alloc mm/slub.c:3095 [inline]
slab_alloc_node mm/slub.c:3186 [inline]
slab_alloc mm/slub.c:3228 [inline]
__kmalloc+0x1c9/0x300 mm/slub.c:4403
kmalloc include/linux/slab.h:596 [inline]
kzalloc include/linux/slab.h:721 [inline]
lsm_task_alloc security/security.c:616 [inline]
security_task_alloc+0x3f/0x120 security/security.c:1677
copy_process+0x1664/0x3ef0 kernel/fork.c:2188
kernel_clone+0x210/0x960 kernel/fork.c:2604
kernel_thread+0x168/0x1e0 kernel/fork.c:2656
call_usermodehelper_exec_work+0x58/0x220 kernel/umh.c:174
process_one_work+0x8a1/0x10c0 kernel/workqueue.c:2310
worker_thread+0xaca/0x1280 kernel/workqueue.c:2457
kthread+0x3f6/0x4f0 kernel/kthread.c:334
ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:300
page last free stack trace:
reset_page_owner include/linux/page_owner.h:24 [inline]
free_pages_prepare mm/page_alloc.c:1340 [inline]
free_pcp_prepare mm/page_alloc.c:1391 [inline]
free_unref_page_prepare+0xc34/0xcf0 mm/page_alloc.c:3317
free_unref_page+0x95/0x2d0 mm/page_alloc.c:3396
mm_free_pgd kernel/fork.c:652 [inline]
__mmdrop+0xac/0x3e0 kernel/fork.c:703
free_bprm+0x135/0x2f0 fs/exec.c:1496
kernel_execve+0x3bd/0x9b0 fs/exec.c:2011
call_usermodehelper_exec_async+0x22f/0x370 kernel/umh.c:112
ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:300
Memory state around the buggy address:
ffff88801f5e9f00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
ffff88801f5e9f80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
>ffff88801f5ea000: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc
^
ffff88801f5ea080: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc
ffff88801f5ea100: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc
==================================================================
---
This report is generated by a bot. It may contain errors.
See
https://goo.gl/tpsmEJ for more information about syzbot.
syzbot engineers can be reached at
syzk...@googlegroups.com.
syzbot will keep track of this issue. See:
https://goo.gl/tpsmEJ#status for how to communicate with syzbot.
If the report is already addressed, let syzbot know by replying with:
#syz fix: exact-commit-title
If you want to overwrite report's subsystems, reply with:
#syz set subsystems: new-subsystem
(See the list of subsystem names on the web dashboard)
If the report is a duplicate of another one, reply with:
#syz dup: exact-subject-of-another-report
If you want to undo deduplication, reply with:
#syz undup