syzbot


KASAN: use-after-free Read in kernfs_get (3)

Status: premoderation: reported on 2026/04/16 13:30
Reported-by: syzbot+2b95b71b7a1d99590602@syzkaller.appspotmail.com
First crash: 6d02h, last: 6d02h
Similar bugs (12)
Kernel Title Rank 🛈 Repro Cause bisect Fix bisect Count Last Reported Patched Status
android-6-1 KASAN: use-after-free Write in kernfs_get 22 syz error 8 350d 519d 0/2 auto-obsoleted due to no activity on 2025/08/05 11:00
upstream KASAN: use-after-free Read in kernfs_get kernfs 19 8 1378d 1500d 0/29 auto-obsoleted due to no activity on 2022/11/11 09:18
android-6-1 KASAN: use-after-free Read in kernfs_get (2) origin:downstream 22 syz error 3 116d 201d 0/2 auto-obsoleted due to no activity on 2026/04/05 18:13
android-5-15 KASAN: use-after-free Read in kernfs_get (2) origin:lts 22 syz error 27 73d 646d 0/2 premoderation: reported syz repro on 2024/07/15 05:15
upstream KASAN: use-after-free Read in kernfs_get (2) kernfs 19 2 1160d 1247d 0/29 auto-obsoleted due to no activity on 2023/06/16 19:32
android-5-15 KASAN: use-after-free Read in kernfs_get 19 3 1157d 1281d 0/2 auto-obsoleted due to no activity on 2023/05/20 22:47
android-6-1 KASAN: use-after-free Read in kernfs_get 19 2 617d 662d 0/2 auto-obsoleted due to no activity on 2024/11/11 11:50
linux-5.15 KASAN: use-after-free Read in kernfs_get 19 1 615d 615d 0/3 auto-obsoleted due to no activity on 2024/11/23 10:42
upstream KASAN: slab-use-after-free Read in kernfs_get (3) kernfs 19 1 74d 70d 0/29 auto-obsoleted due to no activity on 2026/04/07 17:10
upstream KASAN: slab-use-after-free Read in kernfs_get kernfs 19 1 796d 796d 0/29 auto-obsoleted due to no activity on 2024/05/26 00:41
android-5-15 KASAN: use-after-free Write in kernfs_get 22 3 912d 999d 0/2 auto-obsoleted due to no activity on 2024/01/21 14:31
upstream KASAN: slab-use-after-free Read in kernfs_get (2) kernfs 19 2 514d 510d 0/29 auto-obsoleted due to no activity on 2025/03/04 15:25

Sample crash report:
==================================================================
BUG: KASAN: use-after-free in instrument_atomic_read include/linux/instrumented.h:72 [inline]
BUG: KASAN: use-after-free in atomic_read include/linux/atomic/atomic-instrumented.h:27 [inline]
BUG: KASAN: use-after-free in kernfs_get+0x21/0x90 fs/kernfs/dir.c:525
Read of size 4 at addr ffff888130a7a898 by task kworker/0:0/6442

CPU: 0 PID: 6442 Comm: kworker/0:0 Tainted: G        W          syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 03/18/2026
Workqueue: events flush_stashed_error_work
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
 __kasan_check_read+0x11/0x20 mm/kasan/shadow.c:31
 instrument_atomic_read include/linux/instrumented.h:72 [inline]
 atomic_read include/linux/atomic/atomic-instrumented.h:27 [inline]
 kernfs_get+0x21/0x90 fs/kernfs/dir.c:525
 sysfs_notify+0x5a/0xd0 fs/sysfs/file.c:187
 ext4_notify_error_sysfs+0x25/0x30 fs/ext4/sysfs.c:518
 flush_stashed_error_work+0x2cb/0x2f0 fs/ext4/super.c:-1
 process_one_work+0x71f/0xc40 kernel/workqueue.c:2302
 worker_thread+0xa29/0x11e0 kernel/workqueue.c:2449
 kthread+0x281/0x320 kernel/kthread.c:386
 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:295
 </TASK>

