[v6.6] KASAN: slab-use-after-free Write in config_item_get

0 views
Skip to first unread message

syzbot

unread,
Aug 8, 2026, 8:32:30 PM (19 hours ago) Aug 8
to syzkaller...@googlegroups.com
Hello,

syzbot found the following issue on:

HEAD commit: 6436c12a2ced Linux 6.6.150
git tree: linux-6.6.y
console output: https://syzkaller.appspot.com/x/log.txt?x=10fdbfb9580000
kernel config: https://syzkaller.appspot.com/x/.config?x=f0bc3d90c30838b5
dashboard link: https://syzkaller.appspot.com/bug?extid=e35c70d30be3155c2901
compiler: Debian clang version 22.1.8 (++20260613092233+e80beda6e255-1~exp1~20260613092250.77), Debian LLD 22.1.8
syz repro: https://syzkaller.appspot.com/x/repro.syz?x=13dc8079580000
C reproducer: https://syzkaller.appspot.com/x/repro.c?x=1609c2c6580000

Downloadable assets:
disk image: https://storage.googleapis.com/syzbot-assets/f01168de2d4b/disk-6436c12a.raw.xz
vmlinux: https://storage.googleapis.com/syzbot-assets/e63b80c9c349/vmlinux-6436c12a.xz
kernel image: https://storage.googleapis.com/syzbot-assets/9297ad58728c/bzImage-6436c12a.xz

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

==================================================================
BUG: KASAN: slab-use-after-free in instrument_atomic_read_write include/linux/instrumented.h:96 [inline]
BUG: KASAN: slab-use-after-free in atomic_fetch_add_relaxed include/linux/atomic/atomic-instrumented.h:252 [inline]
BUG: KASAN: slab-use-after-free in __refcount_add include/linux/refcount.h:193 [inline]
BUG: KASAN: slab-use-after-free in __refcount_inc include/linux/refcount.h:250 [inline]
BUG: KASAN: slab-use-after-free in refcount_inc include/linux/refcount.h:267 [inline]
BUG: KASAN: slab-use-after-free in kref_get include/linux/kref.h:45 [inline]
BUG: KASAN: slab-use-after-free in config_item_get+0x26/0x90 fs/configfs/item.c:104
Write of size 4 at addr ffff88801fbd671c by task syz.1.162/6133

CPU: 0 PID: 6133 Comm: syz.1.162 Not tainted syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 07/24/2026
Call Trace:
<TASK>
dump_stack_lvl+0x18c/0x250 lib/dump_stack.c:106
print_address_description mm/kasan/report.c:364 [inline]
print_report+0xa8/0x210 mm/kasan/report.c:468
kasan_report+0x117/0x150 mm/kasan/report.c:581
check_region_inline mm/kasan/generic.c:-1 [inline]
kasan_check_range+0x241/0x290 mm/kasan/generic.c:187
instrument_atomic_read_write include/linux/instrumented.h:96 [inline]
atomic_fetch_add_relaxed include/linux/atomic/atomic-instrumented.h:252 [inline]
__refcount_add include/linux/refcount.h:193 [inline]
__refcount_inc include/linux/refcount.h:250 [inline]
refcount_inc include/linux/refcount.h:267 [inline]
kref_get include/linux/kref.h:45 [inline]
config_item_get+0x26/0x90 fs/configfs/item.c:104
configfs_get_config_item fs/configfs/configfs_internal.h:128 [inline]
get_target fs/configfs/symlink.c:125 [inline]
configfs_symlink+0x45e/0xfe0 fs/configfs/symlink.c:191
vfs_symlink+0x138/0x2b0 fs/namei.c:4528
do_symlinkat+0x1ba/0x400 fs/namei.c:4554
__do_sys_symlinkat fs/namei.c:4570 [inline]
__se_sys_symlinkat fs/namei.c:4567 [inline]
__x64_sys_symlinkat+0x99/0xb0 fs/namei.c:4567
do_syscall_x64 arch/x86/entry/common.c:46 [inline]
do_syscall_64+0x55/0xb0 arch/x86/entry/common.c:76
entry_SYSCALL_64_after_hwframe+0x68/0xd2
RIP: 0033:0x7f1df299e0d9
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:00007ffcce2e7168 EFLAGS: 00000246 ORIG_RAX: 000000000000010a
RAX: ffffffffffffffda RBX: 00007f1df2c25fa0 RCX: 00007f1df299e0d9
RDX: 0000200000000200 RSI: ffffffffffffff9c RDI: 00002000000001c0
RBP: 00007f1df2a35024 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
R13: 00007f1df2c25fac R14: 00007f1df2c25fa0 R15: 00007f1df2c25fa0
</TASK>

