syzbot


KASAN: slab-use-after-free Read in kernfs_root

Status: upstream: reported on 2025/06/03 11:10
Subsystems: kernfs
[Documentation on labels]
Reported-by: syzbot+ce1e5a1b4e086b43e56d@syzkaller.appspotmail.com
First crash: 311d, last: 10d
Discussions (1)
Title Replies (including bot) Last reply
[syzbot] [kernfs?] KASAN: slab-use-after-free Read in kernfs_root 0 (1) 2025/06/03 11:10

Sample crash report:
usb 8-1: Direct firmware load for ueagle-atm/eagleI.fw failed with error -2
usb 8-1: Falling back to sysfs fallback for: ueagle-atm/eagleI.fw
==================================================================
BUG: KASAN: slab-use-after-free in kernfs_root+0xda/0x230 fs/kernfs/kernfs-internal.h:76
Read of size 8 at addr ffff8880381cda80 b[ 1589.902117][ T5944] Read of size 8 at addr ffff8880381cda80 by task kworker/1:6/5944

CPU: 1 UID: 0 PID: 5944 Comm: kworker/1:6 Tainted: G             L      syzkaller #0 PREEMPT_{RT,(full)} 
Tainted: [L]=SOFTLOCKUP
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 02/12/2026
Workqueue: events request_firmware_work_func
Call Trace:
 <TASK>
 dump_stack_lvl+0xe8/0x150 lib/dump_stack.c:120
 print_address_description mm/kasan/report.c:378 [inline]
 print_report+0xba/0x230 mm/kasan/report.c:482
 kasan_report+0x117/0x150 mm/kasan/report.c:595
 kernfs_root+0xda/0x230 fs/kernfs/kernfs-internal.h:76
 kernfs_next_descendant_post fs/kernfs/dir.c:1378 [inline]
 kernfs_activate fs/kernfs/dir.c:1433 [inline]
 kernfs_add_one+0x2e1/0x5c0 fs/kernfs/dir.c:839
 kernfs_create_dir_ns+0xde/0x130 fs/kernfs/dir.c:1098
 sysfs_create_dir_ns+0x12f/0x2a0 fs/sysfs/dir.c:59
 create_dir lib/kobject.c:73 [inline]
 kobject_add_internal+0x631/0xd10 lib/kobject.c:240
 kobject_add_varg lib/kobject.c:374 [inline]
 kobject_add+0x163/0x240 lib/kobject.c:426
 class_dir_create_and_add drivers/base/core.c:3234 [inline]
 get_device_parent+0x31d/0x3a0 drivers/base/core.c:3285
 device_add+0x2e1/0xb80 drivers/base/core.c:3615
 fw_load_sysfs_fallback drivers/base/firmware_loader/fallback.c:86 [inline]
 fw_load_from_user_helper drivers/base/firmware_loader/fallback.c:162 [inline]
 firmware_fallback_sysfs+0x2e4/0xa30 drivers/base/firmware_loader/fallback.c:238
 _request_firmware+0x1052/0x1780 drivers/base/firmware_loader/main.c:898
 request_firmware_work_func+0xaf/0x1c0 drivers/base/firmware_loader/main.c:1150
 process_one_work kernel/workqueue.c:3276 [inline]
 process_scheduled_works+0xb6e/0x18c0 kernel/workqueue.c:3359
 worker_thread+0xa53/0xfc0 kernel/workqueue.c:3440
 kthread+0x388/0x470 kernel/kthread.c:436
 ret_from_fork+0x51e/0xb90 arch/x86/kernel/process.c:158
 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:245
 </TASK>

