KASAN: use-after-free Read in ext4_read_inline_dir (2)

Status: upstream: reported C repro on 2024/12/31 16:48
Bug presence: origin:upstream
[Documentation on labels]
Reported-by: syzbot+ac63730e8e5e21567ff1@syzkaller.appspotmail.com
First crash: 594d, last: 1d23h
Fix bisection: failed (error log, bisect log)
  
Bug presence (2)
Date Name Commit Repro Result
2025/01/04 lts (merge base) b67dc5c9ade9 C [report] KASAN: out-of-bounds Read in ext4_read_inline_dir
2025/01/04 upstream (ToT) 63676eefb7a0 C [report] KASAN: use-after-free Read in ext4_read_inline_data
Similar bugs (4)
Kernel Title Rank 🛈 Repro Cause bisect Fix bisect Count Last Reported Patched Status
android-6-1 KASAN: use-after-free Read in ext4_read_inline_dir 19 1 748d 748d 0/2 auto-obsoleted due to no activity on 2024/10/28 03:11
android-5-15 KASAN: use-after-free Read in ext4_read_inline_dir origin:upstream 19 syz, C error 7 10d 587d 0/2 upstream: reported C repro on 2025/01/07 14:17
android-5-10 KASAN: slab-out-of-bounds Read in ext4_read_inline_dir 19 syz, C error 5 30d 392d 0/2 upstream: reported C repro on 2025/07/21 09:03
upstream KASAN: slab-out-of-bounds Read in ext4_read_inline_dir ext4 19 syz, C done error 79 310d 750d 0/29 auto-obsoleted due to no activity on 2026/01/25 02:41
Last patch testing requests (6)
Created Duration User Patch Repo Result
2026/07/05 14:54 16m retest repro android14-6.1 log
2026/07/05 14:54 13m retest repro android14-6.1 log
2026/07/05 14:54 13m retest repro android14-6.1 log
2026/06/07 05:30 13m retest repro android14-6.1 log
2026/06/07 05:30 14m retest repro android14-6.1 log
2026/04/24 16:39 21m retest repro android14-6.1 report log
Fix bisection attempts (9)
Created Duration User Patch Repo Result
2026/03/14 04:57 0m bisect fix android14-6.1 error job log
2025/11/19 13:58 1h34m bisect fix android14-6.1 OK (0) job log log
2025/10/17 12:53 1h38m bisect fix android14-6.1 OK (0) job log log
2025/08/25 17:49 2h42m bisect fix android14-6.1 OK (0) job log log
2025/07/22 19:46 1h35m bisect fix android14-6.1 OK (0) job log log
2025/06/03 11:48 1h10m bisect fix android14-6.1 OK (0) job log log
2025/05/03 10:22 2h10m bisect fix android14-6.1 OK (0) job log log
2025/03/19 00:24 1h00m bisect fix android14-6.1 OK (0) job log log
2025/02/15 19:22 51m bisect fix android14-6.1 OK (0) job log log

Sample crash report:
==================================================================
BUG: KASAN: use-after-free in ext4_read_inline_data fs/ext4/inline.c:210 [inline]
BUG: KASAN: use-after-free in ext4_read_inline_dir+0x483/0xd90 fs/ext4/inline.c:1530
Read of size 68 at addr ffff88811094941e by task syz-executor427/306

CPU: 0 PID: 306 Comm: syz-executor427 Not tainted syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 07/24/2026
Call Trace:
 <TASK>
 __dump_stack+0x21/0x24 lib/dump_stack.c:88
 dump_stack_lvl+0x110/0x170 lib/dump_stack.c:106
 print_address_description+0x71/0x200 mm/kasan/report.c:316
 print_report+0x4a/0x60 mm/kasan/report.c:420
 kasan_report+0x122/0x150 mm/kasan/report.c:524
 check_region_inline mm/kasan/generic.c:-1 [inline]
 kasan_check_range+0x249/0x2a0 mm/kasan/generic.c:189
 memcpy+0x2d/0x70 mm/kasan/shadow.c:65
 ext4_read_inline_data fs/ext4/inline.c:210 [inline]
 ext4_read_inline_dir+0x483/0xd90 fs/ext4/inline.c:1530
 ext4_readdir+0x3c2/0x3c10 fs/ext4/dir.c:161
 iterate_dir+0x26d/0x610 fs/readdir.c:-1
 __do_sys_getdents fs/readdir.c:286 [inline]
 __se_sys_getdents+0xf2/0x250 fs/readdir.c:271
 __x64_sys_getdents+0x7b/0x90 fs/readdir.c:271
 x64_sys_call+0x212/0x9a0 arch/x86/include/generated/asm/syscalls_64.h:79
 do_syscall_x64 arch/x86/entry/common.c:46 [inline]
 do_syscall_64+0x4c/0xa0 arch/x86/entry/common.c:76
 entry_SYSCALL_64_after_hwframe+0x68/0xd2