Allocated by task 6131:
kasan_save_stack mm/kasan/common.c:46 [inline]
kasan_set_track+0x4e/0x70 mm/kasan/common.c:53
____kasan_kmalloc mm/kasan/common.c:375 [inline]
__kasan_kmalloc+0x8f/0xa0 mm/kasan/common.c:384
kmalloc include/linux/slab.h:600 [inline]
kzalloc include/linux/slab.h:721 [inline]
phonet_alloc_inst+0x4e/0x180 drivers/usb/gadget/function/f_phonet.c:635
try_get_usb_function_instance drivers/usb/gadget/functions.c:28 [inline]
usb_get_function_instance+0xdd/0x2e0 drivers/usb/gadget/functions.c:44
function_make+0x11c/0x350 drivers/usb/gadget/configfs.c:625
configfs_mkdir+0x515/0x9e0 fs/configfs/dir.c:1360
vfs_mkdir+0x2a5/0x470 fs/namei.c:4168
do_mkdirat+0x1dc/0x450 fs/namei.c:4191
__do_sys_mkdirat fs/namei.c:4206 [inline]
__se_sys_mkdirat fs/namei.c:4204 [inline]
__x64_sys_mkdirat+0x89/0xa0 fs/namei.c:4204
do_syscall_x64 arch/x86/entry/common.c:46 [inline]
do_syscall_64+0x55/0xb0 arch/x86/entry/common.c:76
entry_SYSCALL_64_after_hwframe+0x68/0xd2

Freed by task 6131:
kasan_save_stack mm/kasan/common.c:46 [inline]
kasan_set_track+0x4e/0x70 mm/kasan/common.c:53
kasan_save_free_info+0x28/0x40 mm/kasan/generic.c:522
____kasan_slab_free+0x126/0x1f0 mm/kasan/common.c:237
kasan_slab_free include/linux/kasan.h:164 [inline]
slab_free_hook mm/slub.c:1811 [inline]
slab_free_freelist_hook+0x130/0x1a0 mm/slub.c:1837
slab_free mm/slub.c:3830 [inline]
__kmem_cache_free+0xba/0x1f0 mm/slub.c:3843
usb_put_function_instance+0x85/0xa0 drivers/usb/gadget/functions.c:77
config_item_cleanup fs/configfs/item.c:128 [inline]
config_item_release+0x133/0x290 fs/configfs/item.c:137
configfs_rmdir+0x8c1/0x980 fs/configfs/dir.c:1571
vfs_rmdir+0x352/0x4b0 fs/namei.c:4251
do_rmdir+0x29f/0x590 fs/namei.c:4310
__do_sys_rmdir fs/namei.c:4329 [inline]
__se_sys_rmdir fs/namei.c:4327 [inline]
__x64_sys_rmdir+0x49/0x50 fs/namei.c:4327
do_syscall_x64 arch/x86/entry/common.c:46 [inline]
do_syscall_64+0x55/0xb0 arch/x86/entry/common.c:76
entry_SYSCALL_64_after_hwframe+0x68/0xd2

Last potentially related work creation:
kasan_save_stack+0x3e/0x60 mm/kasan/common.c:46
__kasan_record_aux_stack+0xaf/0xc0 mm/kasan/generic.c:492
insert_work+0x3d/0x310 kernel/workqueue.c:1674
__queue_work+0xbfd/0xfd0 kernel/workqueue.c:1823
queue_work_on+0x128/0x1f0 kernel/workqueue.c:1858
queue_work include/linux/workqueue.h:564 [inline]
netdevice_queue_work drivers/infiniband/core/roce_gid_mgmt.c:658 [inline]
netdevice_event+0x755/0x890 drivers/infiniband/core/roce_gid_mgmt.c:801
notifier_call_chain+0x18f/0x380 kernel/notifier.c:93
call_netdevice_notifiers_extack net/core/dev.c:2077 [inline]
call_netdevice_notifiers net/core/dev.c:2091 [inline]
unregister_netdevice_many_notify+0x1037/0x1910 net/core/dev.c:11124
unregister_netdevice_many net/core/dev.c:11180 [inline]
default_device_exit_batch+0x962/0xa00 net/core/dev.c:11746
ops_exit_list net/core/net_namespace.c:178 [inline]
cleanup_net+0x792/0xbb0 net/core/net_namespace.c:652
process_one_work kernel/workqueue.c:2657 [inline]
process_scheduled_works+0xa60/0x1600 kernel/workqueue.c:2734
worker_thread+0xa5e/0xfe0 kernel/workqueue.c:2815
kthread+0x2fa/0x390 kernel/kthread.c:388
ret_from_fork+0x48/0x80 arch/x86/kernel/process.c:152
ret_from_fork_asm+0x11/0x20 arch/x86/entry/entry_64.S:293