Allocated by task 5944:
 kasan_save_stack mm/kasan/common.c:57 [inline]
 kasan_save_track+0x3e/0x80 mm/kasan/common.c:78
 unpoison_slab_object mm/kasan/common.c:340 [inline]
 __kasan_slab_alloc+0x6c/0x80 mm/kasan/common.c:366
 kasan_slab_alloc include/linux/kasan.h:253 [inline]
 slab_post_alloc_hook mm/slub.c:4538 [inline]
 slab_alloc_node mm/slub.c:4866 [inline]
 kmem_cache_alloc_noprof+0x33b/0x680 mm/slub.c:4873
 __kernfs_new_node+0xe9/0x960 fs/kernfs/dir.c:637
 kernfs_new_node+0x102/0x210 fs/kernfs/dir.c:718
 kernfs_create_dir_ns+0x44/0x130 fs/kernfs/dir.c:1088
 sysfs_create_dir_ns+0x12f/0x2a0 fs/sysfs/dir.c:59
 create_dir lib/kobject.c:73 [inline]
 kobject_add_internal+0x631/0xd10 lib/kobject.c:240
 kobject_add_varg lib/kobject.c:374 [inline]
 kobject_add+0x163/0x240 lib/kobject.c:426
 class_dir_create_and_add drivers/base/core.c:3234 [inline]
 get_device_parent+0x31d/0x3a0 drivers/base/core.c:3285
 device_add+0x2e1/0xb80 drivers/base/core.c:3615
 fw_load_sysfs_fallback drivers/base/firmware_loader/fallback.c:86 [inline]
 fw_load_from_user_helper drivers/base/firmware_loader/fallback.c:162 [inline]
 firmware_fallback_sysfs+0x2e4/0xa30 drivers/base/firmware_loader/fallback.c:238
 _request_firmware+0x1052/0x1780 drivers/base/firmware_loader/main.c:898
 request_firmware_work_func+0xaf/0x1c0 drivers/base/firmware_loader/main.c:1150
 process_one_work kernel/workqueue.c:3276 [inline]
 process_scheduled_works+0xb6e/0x18c0 kernel/workqueue.c:3359
 worker_thread+0xa53/0xfc0 kernel/workqueue.c:3440
 kthread+0x388/0x470 kernel/kthread.c:436
 ret_from_fork+0x51e/0xb90 arch/x86/kernel/process.c:158
 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:245

Freed by task 28:
 kasan_save_stack mm/kasan/common.c:57 [inline]
 kasan_save_track+0x3e/0x80 mm/kasan/common.c:78
 kasan_save_free_info+0x46/0x50 mm/kasan/generic.c:584
 poison_slab_object mm/kasan/common.c:253 [inline]
 __kasan_slab_free+0x5c/0x80 mm/kasan/common.c:285
 kasan_slab_free include/linux/kasan.h:235 [inline]
 slab_free_hook mm/slub.c:2685 [inline]
 slab_free mm/slub.c:6165 [inline]
 kmem_cache_free+0x185/0x6b0 mm/slub.c:6295
 rcu_do_batch kernel/rcu/tree.c:2617 [inline]
 rcu_core kernel/rcu/tree.c:2869 [inline]
 rcu_cpu_kthread+0x99e/0x1470 kernel/rcu/tree.c:2957
 smpboot_thread_fn+0x541/0xa50 kernel/smpboot.c:160
 kthread+0x388/0x470 kernel/kthread.c:436
 ret_from_fork+0x51e/0xb90 arch/x86/kernel/process.c:158
 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:245

Last potentially related work creation:
 kasan_save_stack+0x3e/0x60 mm/kasan/common.c:57
 kasan_record_aux_stack+0xbd/0xd0 mm/kasan/generic.c:556
 __call_rcu_common kernel/rcu/tree.c:3131 [inline]
 call_rcu+0xee/0x890 kernel/rcu/tree.c:3251
 kernfs_put+0x191/0x470 fs/kernfs/dir.c:591
 __kernfs_remove+0x48f/0x660 fs/kernfs/dir.c:1535
 kernfs_remove+0x38/0x60 fs/kernfs/dir.c:1555
 __kobject_del+0xe1/0x330 lib/kobject.c:604
 kobject_del+0x45/0x60 lib/kobject.c:627
 device_del+0x779/0x900 drivers/base/core.c:3900
 usb_disconnect+0x5fb/0x970 drivers/usb/core/hub.c:2376
 hub_port_connect drivers/usb/core/hub.c:5407 [inline]
 hub_port_connect_change drivers/usb/core/hub.c:5707 [inline]
 port_event drivers/usb/core/hub.c:5871 [inline]
 hub_event+0x1cf9/0x4f60 drivers/usb/core/hub.c:5953
 process_one_work kernel/workqueue.c:3276 [inline]
 process_scheduled_works+0xb6e/0x18c0 kernel/workqueue.c:3359
 worker_thread+0xa53/0xfc0 kernel/workqueue.c:3440
 kthread+0x388/0x470 kernel/kthread.c:436
 ret_from_fork+0x51e/0xb90 arch/x86/kernel/process.c:158
 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:245

The buggy address belongs to the object at ffff8880381cda50
 which belongs to the cache kernfs_node_cache of size 176
The buggy address is located 48 bytes inside of
 freed 176-byte region [ffff8880381cda50, ffff8880381cdb00)