RIP: 0033:0x7f02be311739
Code: c0 79 93 eb d5 48 8d 7c 1d 00 eb 99 0f 1f 44 00 00 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 d8 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007fff6204e9d8 EFLAGS: 00000246 ORIG_RAX: 000000000000004e
RAX: ffffffffffffffda RBX: 0000000000000003 RCX: 00007f02be311739
RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000000000006
RBP: 0000000000000000 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
R13: 0000000000000000 R14: 431bde82d7b634db R15: 00007fff6204ea40
 </TASK>

Allocated by task 103:
 kasan_save_stack mm/kasan/common.c:46 [inline]
 kasan_set_track+0x4b/0x70 mm/kasan/common.c:53
 kasan_save_alloc_info+0x1f/0x30 mm/kasan/generic.c:505
 __kasan_slab_alloc+0x72/0x80 mm/kasan/common.c:334
 kasan_slab_alloc include/linux/kasan.h:202 [inline]
 slab_post_alloc_hook+0x4f/0x2d0 mm/slab.h:768
 slab_alloc_node mm/slub.c:3382 [inline]
 slab_alloc mm/slub.c:3392 [inline]
 __kmem_cache_alloc_lru mm/slub.c:3399 [inline]
 kmem_cache_alloc+0x166/0x320 mm/slub.c:3408
 skb_clone+0x1e8/0x380 net/core/skbuff.c:1663
 do_one_broadcast net/netlink/af_netlink.c:1454 [inline]
 netlink_broadcast+0x698/0x1170 net/netlink/af_netlink.c:1520
 uevent_net_broadcast_untagged lib/kobject_uevent.c:331 [inline]
 kobject_uevent_net_broadcast+0x3cb/0x5b0 lib/kobject_uevent.c:409
 kobject_uevent_env+0x541/0x720 lib/kobject_uevent.c:608
 kobject_synth_uevent+0x457/0x940 lib/kobject_uevent.c:208
 bus_uevent_store+0x4f/0x70 drivers/base/bus.c:765
 bus_attr_store+0x88/0xb0 drivers/base/bus.c:124
 sysfs_kf_write+0x137/0x150 fs/sysfs/file.c:136
 kernfs_fop_write_iter+0x307/0x470 fs/kernfs/file.c:352
 call_write_iter include/linux/fs.h:2282 [inline]
 new_sync_write fs/read_write.c:491 [inline]
 vfs_write+0x5ef/0xd00 fs/read_write.c:584
 ksys_write+0x14a/0x260 fs/read_write.c:637
 __do_sys_write fs/read_write.c:649 [inline]
 __se_sys_write fs/read_write.c:646 [inline]
 __x64_sys_write+0x7b/0x90 fs/read_write.c:646
 x64_sys_call+0x27b/0x9a0 arch/x86/include/generated/asm/syscalls_64.h:2
 do_syscall_x64 arch/x86/entry/common.c:46 [inline]
 do_syscall_64+0x4c/0xa0 arch/x86/entry/common.c:76
 entry_SYSCALL_64_after_hwframe+0x68/0xd2

