KASAN: use-after-free Read in link_path_walk

Status: upstream: reported C repro on 2026/07/22 21:01
Reported-by: syzbot+d9bf512fedce60a8ce51@syzkaller.appspotmail.com
First crash: 5d15h, last: 5d15h
Similar bugs (4)
Kernel Title Rank 🛈 Repro Cause bisect Fix bisect Count Last Reported Patched Status
android-44 KASAN: use-after-free Read in link_path_walk 19 17 2914d 3110d 0/2 auto-closed as invalid on 2019/02/22 12:34
android-414 KASAN: use-after-free Read in link_path_walk 19 syz 2 2720d 2663d 0/1 public: reported syz repro on 2019/04/13 00:01
upstream KASAN: use-after-free Read in link_path_walk fs 19 syz done 5 2783d 2798d 12/29 fixed on 2019/04/12 08:05
android-49 KASAN: use-after-free Read in link_path_walk 19 C 56 2915d 2665d 0/3 public: reported C repro on 2019/04/11 08:44

Sample crash report:
==================================================================
BUG: KASAN: use-after-free in link_path_walk+0x9e7/0xeb0 fs/namei.c:2281
Read of size 1 at addr ffff88810d5a1bb8 by task syz.4.1130/3743

CPU: 0 PID: 3743 Comm: syz.4.1130 Not tainted syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 07/16/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
 __asan_report_load1_noabort+0x14/0x20 mm/kasan/report_generic.c:348
 link_path_walk+0x9e7/0xeb0 fs/namei.c:2281
 path_parentat fs/namei.c:2533 [inline]
 __filename_parentat+0x22d/0x650 fs/namei.c:2557
 filename_parentat fs/namei.c:2575 [inline]
 do_unlinkat+0xeb/0x6c0 fs/namei.c:4368
 __do_sys_unlinkat fs/namei.c:4440 [inline]
 __se_sys_unlinkat fs/namei.c:4433 [inline]
 __x64_sys_unlinkat+0xd8/0xf0 fs/namei.c:4433
 x64_sys_call+0x79f/0x9a0 arch/x86/include/generated/asm/syscalls_64.h:264
 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:0x7f9eb8b9de99
Code: ff c3 66 2e 0f 1f 84 00 00 00 00 00 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 e8 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007f9eb9a9d028 EFLAGS: 00000246 ORIG_RAX: 0000000000000107
RAX: ffffffffffffffda RBX: 00007f9eb8e25fa0 RCX: 00007f9eb8b9de99
RDX: 0000000000000000 RSI: 00002000000001c0 RDI: 0000000000000004
RBP: 00007f9eb8c33eaf R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
R13: 00007f9eb8e26038 R14: 00007f9eb8e25fa0 R15: 00007fff1ea1d008
 </TASK>

Allocated by task 3743:
 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_kmalloc mm/kasan/common.c:380 [inline]
 __kasan_kmalloc+0x95/0xb0 mm/kasan/common.c:389
 kasan_kmalloc include/linux/kasan.h:212 [inline]
 __do_kmalloc_node mm/slab_common.c:938 [inline]
 __kmalloc_node_track_caller+0xb1/0x1e0 mm/slab_common.c:958
 kstrdup+0x3b/0x80 mm/util.c:66
 bpf_symlink+0x2c/0x270 kernel/bpf/inode.c:388
 vfs_symlink+0x261/0x3f0 fs/namei.c:4478
 do_symlinkat+0x24a/0x5d0 fs/namei.c:4507
 __do_sys_symlinkat fs/namei.c:4524 [inline]
 __se_sys_symlinkat fs/namei.c:4521 [inline]
 __x64_sys_symlinkat+0x99/0xb0 fs/namei.c:4521
 x64_sys_call+0x282/0x9a0 arch/x86/include/generated/asm/syscalls_64.h:267
 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 3752:
 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+0xb7/0x1b0 mm/slub.c:3728
 kfree+0x6f/0xf0 mm/slab_common.c:990
 bpf_destroy_inode+0x7a/0x170 kernel/bpf/inode.c:618
 destroy_inode fs/inode.c:314 [inline]
 evict+0x7ac/0x8c0 fs/inode.c:724
 iput_final fs/inode.c:1845 [inline]
 iput+0x633/0x690 fs/inode.c:1871
 do_unlinkat+0x380/0x6c0 fs/namei.c:4404
 __do_sys_unlinkat fs/namei.c:4440 [inline]
 __se_sys_unlinkat fs/namei.c:4433 [inline]
 __x64_sys_unlinkat+0xd8/0xf0 fs/namei.c:4433
 x64_sys_call+0x79f/0x9a0 arch/x86/include/generated/asm/syscalls_64.h:264
 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 ffff88810d5a1bb8
 which belongs to the cache kmalloc-8 of size 8