The buggy address belongs to the physical page:
page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x381cd
flags: 0x80000000000000(node=0|zone=1)
page_type: f5(slab)
raw: 0080000000000000 ffff88801b2a38c0 dead000000000100 dead000000000122
raw: 0000000000000000 0000000800110011 00000000f5000000 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 0xd2cc0(GFP_KERNEL|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC), pid 5115, tgid 5115 (kworker/u9:1), ts 288244640733, free_ts 288239239091
 set_page_owner include/linux/page_owner.h:32 [inline]
 post_alloc_hook+0x231/0x280 mm/page_alloc.c:1889
 prep_new_page mm/page_alloc.c:1897 [inline]
 get_page_from_freelist+0x28bb/0x2950 mm/page_alloc.c:3962
 __alloc_frozen_pages_noprof+0x18d/0x380 mm/page_alloc.c:5250
 alloc_slab_page mm/slub.c:3292 [inline]
 allocate_slab+0x77/0x660 mm/slub.c:3481
 new_slab mm/slub.c:3539 [inline]
 refill_objects+0x334/0x3c0 mm/slub.c:7175
 refill_sheaf mm/slub.c:2812 [inline]
 __pcs_replace_empty_main+0x35c/0x710 mm/slub.c:4615
 alloc_from_pcs mm/slub.c:4717 [inline]
 slab_alloc_node mm/slub.c:4851 [inline]
 kmem_cache_alloc_noprof+0x433/0x680 mm/slub.c:4873
 __kernfs_new_node+0xe9/0x960 fs/kernfs/dir.c:637
 kernfs_new_node+0x102/0x210 fs/kernfs/dir.c:718
 __kernfs_create_file+0x4b/0x2e0 fs/kernfs/file.c:1057
 sysfs_add_file_mode_ns+0x238/0x300 fs/sysfs/file.c:313
 sysfs_merge_group+0x183/0x320 fs/sysfs/group.c:382
 dpm_sysfs_add+0xd2/0x270 drivers/base/power/sysfs.c:704
 device_add+0x4d8/0xb80 drivers/base/core.c:3651
 hci_conn_add_sysfs+0xd5/0x210 net/bluetooth/hci_sysfs.c:48
 le_conn_complete_evt+0xf1d/0x1430 net/bluetooth/hci_event.c:5842
page last free pid 5115 tgid 5115 stack trace:
 reset_page_owner include/linux/page_owner.h:25 [inline]
 __free_pages_prepare mm/page_alloc.c:1433 [inline]
 __free_frozen_pages+0xfe3/0x1170 mm/page_alloc.c:2978
 __slab_free+0x24f/0x2a0 mm/slub.c:5573
 qlink_free mm/kasan/quarantine.c:163 [inline]
 qlist_free_all+0x97/0x100 mm/kasan/quarantine.c:179
 kasan_quarantine_reduce+0x148/0x160 mm/kasan/quarantine.c:286
 __kasan_slab_alloc+0x22/0x80 mm/kasan/common.c:350
 kasan_slab_alloc include/linux/kasan.h:253 [inline]
 slab_post_alloc_hook mm/slub.c:4538 [inline]
 slab_alloc_node mm/slub.c:4866 [inline]
 __kmalloc_cache_noprof+0x338/0x690 mm/slub.c:5375
 kmalloc_noprof include/linux/slab.h:950 [inline]
 hci_cmd_sync_submit+0xcb/0x2b0 net/bluetooth/hci_sync.c:714
 hci_conn_complete_evt+0xbcc/0x11d0 net/bluetooth/hci_event.c:3223
 hci_event_func net/bluetooth/hci_event.c:7784 [inline]
 hci_event_packet+0x805/0x12c0 net/bluetooth/hci_event.c:7838
 hci_rx_work+0x3ee/0x1030 net/bluetooth/hci_core.c:4077
 process_one_work kernel/workqueue.c:3276 [inline]
 process_scheduled_works+0xb6e/0x18c0 kernel/workqueue.c:3359
 worker_thread+0xa53/0xfc0 kernel/workqueue.c:3440
 kthread+0x388/0x470 kernel/kthread.c:436
 ret_from_fork+0x51e/0xb90 arch/x86/kernel/process.c:158
 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:245

Memory state around the buggy address:
 ffff8880381cd980: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 ffff8880381cda00: 00 00 fc fc fc fc fc fc fc fc fa fb fb fb fb fb
>ffff8880381cda80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
                   ^
 ffff8880381cdb00: fc fc fc fc fc fc fc fc 00 00 00 00 00 00 00 00
 ffff8880381cdb80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 fc fc