Freed by task 102:
 kasan_save_stack mm/kasan/common.c:46 [inline]
 kasan_set_track+0x4b/0x70 mm/kasan/common.c:53
 kasan_save_free_info+0x2b/0x40 mm/kasan/generic.c:516
 ____kasan_slab_free+0x132/0x180 mm/kasan/common.c:242
 __kasan_slab_free+0x11/0x20 mm/kasan/common.c:250
 kasan_slab_free include/linux/kasan.h:178 [inline]
 slab_free_hook mm/slub.c:1750 [inline]
 slab_free_freelist_hook+0xc2/0x190 mm/slub.c:1776
 slab_free mm/slub.c:3712 [inline]
 kmem_cache_free+0x12d/0x300 mm/slub.c:3737
 kfree_skbmem+0x10c/0x180 net/core/skbuff.c:-1
 __kfree_skb net/core/skbuff.c:874 [inline]
 consume_skb+0xb3/0x1f0 net/core/skbuff.c:1038
 skb_free_datagram+0x15/0x20 net/core/datagram.c:322
 netlink_recvmsg+0x5e3/0xe00 net/netlink/af_netlink.c:1951
 ____sys_recvmsg+0x2d6/0x5c0 net/socket.c:-1
 ___sys_recvmsg+0x210/0x590 net/socket.c:2769
 __sys_recvmsg net/socket.c:2799 [inline]
 __do_sys_recvmsg net/socket.c:2809 [inline]
 __se_sys_recvmsg net/socket.c:2806 [inline]
 __x64_sys_recvmsg+0x20a/0x2e0 net/socket.c:2806
 x64_sys_call+0x75/0x9a0 arch/x86/include/generated/asm/syscalls_64.h:48
 do_syscall_x64 arch/x86/entry/common.c:46 [inline]
 do_syscall_64+0x4c/0xa0 arch/x86/entry/common.c:76
 entry_SYSCALL_64_after_hwframe+0x68/0xd2

The buggy address belongs to the object at ffff8881109493c0
 which belongs to the cache skbuff_head_cache of size 256
The buggy address is located 94 bytes inside of
 256-byte region [ffff8881109493c0, ffff8881109494c0)

The buggy address belongs to the physical page:
page:ffffea0004425240 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x110949
flags: 0x4000000000000200(slab|zone=1)
raw: 4000000000000200 0000000000000000 dead000000000001 ffff88810885c300
raw: 0000000000000000 00000000000c000c 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 91, tgid 91 (klogd), ts 5552429551, free_ts 5290829218
 set_page_owner include/linux/page_owner.h:33 [inline]
 post_alloc_hook+0x1f5/0x210 mm/page_alloc.c:2672
 prep_new_page+0x1c/0x110 mm/page_alloc.c:2679
 get_page_from_freelist+0x2ca9/0x2d20 mm/page_alloc.c:4586
 __alloc_pages+0x1fa/0x610 mm/page_alloc.c:5930
 alloc_slab_page+0x6e/0xf0 include/linux/gfp.h:-1
 allocate_slab mm/slub.c:1967 [inline]
 new_slab+0x98/0x3e0 mm/slub.c:2020
 ___slab_alloc+0x70f/0xb70 mm/slub.c:3177
 __slab_alloc+0x5e/0xa0 mm/slub.c:3263
 slab_alloc_node mm/slub.c:3348 [inline]
 kmem_cache_alloc_node+0x1ba/0x330 mm/slub.c:3429
 __alloc_skb+0xe8/0x4a0 net/core/skbuff.c:508
 alloc_skb include/linux/skbuff.h:1322 [inline]
 alloc_skb_with_frags+0xa8/0x620 net/core/skbuff.c:6176
 sock_alloc_send_pskb+0x87f/0x9a0 net/core/sock.c:2761
 unix_dgram_sendmsg+0x5c1/0x1710 net/unix/af_unix.c:1947
 sock_sendmsg_nosec net/socket.c:716 [inline]
 __sock_sendmsg net/socket.c:728 [inline]
 __sys_sendto+0x4ac/0x660 net/socket.c:2142
 __do_sys_sendto net/socket.c:2154 [inline]
 __se_sys_sendto net/socket.c:2150 [inline]
 __x64_sys_sendto+0xe5/0x100 net/socket.c:2150
 x64_sys_call+0x83/0x9a0 arch/x86/include/generated/asm/syscalls_64.h:45