Allocated by task 9859:
 kasan_save_stack mm/kasan/common.c:46 [inline]
 kasan_set_track+0x4b/0x70 mm/kasan/common.c:53
 kasan_save_alloc_info+0x25/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+0x16e/0x330 mm/slub.c:3408
 kmem_cache_zalloc include/linux/slab.h:689 [inline]
 __kernfs_new_node+0xe3/0x6b0 fs/kernfs/dir.c:614
 kernfs_new_node+0x150/0x260 fs/kernfs/dir.c:690
 kernfs_create_dir_ns+0x47/0x130 fs/kernfs/dir.c:1046
 sysfs_create_dir_ns+0x128/0x290 fs/sysfs/dir.c:59
 create_dir lib/kobject.c:63 [inline]
 kobject_add_internal+0x714/0xc30 lib/kobject.c:231
 kobject_add_varg lib/kobject.c:366 [inline]
 kobject_init_and_add+0x128/0x190 lib/kobject.c:449
 ext4_register_sysfs+0xbb/0x2c0 fs/ext4/sysfs.c:531
 __ext4_fill_super fs/ext4/super.c:5519 [inline]
 ext4_fill_super+0x6a29/0x7590 fs/ext4/super.c:5674
 get_tree_bdev+0x447/0x690 fs/super.c:1371
 ext4_get_tree+0x1c/0x20 fs/ext4/super.c:5704
 vfs_get_tree+0x9a/0x270 fs/super.c:1578
 do_new_mount+0x251/0xb30 fs/namespace.c:3081
 path_mount+0x659/0xfc0 fs/namespace.c:3411
 do_mount fs/namespace.c:3424 [inline]
 __do_sys_mount fs/namespace.c:3632 [inline]
 __se_sys_mount+0x320/0x390 fs/namespace.c:3609
 __x64_sys_mount+0xbf/0xd0 fs/namespace.c:3609
 x64_sys_call+0x65d/0x9a0 arch/x86/include/generated/asm/syscalls_64.h:166
 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 6473:
 kasan_save_stack mm/kasan/common.c:46 [inline]
 kasan_set_track+0x4b/0x70 mm/kasan/common.c:53
 kasan_save_free_info+0x31/0x50 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
 kernfs_put+0x310/0x480 fs/kernfs/dir.c:568
 sysfs_put include/linux/sysfs.h:696 [inline]
 __kobject_del+0xf8/0x2f0 lib/kobject.c:597
 kobject_del+0x45/0x60 lib/kobject.c:619
 ext4_unregister_sysfs+0x91/0xa0 fs/ext4/sysfs.c:565
 ext4_put_super+0x73/0xac0 fs/ext4/super.c:1216
 generic_shutdown_super+0x16c/0x480 fs/super.c:506
 kill_block_super+0x7f/0xf0 fs/super.c:1475
 deactivate_locked_super+0xb5/0x120 fs/super.c:336
 deactivate_super+0xaf/0xe0 fs/super.c:367
 cleanup_mnt+0x474/0x500 fs/namespace.c:1192
 __cleanup_mnt+0x19/0x20 fs/namespace.c:1199
 task_work_run+0x1e1/0x250 kernel/task_work.c:203
 resume_user_mode_work include/linux/resume_user_mode.h:49 [inline]
 exit_to_user_mode_loop+0x9b/0xb0 kernel/entry/common.c:177
 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
 entry_SYSCALL_64_after_hwframe+0x68/0xd2

The buggy address belongs to the object at ffff888130a7a898
 which belongs to the cache kernfs_node_cache of size 136
The buggy address is located 0 bytes inside of
 136-byte region [ffff888130a7a898, ffff888130a7a920)