==================================================================

Crashes (31):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2026/03/25 22:00 upstream bbeb83d3182a 4367a094 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-smack-root KASAN: slab-use-after-free Read in kernfs_root
2025/12/26 12:02 upstream ccd1cdca5cd4 d6526ea3 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce KASAN: slab-use-after-free Read in kernfs_root
2025/09/16 20:29 upstream 46a51f4f5eda e2beed91 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce KASAN: slab-use-after-free Read in kernfs_root
2025/05/29 12:42 upstream 90b83efa6701 3d2f584d .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce KASAN: slab-use-after-free Read in kernfs_root
2026/03/05 07:58 upstream ecc64d2dc9ff a9fe5c9e .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs general protection fault in kernfs_root
2025/12/04 17:33 upstream 559e608c4655 d6526ea3 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-selinux-root general protection fault in kernfs_root
2025/11/29 16:07 upstream 19eef1d98eed d6526ea3 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-selinux-root general protection fault in kernfs_root
2025/11/13 05:20 upstream e927c520e1ba 07e030de .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-selinux-root general protection fault in kernfs_root
2025/11/08 01:16 upstream 38a2c275c3d3 4e1406b4 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-selinux-root general protection fault in kernfs_root
2025/10/11 20:30 upstream 0739473694c4 ff1712fe .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-selinux-root general protection fault in kernfs_root
2025/09/30 00:04 upstream e5f0a698b34e 86341da6 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-smack-root KASAN: global-out-of-bounds Read in kernfs_root
2025/09/30 00:04 upstream e5f0a698b34e 86341da6 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-smack-root general protection fault in kernfs_root
2025/09/27 15:43 upstream fec734e8d564 001c9061 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-selinux-root KASAN: global-out-of-bounds Read in kernfs_root
2025/09/21 11:32 upstream f975f08c2e89 67c37560 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-smack-root KASAN: global-out-of-bounds Read in kernfs_root
2025/09/20 07:45 upstream cd89d487374c 67c37560 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-selinux-root general protection fault in kernfs_root
2025/08/04 05:29 upstream 3c4a063b1f8a 7368264b .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-selinux-root general protection fault in kernfs_root
2025/07/20 12:45 upstream f4a40a4282f4 7117feec .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-selinux-root general protection fault in kernfs_root
2025/12/03 17:50 upstream 3f9f0252130e d1b870e1 .config console log report info [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu-upstream KASAN: global-out-of-bounds Read in kernfs_root
2025/11/28 23:45 upstream e538109ac71d d1b870e1 .config console log report info [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu-upstream KASAN: slab-out-of-bounds Read in kernfs_root
2025/10/15 01:05 upstream 9b332cece987 b6605ba8 .config console log report info [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu-upstream general protection fault in kernfs_root
2025/08/14 07:19 upstream 91325f31afc1 22ec1469 .config console log report info [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu-upstream KASAN: global-out-of-bounds Read in kernfs_root
2025/07/27 22:07 upstream b711733e89a3 fb8f743d .config console log report info [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu-upstream general protection fault in kernfs_root
2025/12/03 14:38 upstream 44fc84337b6e d1b870e1 .config console log report info [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu-upstream-386 general protection fault in kernfs_root
2025/11/29 07:52 upstream 19eef1d98eed d1b870e1 .config console log report info [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu-upstream-386 general protection fault in kernfs_root
2025/11/06 08:24 upstream dc77806cf3b4 a6c9c731 .config console log report info [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu-upstream-386 general protection fault in kernfs_root
2025/09/11 07:53 upstream 7aac71907bde fdeaa69b .config console log report info [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu-upstream-386 general protection fault in kernfs_root
2025/08/21 21:27 upstream 32b7144f806e 3e79b825 .config console log report info [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu-upstream-386 general protection fault in kernfs_root
2025/08/21 03:51 upstream 41cd3fd15263 0b9605c8 .config console log report info [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu-upstream-386 general protection fault in kernfs_root
2025/08/20 11:46 upstream b19a97d57c15 bd178e57 .config console log report info [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu-upstream-386 KASAN: slab-out-of-bounds Read in kernfs_root
2025/09/25 15:37 linux-next b5a4da2c459f 0abd0691 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root KASAN: global-out-of-bounds Read in kernfs_root
2025/07/18 07:55 linux-next 024e09e444bd 0d1223f1 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root KASAN: global-out-of-bounds Read in kernfs_root
* Struck through repros no longer work on HEAD.