[Android 5.15] KASAN: use-after-free Read in ext4_search_dir

0 views
Skip to first unread message

syzbot

unread,
3:51 AM (16 hours ago) 3:51 AM
to syzkaller-a...@googlegroups.com
Hello,

syzbot found the following issue on:

HEAD commit: b4be5dda13e9 Merge 447ba770cfe7 ("net: tap: NULL pointer d..
git tree: android13-5.15-lts
console output: https://syzkaller.appspot.com/x/log.txt?x=171941ae580000
kernel config: https://syzkaller.appspot.com/x/.config?x=30048ef22650d7ee
dashboard link: https://syzkaller.appspot.com/bug?extid=380275cfdeccde2504de
compiler: Debian clang version 22.1.6 (++20260514074242+fc4aad7b5db3-1~exp1~20260514074407.73), Debian LLD 22.1.6
syz repro: https://syzkaller.appspot.com/x/repro.syz?x=165b06ae580000
C reproducer: https://syzkaller.appspot.com/x/repro.c?x=1206d7b6580000

Downloadable assets:
disk image: https://storage.googleapis.com/syzbot-assets/d8eeee64f824/disk-b4be5dda.raw.xz
vmlinux: https://storage.googleapis.com/syzbot-assets/12acb1da8597/vmlinux-b4be5dda.xz
kernel image: https://storage.googleapis.com/syzbot-assets/df50301ba8bb/bzImage-b4be5dda.xz
mounted in repro #1: https://storage.googleapis.com/syzbot-assets/d2b15d5565d6/mount_0.gz
fsck result: OK (log: https://syzkaller.appspot.com/x/fsck.log?x=1000ebd2580000)
mounted in repro #2: https://storage.googleapis.com/syzbot-assets/87a93d4485f9/mount_7.gz
fsck result: failed (log: https://syzkaller.appspot.com/x/fsck.log?x=110692ae580000)

IMPORTANT: if you fix the issue, please add the following tag to the commit:
Reported-by: syzbot+380275...@syzkaller.appspotmail.com

EXT4-fs (loop2): 1 truncate cleaned up
EXT4-fs (loop2): mounted filesystem without journal. Opts: noblock_validity,max_batch_time=0x0000000000000002,resuid=0x0000000000000000,block_validity,stripe=0x0000000000000009,nombcache,,errors=continue. Quota mode: none.
==================================================================
BUG: KASAN: use-after-free in ext4_search_dir+0xf8/0x1c0 fs/ext4/namei.c:1544
Read of size 1 at addr ffff888111663c86 by task syz.2.18/377

CPU: 0 PID: 377 Comm: syz.2.18 Not tainted syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 05/09/2026
Call Trace:
<TASK>
__dump_stack+0x21/0x30 lib/dump_stack.c:88
dump_stack_lvl+0x110/0x170 lib/dump_stack.c:106
print_address_description+0x7f/0x2c0 mm/kasan/report.c:248
__kasan_report mm/kasan/report.c:427 [inline]
kasan_report+0x10f/0x150 mm/kasan/report.c:444
__asan_report_load1_noabort+0x14/0x20 mm/kasan/report_generic.c:306
ext4_search_dir+0xf8/0x1c0 fs/ext4/namei.c:1544
ext4_find_inline_entry+0x4f2/0x630 fs/ext4/inline.c:1748
__ext4_find_entry+0x307/0x1a10 fs/ext4/namei.c:1617
ext4_lookup_entry fs/ext4/namei.c:1774 [inline]
ext4_lookup+0x382/0x930 fs/ext4/namei.c:1842
lookup_one_qstr_excl+0x114/0x250 fs/namei.c:1571
filename_create+0x23d/0x440 fs/namei.c:3844
do_mkdirat+0x5c/0x4d0 fs/namei.c:4088
__do_sys_mkdirat fs/namei.c:4113 [inline]
__se_sys_mkdirat fs/namei.c:4111 [inline]
__x64_sys_mkdirat+0x89/0xa0 fs/namei.c:4111
x64_sys_call+0x37e/0x9a0 arch/x86/include/generated/asm/syscalls_64.h:259
do_syscall_x64 arch/x86/entry/common.c:50 [inline]
do_syscall_64+0x4c/0xa0 arch/x86/entry/common.c:80
entry_SYSCALL_64_after_hwframe+0x66/0xd0
RIP: 0033:0x7fc2384a2cc7
Code: 00 66 90 48 89 f2 b9 00 01 00 00 48 89 fe bf 9c ff ff ff e9 db f7 ff ff 66 2e 0f 1f 84 00 00 00 00 00 90 b8 02 01 00 00 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 c7 c1 e8 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007fff17604298 EFLAGS: 00000246 ORIG_RAX: 0000000000000102
RAX: ffffffffffffffda RBX: 00007fff17604320 RCX: 00007fc2384a2cc7
RDX: 00000000000001ff RSI: 0000200000000080 RDI: 00000000ffffff9c
RBP: 0000200000000140 R08: 0000200000000080 R09: 0000000000000000
R10: 0000200000000140 R11: 0000000000000246 R12: 0000200000000080
R13: 00007fff176042e0 R14: 0000000000000000 R15: 0000000000000000
</TASK>

Allocated by task 115:
kasan_save_stack mm/kasan/common.c:38 [inline]
kasan_set_track mm/kasan/common.c:45 [inline]
set_alloc_info mm/kasan/common.c:433 [inline]
__kasan_slab_alloc+0xb7/0xe0 mm/kasan/common.c:466
kasan_slab_alloc include/linux/kasan.h:217 [inline]
slab_post_alloc_hook+0x4f/0x2b0 mm/slab.h:550
slab_alloc_node mm/slub.c:3245 [inline]
slab_alloc mm/slub.c:3255 [inline]
kmem_cache_alloc+0xf7/0x260 mm/slub.c:3260
kmem_cache_alloc_node include/linux/slab.h:492 [inline]
__alloc_skb+0xe4/0x730 net/core/skbuff.c:416
alloc_skb include/linux/skbuff.h:1183 [inline]
alloc_uevent_skb+0x85/0x240 lib/kobject_uevent.c:290
uevent_net_broadcast_untagged lib/kobject_uevent.c:326 [inline]
kobject_uevent_net_broadcast+0x335/0x5a0 lib/kobject_uevent.c:409
kobject_uevent_env+0x52b/0x700 lib/kobject_uevent.c:608
kobject_synth_uevent+0x457/0x940 lib/kobject_uevent.c:208
uevent_store+0x25/0x60 drivers/base/core.c:2438
dev_attr_store+0x5e/0x80 drivers/base/core.c:2136
sysfs_kf_write+0x129/0x150 fs/sysfs/file.c:139
kernfs_fop_write_iter+0x2bd/0x400 fs/kernfs/file.c:296
call_write_iter include/linux/fs.h:2212 [inline]
new_sync_write fs/read_write.c:507 [inline]
vfs_write+0x831/0xfd0 fs/read_write.c:594
ksys_write+0x14a/0x260 fs/read_write.c:647
__do_sys_write fs/read_write.c:659 [inline]
__se_sys_write fs/read_write.c:656 [inline]
__x64_sys_write+0x7b/0x90 fs/read_write.c:656
x64_sys_call+0x8ef/0x9a0 arch/x86/include/generated/asm/syscalls_64.h:2
do_syscall_x64 arch/x86/entry/common.c:50 [inline]
do_syscall_64+0x4c/0xa0 arch/x86/entry/common.c:80
entry_SYSCALL_64_after_hwframe+0x66/0xd0

The buggy address belongs to the object at ffff888111663c80
which belongs to the cache skbuff_head_cache of size 248
The buggy address is located 6 bytes inside of
248-byte region [ffff888111663c80, ffff888111663d78)
The buggy address belongs to the page:
page:ffffea00044598c0 refcount:1 mapcount:0 mapping:0000000000000000 index:0xffff888111663b40 pfn:0x111663
flags: 0x4000000000000200(slab|zone=1)
raw: 4000000000000200 ffff88810014a110 ffffea0004459908 ffff8881081ab980
raw: ffff888111663b40 00000000000c0006 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 115, ts 4121907690, free_ts 0
set_page_owner include/linux/page_owner.h:33 [inline]
post_alloc_hook+0x192/0x1b0 mm/page_alloc.c:2605
prep_new_page+0x1c/0x110 mm/page_alloc.c:2611
get_page_from_freelist+0x2c3a/0x2cd0 mm/page_alloc.c:4485
__alloc_pages+0x1a2/0x460 mm/page_alloc.c:5822
alloc_slab_page mm/slub.c:-1 [inline]
allocate_slab mm/slub.c:1937 [inline]
new_slab+0xa0/0x4d0 mm/slub.c:2000
___slab_alloc+0x3ac/0x840 mm/slub.c:3033
__slab_alloc+0x49/0x90 mm/slub.c:3120
slab_alloc_node mm/slub.c:3211 [inline]
slab_alloc mm/slub.c:3255 [inline]
kmem_cache_alloc+0x138/0x260 mm/slub.c:3260
kmem_cache_alloc_node include/linux/slab.h:492 [inline]
__alloc_skb+0xe4/0x730 net/core/skbuff.c:416
alloc_skb include/linux/skbuff.h:1183 [inline]
alloc_uevent_skb+0x85/0x240 lib/kobject_uevent.c:290
uevent_net_broadcast_untagged lib/kobject_uevent.c:326 [inline]
kobject_uevent_net_broadcast+0x335/0x5a0 lib/kobject_uevent.c:409
kobject_uevent_env+0x52b/0x700 lib/kobject_uevent.c:608
kobject_synth_uevent+0x457/0x940 lib/kobject_uevent.c:208
uevent_store+0x25/0x60 drivers/base/core.c:2438
dev_attr_store+0x5e/0x80 drivers/base/core.c:2136
sysfs_kf_write+0x129/0x150 fs/sysfs/file.c:139
page_owner free stack trace missing

Memory state around the buggy address:
ffff888111663b80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
ffff888111663c00: fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc fc
>ffff888111663c80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
^
ffff888111663d00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fc
ffff888111663d80: fc fc fc fc fc fc fc fc fb fb fb fb fb fb fb fb
==================================================================
EXT4-fs error (device loop2): ext4_check_all_de:667: inode #12: block 7: comm syz.2.18: bad entry in directory: directory entry overrun - offset=0, inode=901261600, rec_len=7976, size=124 fake=0


---
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 syzbot to run the reproducer, reply with:
#syz test: git://repo/address.git branch-or-commit-hash
If you attach or paste a git patch, syzbot will apply it before testing.

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
Reply all
Reply to author
Forward
0 new messages