The buggy address is located 0 bytes inside of
 8-byte region [ffff88810d5a1bb8, ffff88810d5a1bc0)

The buggy address belongs to the physical page:
page:ffffea0004356840 refcount:1 mapcount:0 mapping:0000000000000000 index:0xffff88810d5a1a28 pfn:0x10d5a1
flags: 0x4000000000000200(slab|zone=1)
raw: 4000000000000200 ffffea00043a5ec0 dead000000000003 ffff888100042300
raw: ffff88810d5a1a28 0000000080660065 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 0x112cc0(GFP_USER|__GFP_NOWARN|__GFP_NORETRY), pid 1526, tgid 1524 (syz.5.394), ts 29819241519, free_ts 29813103378
 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+0x204/0x2d0 mm/slub.c:3423
 kmalloc_trace+0x29/0xb0 mm/slab_common.c:1028
 kmalloc include/linux/slab.h:563 [inline]
 kzalloc include/linux/slab.h:699 [inline]
 bpf_init_fs_context+0x4f/0xe0 kernel/bpf/inode.c:787
 alloc_fs_context+0x653/0x7d0 fs/fs_context.c:290
 fs_context_for_mount+0x22/0x30 fs/fs_context.c:304
 __do_sys_fsopen fs/fsopen.c:143 [inline]
 __se_sys_fsopen+0xa3/0x2f0 fs/fsopen.c:121
 __x64_sys_fsopen+0x5b/0x70 fs/fsopen.c:121
 x64_sys_call+0x537/0x9a0 arch/x86/include/generated/asm/syscalls_64.h:431
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
 get_signal+0x167c/0x1700 kernel/signal.c:2895
 arch_do_signal_or_restart+0xd1/0x11c0 arch/x86/kernel/signal.c:871
 exit_to_user_mode_loop+0x7a/0xb0 kernel/entry/common.c:174
 exit_to_user_mode_prepare+0x87/0xd0 kernel/entry/common.c:210
 __syscall_exit_to_user_mode_work kernel/entry/common.c:292 [inline]
 syscall_exit_to_user_mode+0x1a/0x30 kernel/entry/common.c:303
 do_syscall_64+0x58/0xa0 arch/x86/entry/common.c:82

Memory state around the buggy address:
 ffff88810d5a1a80: fc fc fc fc fa fc fc fc fc fa fc fc fc fc 05 fc
 ffff88810d5a1b00: fc fc fc fa fc fc fc fc fa fc fc fc fc fa fc fc
>ffff88810d5a1b80: fc fc fa fc fc fc fc fa fc fc fc fc fb fc fc fc
                                        ^
 ffff88810d5a1c00: fc fa fc fc fc fc fa fc fc fc fc fa fc fc fc fc
 ffff88810d5a1c80: fa fc fc fc fc fa fc fc fc fc fa fc fc fc fc fa
==================================================================

Crashes (1):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2026/07/22 21:00 android14-6.1 92668decd5e0 4a865b71 .config console log report syz / log C [disk image] [vmlinux] [kernel image] ci2-android-6-1 KASAN: use-after-free Read in link_path_walk
* Struck through repros no longer work on HEAD.