The buggy address belongs to the physical page:
page:ffffea0004c29e80 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x130a7a
flags: 0x4000000000000200(slab|zone=1)
raw: 4000000000000200 ffffea0004c29d80 dead000000000007 ffff8881001ecf00
raw: 0000000000000000 0000000000140014 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 286, tgid 286 (syz-executor), ts 25790563104, free_ts 0
 set_page_owner include/linux/page_owner.h:33 [inline]
 post_alloc_hook+0x1f5/0x210 mm/page_alloc.c:2670
 prep_new_page+0x1c/0x110 mm/page_alloc.c:2677
 get_page_from_freelist+0x2d12/0x2d80 mm/page_alloc.c:4583
 __alloc_pages+0x1fa/0x610 mm/page_alloc.c:5924
 alloc_slab_page+0x6e/0xf0 include/linux/gfp.h:-1
 allocate_slab mm/slub.c:1967 [inline]
 new_slab+0x98/0x3d0 mm/slub.c:2020
 ___slab_alloc+0x6bd/0xb20 mm/slub.c:3177
 __slab_alloc+0x5e/0xa0 mm/slub.c:3263
 slab_alloc_node mm/slub.c:3348 [inline]
 slab_alloc mm/slub.c:3392 [inline]
 __kmem_cache_alloc_lru mm/slub.c:3399 [inline]
 kmem_cache_alloc+0x1b0/0x330 mm/slub.c:3408
 kmem_cache_zalloc include/linux/slab.h:689 [inline]
 __kernfs_new_node+0xe3/0x6b0 fs/kernfs/dir.c:614
 kernfs_new_node+0x150/0x260 fs/kernfs/dir.c:690
 __kernfs_create_file+0x4e/0x270 fs/kernfs/file.c:1068
 sysfs_add_file_mode_ns+0x1ce/0x270 fs/sysfs/file.c:294
 create_files fs/sysfs/group.c:76 [inline]
 internal_create_group+0x72a/0xf50 fs/sysfs/group.c:176
 internal_create_groups fs/sysfs/group.c:216 [inline]
 sysfs_create_groups+0x58/0x120 fs/sysfs/group.c:242
 create_dir lib/kobject.c:68 [inline]
 kobject_add_internal+0x753/0xc30 lib/kobject.c:231
page_owner free stack trace missing

Memory state around the buggy address:
 ffff888130a7a780: fb fb fc fc fc fc fc fc fc fc fa fb fb fb fb fb
 ffff888130a7a800: fb fb fb fb fb fb fb fb fb fb fb fc fc fc fc fc
>ffff888130a7a880: fc fc fc fa fb fb fb fb fb fb fb fb fb fb fb fb
                            ^
 ffff888130a7a900: fb fb fb fb fc fc fc fc fc fc fc fc fa fb fb fb
 ffff888130a7a980: fb fb fb fb fb fb fb fb fb fb fb fb fb fc fc fc