page last free stack trace:
 reset_page_owner include/linux/page_owner.h:26 [inline]
 free_pages_prepare mm/page_alloc.c:1580 [inline]
 free_pcp_prepare mm/page_alloc.c:1654 [inline]
 free_unref_page_prepare+0x80c/0x820 mm/page_alloc.c:3621
 free_unref_page_list+0x117/0x8d0 mm/page_alloc.c:3772
 release_pages+0xc7e/0xce0 mm/swap.c:1053
 free_pages_and_swap_cache+0x86/0xa0 mm/swap_state.c:316
 tlb_batch_pages_flush mm/mmu_gather.c:59 [inline]
 tlb_flush_mmu_free mm/mmu_gather.c:254 [inline]
 tlb_flush_mmu mm/mmu_gather.c:261 [inline]
 tlb_finish_mmu+0x1b2/0x380 mm/mmu_gather.c:361
 exit_mmap+0x41d/0xc10 mm/mmap.c:3384
 __mmput+0x92/0x340 kernel/fork.c:1319
 mmput+0x4b/0x150 kernel/fork.c:1343
 exit_mm kernel/exit.c:569 [inline]
 do_exit+0xa51/0x2850 kernel/exit.c:874
 do_group_exit+0x21b/0x2e0 kernel/exit.c:1030
 __do_sys_exit_group kernel/exit.c:1041 [inline]
 __se_sys_exit_group kernel/exit.c:1039 [inline]
 __x64_sys_exit_group+0x3f/0x40 kernel/exit.c:1039
 x64_sys_call+0x7b4/0x9a0 arch/x86/include/generated/asm/syscalls_64.h:232
 do_syscall_x64 arch/x86/entry/common.c:46 [inline]
 do_syscall_64+0x4c/0xa0 arch/x86/entry/common.c:76
 entry_SYSCALL_64_after_hwframe+0x68/0xd2

Memory state around the buggy address:
 ffff888110949300: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
 ffff888110949380: fc fc fc fc fc fc fc fc fa fb fb fb fb fb fb fb
>ffff888110949400: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
                            ^
 ffff888110949480: fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc
 ffff888110949500: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
==================================================================

Crashes (7):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2026/08/15 18:40 android14-6.1 92668decd5e0 746171ee .config strace log report syz / log C [disk image] [vmlinux] [kernel image] [mounted in repro (clean fs)] ci2-android-6-1 KASAN: use-after-free Read in ext4_read_inline_dir
2026/08/15 07:43 android14-6.1 92668decd5e0 746171ee .config console log report syz / log C [disk image] [vmlinux] [kernel image] [mounted in repro (clean fs)] ci2-android-6-1 KASAN: use-after-free Read in ext4_read_inline_dir
2025/12/28 10:30 android14-6.1 5e6db7045704 d6526ea3 .config console log report syz / log C [disk image] [vmlinux] [kernel image] [mounted in repro (corrupt fs)] ci2-android-6-1 KASAN: use-after-free Read in ext4_read_inline_dir
2024/12/31 17:40 android14-6.1 e2b9748880b9 d3ccff63 .config strace log report syz / log C [disk image] [vmlinux] [kernel image] [mounted in repro] ci2-android-6-1 KASAN: use-after-free Read in ext4_read_inline_dir
2024/12/31 16:46 android14-6.1 e2b9748880b9 d3ccff63 .config console log report syz / log C [disk image] [vmlinux] [kernel image] [mounted in repro] ci2-android-6-1 KASAN: use-after-free Read in ext4_read_inline_dir
2025/12/28 11:00 android14-6.1 5e6db7045704 d6526ea3 .config console log report syz / log C [disk image] [vmlinux] [kernel image] [mounted in repro (corrupt fs)] ci2-android-6-1 KASAN: slab-out-of-bounds Read in ext4_read_inline_dir
2024/12/31 17:09 android14-6.1 e2b9748880b9 d3ccff63 .config console log report syz / log [disk image] [vmlinux] [kernel image] [mounted in repro] ci2-android-6-1 KASAN: out-of-bounds Read in ext4_read_inline_dir
* Struck through repros no longer work on HEAD.