The buggy address belongs to the object at ffff88801fbd6700
which belongs to the cache kmalloc-192 of size 192
The buggy address is located 28 bytes inside of
freed 192-byte region [ffff88801fbd6700, ffff88801fbd67c0)

The buggy address belongs to the physical page:
page:ffffea00007ef580 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x1fbd6
ksm flags: 0xfff00000000800(slab|node=0|zone=1|lastcpupid=0x7ff)
page_type: 0xffffffff()
raw: 00fff00000000800 ffff888017c41a00 ffffea0000863cc0 dead000000000003
raw: 0000000000000000 0000000080100010 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 1, tgid 1 (swapper/0), ts 8854793161, free_ts 8841164574
set_page_owner include/linux/page_owner.h:31 [inline]
post_alloc_hook+0x1c1/0x200 mm/page_alloc.c:1582
prep_new_page mm/page_alloc.c:1589 [inline]
get_page_from_freelist+0x2181/0x22a0 mm/page_alloc.c:3221
__alloc_pages+0x1f0/0x460 mm/page_alloc.c:4501
alloc_page_interleave+0x24/0x1e0 mm/mempolicy.c:2118
alloc_slab_page+0x5d/0x180 mm/slub.c:1881
allocate_slab mm/slub.c:2028 [inline]
new_slab+0x87/0x2d0 mm/slub.c:2081
___slab_alloc+0xc5c/0x12f0 mm/slub.c:3253
__slab_alloc mm/slub.c:3339 [inline]
__slab_alloc_node mm/slub.c:3392 [inline]
slab_alloc_node mm/slub.c:3485 [inline]
__kmem_cache_alloc_node+0x11f/0x250 mm/slub.c:3534
kmalloc_trace+0x2a/0xe0 mm/slab_common.c:1098
kmalloc include/linux/slab.h:600 [inline]
kzalloc include/linux/slab.h:721 [inline]
call_usermodehelper_setup+0x8e/0x260 kernel/umh.c:363
kobject_uevent_env+0x661/0x890 lib/kobject_uevent.c:629
device_add+0x5d5/0xc40 drivers/base/core.c:3666
platform_device_add+0x4c3/0x830 drivers/base/platform.c:716
platform_device_register_full+0x472/0x560 drivers/base/platform.c:843
platform_device_register_resndata include/linux/platform_device.h:164 [inline]
platform_device_register_simple include/linux/platform_device.h:193 [inline]
vkms_create drivers/gpu/drm/vkms/vkms_drv.c:182 [inline]
vkms_init+0x194/0x780 drivers/gpu/drm/vkms/vkms_drv.c:250
do_one_initcall+0x242/0x790 init/main.c:1210
page last free stack trace:
reset_page_owner include/linux/page_owner.h:24 [inline]
free_pages_prepare mm/page_alloc.c:1182 [inline]
free_unref_page_prepare+0x7d7/0x8f0 mm/page_alloc.c:2366
free_unref_page_list+0xbe/0x860 mm/page_alloc.c:2505
release_pages+0x208a/0x2300 mm/swap.c:1022
tlb_batch_pages_flush mm/mmu_gather.c:99 [inline]
tlb_flush_mmu_free mm/mmu_gather.c:294 [inline]
tlb_flush_mmu+0x379/0x510 mm/mmu_gather.c:301
tlb_finish_mmu+0xf4/0x220 mm/mmu_gather.c:425
exit_mmap+0x428/0xb90 mm/mmap.c:3315
__mmput+0x118/0x3a0 kernel/fork.c:1362
free_bprm+0x144/0x390 fs/exec.c:1514
kernel_execve+0x3e9/0x980 fs/exec.c:2060
call_usermodehelper_exec_async+0x20b/0x350 kernel/umh.c:110
ret_from_fork+0x48/0x80 arch/x86/kernel/process.c:152
ret_from_fork_asm+0x11/0x20 arch/x86/entry/entry_64.S:293

Memory state around the buggy address:
ffff88801fbd6600: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
ffff88801fbd6680: fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc
>ffff88801fbd6700: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
^
ffff88801fbd6780: fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc
ffff88801fbd6800: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
==================================================================


---
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