==================================================================
general protection fault, probably for non-canonical address 0xe0a81c2ac0000333: 0000 [#1] PREEMPT SMP KASAN
KASAN: maybe wild-memory-access in range [0x0541015600001998-0x054101560000199f]
CPU: 0 PID: 6442 Comm: kworker/0:0 Tainted: G    B   W          syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 03/18/2026
Workqueue: events flush_stashed_error_work
RIP: 0010:kernfs_root fs/kernfs/kernfs-internal.h:68 [inline]
RIP: 0010:kernfs_find_and_get_ns+0x54/0x110 fs/kernfs/dir.c:903
Code: 48 89 f8 48 c1 e8 03 42 80 3c 28 00 74 05 e8 13 c9 d5 ff 49 8b 5c 24 08 48 85 db 49 0f 44 dc 48 83 c3 50 48 89 d8 48 c1 e8 03 <42> 80 3c 28 00 74 08 48 89 df e8 ed c8 d5 ff 48 8b 1b 48 83 c3 60
RSP: 0018:ffffc900127e7c60 EFLAGS: 00010206
RAX: 00a8202ac0000333 RBX: 0541015600001999 RCX: ffffffff81e1025d
RDX: 0000000000000000 RSI: 0000000000000008 RDI: ffff888130a7a8a0
RBP: ffffc900127e7c88 R08: 0000000000000003 R09: fffffffffffffffa
R10: dffffc0000000000 R11: ffffed102614f513 R12: ffff888130a7a898
R13: dffffc0000000000 R14: 0000000000000000 R15: ffffffff85b53420
FS:  0000000000000000(0000) GS:ffff8881f6e00000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 0000000000000000 CR3: 0000000133f64000 CR4: 00000000003506b0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
 <TASK>
 kernfs_find_and_get include/linux/kernfs.h:614 [inline]
 sysfs_notify+0x71/0xd0 fs/sysfs/file.c:190
 ext4_notify_error_sysfs+0x25/0x30 fs/ext4/sysfs.c:518
 flush_stashed_error_work+0x2cb/0x2f0 fs/ext4/super.c:-1
 process_one_work+0x71f/0xc40 kernel/workqueue.c:2302
 worker_thread+0xa29/0x11e0 kernel/workqueue.c:2449
 kthread+0x281/0x320 kernel/kthread.c:386
 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:295
 </TASK>
Modules linked in:
---[ end trace 0000000000000000 ]---
RIP: 0010:kernfs_root fs/kernfs/kernfs-internal.h:68 [inline]
RIP: 0010:kernfs_find_and_get_ns+0x54/0x110 fs/kernfs/dir.c:903
Code: 48 89 f8 48 c1 e8 03 42 80 3c 28 00 74 05 e8 13 c9 d5 ff 49 8b 5c 24 08 48 85 db 49 0f 44 dc 48 83 c3 50 48 89 d8 48 c1 e8 03 <42> 80 3c 28 00 74 08 48 89 df e8 ed c8 d5 ff 48 8b 1b 48 83 c3 60
RSP: 0018:ffffc900127e7c60 EFLAGS: 00010206
RAX: 00a8202ac0000333 RBX: 0541015600001999 RCX: ffffffff81e1025d
RDX: 0000000000000000 RSI: 0000000000000008 RDI: ffff888130a7a8a0
RBP: ffffc900127e7c88 R08: 0000000000000003 R09: fffffffffffffffa
R10: dffffc0000000000 R11: ffffed102614f513 R12: ffff888130a7a898
R13: dffffc0000000000 R14: 0000000000000000 R15: ffffffff85b53420
FS:  0000000000000000(0000) GS:ffff8881f6e00000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 000055555f6d0908 CR3: 0000000132c2b000 CR4: 00000000003506b0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
----------------
Code disassembly (best guess):
   0:	48 89 f8             	mov    %rdi,%rax
   3:	48 c1 e8 03          	shr    $0x3,%rax
   7:	42 80 3c 28 00       	cmpb   $0x0,(%rax,%r13,1)
   c:	74 05                	je     0x13
   e:	e8 13 c9 d5 ff       	call   0xffd5c926
  13:	49 8b 5c 24 08       	mov    0x8(%r12),%rbx
  18:	48 85 db             	test   %rbx,%rbx
  1b:	49 0f 44 dc          	cmove  %r12,%rbx
  1f:	48 83 c3 50          	add    $0x50,%rbx
  23:	48 89 d8             	mov    %rbx,%rax
  26:	48 c1 e8 03          	shr    $0x3,%rax
* 2a:	42 80 3c 28 00       	cmpb   $0x0,(%rax,%r13,1) <-- trapping instruction
  2f:	74 08                	je     0x39
  31:	48 89 df             	mov    %rbx,%rdi
  34:	e8 ed c8 d5 ff       	call   0xffd5c926
  39:	48 8b 1b             	mov    (%rbx),%rbx
  3c:	48 83 c3 60          	add    $0x60,%rbx

Crashes (1):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2026/04/16 13:30 android14-6.1 98d5d8f31585 4743f87d .config console log report info [disk image] [vmlinux] [kernel image] ci2-android-6-1 KASAN: use-after-free Read in kernfs_get
* Struck through repros no longer work on HEAD.