[Android 5.10] KASAN: use-after-free Write in config_item_get

0 views
Skip to first unread message

syzbot

unread,
Jul 26, 2026, 4:05:35 PM (2 days ago) Jul 26
to syzkaller-a...@googlegroups.com
Hello,

syzbot found the following issue on:

HEAD commit: 50b3a256e550 Merge 5.10.260 into android13-5.10-lts
git tree: android13-5.10-lts
console output: https://syzkaller.appspot.com/x/log.txt?x=107ca7b1580000
kernel config: https://syzkaller.appspot.com/x/.config?x=57bdfa4a173e5087
dashboard link: https://syzkaller.appspot.com/bug?extid=54306154561c48ff71a9
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=10cf3fde580000
C reproducer: https://syzkaller.appspot.com/x/repro.c?x=10f8c6b9580000

Downloadable assets:
disk image: https://storage.googleapis.com/syzbot-assets/34994db436ce/disk-50b3a256.raw.xz
vmlinux: https://storage.googleapis.com/syzbot-assets/7855257a6b73/vmlinux-50b3a256.xz
kernel image: https://storage.googleapis.com/syzbot-assets/6367ad2e120a/bzImage-50b3a256.xz

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

==================================================================
BUG: KASAN: use-after-free in instrument_atomic_read_write include/linux/instrumented.h:101 [inline]
BUG: KASAN: use-after-free in atomic_fetch_add_relaxed include/asm-generic/atomic-instrumented.h:142 [inline]
BUG: KASAN: use-after-free in __refcount_add include/linux/refcount.h:193 [inline]
BUG: KASAN: use-after-free in __refcount_inc include/linux/refcount.h:250 [inline]
BUG: KASAN: use-after-free in refcount_inc include/linux/refcount.h:267 [inline]
BUG: KASAN: use-after-free in kref_get include/linux/kref.h:45 [inline]
BUG: KASAN: use-after-free in config_item_get+0x27/0x90 fs/configfs/item.c:106
Write of size 4 at addr ffff888117121c24 by task syz.1.64/520

CPU: 0 PID: 520 Comm: syz.1.64 Tainted: G W syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 07/16/2026
Call Trace:
__dump_stack+0x21/0x24 lib/dump_stack.c:77
dump_stack_lvl+0x1a7/0x208 lib/dump_stack.c:118
print_address_description+0x7f/0x2c0 mm/kasan/report.c:248
__kasan_report mm/kasan/report.c:435 [inline]
kasan_report+0x100/0x140 mm/kasan/report.c:452
check_region_inline mm/kasan/generic.c:-1 [inline]
kasan_check_range+0x249/0x2a0 mm/kasan/generic.c:189
__kasan_check_write+0x14/0x20 mm/kasan/shadow.c:37
instrument_atomic_read_write include/linux/instrumented.h:101 [inline]
atomic_fetch_add_relaxed include/asm-generic/atomic-instrumented.h:142 [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+0x27/0x90 fs/configfs/item.c:106
configfs_get_config_item fs/configfs/configfs_internal.h:128 [inline]
get_target fs/configfs/symlink.c:127 [inline]
configfs_symlink+0x44f/0x1320 fs/configfs/symlink.c:192
vfs_symlink+0x339/0x4c0 fs/namei.c:4107
do_symlinkat+0x10e/0x3d0 fs/namei.c:4134
__do_sys_symlinkat fs/namei.c:4148 [inline]
__se_sys_symlinkat fs/namei.c:4145 [inline]
__x64_sys_symlinkat+0x7b/0x90 fs/namei.c:4145
do_syscall_64+0x31/0x40 arch/x86/entry/common.c:46
entry_SYSCALL_64_after_hwframe+0x61/0xcb
RIP: 0033:0x7f83dd3fbe99
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:00007f83dd23c028 EFLAGS: 00000246 ORIG_RAX: 000000000000010a
RAX: ffffffffffffffda RBX: 00007f83dd684090 RCX: 00007f83dd3fbe99
RDX: 0000200000000300 RSI: ffffffffffffff9c RDI: 0000200000000200
RBP: 00007f83dd491eaf R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
R13: 00007f83dd684128 R14: 00007f83dd684090 R15: 00007ffc30d2f6e8

Allocated by task 513:
kasan_save_stack mm/kasan/common.c:38 [inline]
kasan_set_track mm/kasan/common.c:45 [inline]
set_alloc_info mm/kasan/common.c:430 [inline]
____kasan_kmalloc mm/kasan/common.c:509 [inline]
__kasan_kmalloc+0xd4/0x100 mm/kasan/common.c:518
kasan_kmalloc include/linux/kasan.h:254 [inline]
kmem_cache_alloc_trace+0x179/0x2e0 mm/slub.c:2979
kmalloc include/linux/slab.h:555 [inline]
kzalloc include/linux/slab.h:667 [inline]
fsg_alloc_inst+0x61/0x5a0 drivers/usb/gadget/function/f_mass_storage.c:3377
try_get_usb_function_instance drivers/usb/gadget/functions.c:28 [inline]
usb_get_function_instance+0xe2/0x2f0 drivers/usb/gadget/functions.c:44
function_make+0x118/0x350 drivers/usb/gadget/configfs.c:636
configfs_mkdir+0x5d2/0xd90 fs/configfs/dir.c:1354
vfs_mkdir+0x42c/0x600 fs/namei.c:3798
do_mkdirat+0x14c/0x340 fs/namei.c:3820
__do_sys_mkdirat fs/namei.c:3831 [inline]
__se_sys_mkdirat fs/namei.c:3829 [inline]
__x64_sys_mkdirat+0x7b/0x90 fs/namei.c:3829
do_syscall_64+0x31/0x40 arch/x86/entry/common.c:46
entry_SYSCALL_64_after_hwframe+0x61/0xcb

Freed by task 507:
kasan_save_stack mm/kasan/common.c:38 [inline]
kasan_set_track+0x4a/0x70 mm/kasan/common.c:45
kasan_set_free_info+0x23/0x40 mm/kasan/generic.c:370
____kasan_slab_free+0x125/0x160 mm/kasan/common.c:362
__kasan_slab_free+0x11/0x20 mm/kasan/common.c:370
kasan_slab_free include/linux/kasan.h:220 [inline]
slab_free_hook mm/slub.c:1600 [inline]
slab_free_freelist_hook+0xc5/0x190 mm/slub.c:1626
slab_free mm/slub.c:3208 [inline]
kfree+0xc0/0x270 mm/slub.c:4196
fsg_free_inst+0x33c/0x420 drivers/usb/gadget/function/f_mass_storage.c:3368
usb_put_function_instance+0x85/0xa0 drivers/usb/gadget/functions.c:77
fsg_attr_release+0x15/0x20 drivers/usb/gadget/function/f_mass_storage.c:3254
config_item_cleanup fs/configfs/item.c:130 [inline]
config_item_release fs/configfs/item.c:139 [inline]
kref_put include/linux/kref.h:65 [inline]
config_item_put+0x158/0x210 fs/configfs/item.c:151
configfs_rmdir+0x89f/0x960 fs/configfs/dir.c:1580
vfs_rmdir+0x1ab/0x3c0 fs/namei.c:3860
do_rmdir+0x232/0x630 fs/namei.c:3920
__do_sys_rmdir fs/namei.c:3938 [inline]
__se_sys_rmdir fs/namei.c:3936 [inline]
__x64_sys_rmdir+0x49/0x50 fs/namei.c:3936
do_syscall_64+0x31/0x40 arch/x86/entry/common.c:46
entry_SYSCALL_64_after_hwframe+0x61/0xcb

The buggy address belongs to the object at ffff888117121c00
which belongs to the cache kmalloc-512 of size 512
The buggy address is located 36 bytes inside of
512-byte region [ffff888117121c00, ffff888117121e00)
The buggy address belongs to the page:
page:ffffea00045c4800 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x117120
head:ffffea00045c4800 order:2 compound_mapcount:0 compound_pincount:0
flags: 0x4000000000010200(slab|head)
raw: 4000000000010200 dead000000000100 dead000000000122 ffff888100043080
raw: 0000000000000000 0000000080100010 00000001ffffffff 0000000000000000
page dumped because: kasan: bad access detected
page_owner tracks the page as allocated
page last allocated via order 2, migratetype Unmovable, gfp_mask 0x1d2a20(GFP_ATOMIC|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC|__GFP_HARDWALL), pid 5, ts 39136602689, free_ts 39127611551
set_page_owner include/linux/page_owner.h:35 [inline]
post_alloc_hook mm/page_alloc.c:2456 [inline]
prep_new_page+0x176/0x190 mm/page_alloc.c:2462
get_page_from_freelist+0x225f/0x23f0 mm/page_alloc.c:4254
__alloc_pages_nodemask+0x29a/0x640 mm/page_alloc.c:5384
alloc_slab_page mm/slub.c:-1 [inline]
allocate_slab mm/slub.c:1813 [inline]
new_slab+0x84/0x3f0 mm/slub.c:1874
new_slab_objects mm/slub.c:2632 [inline]
___slab_alloc+0x2f8/0x4c0 mm/slub.c:2796
__slab_alloc+0x63/0xa0 mm/slub.c:2836
slab_alloc_node mm/slub.c:2918 [inline]
slab_alloc mm/slub.c:2960 [inline]
__kmalloc_track_caller+0x1e4/0x310 mm/slub.c:4541
__kmalloc_reserve net/core/skbuff.c:144 [inline]
__alloc_skb+0xdc/0x520 net/core/skbuff.c:212
alloc_skb include/linux/skbuff.h:1126 [inline]
nlmsg_new include/net/netlink.h:953 [inline]
inet6_ifa_notify net/ipv6/addrconf.c:5524 [inline]
__ipv6_ifa_notify+0x200/0xe70 net/ipv6/addrconf.c:6147
ipv6_ifa_notify net/ipv6/addrconf.c:6200 [inline]
addrconf_dad_completed+0x18c/0xe30 net/ipv6/addrconf.c:4247
addrconf_dad_work+0xc5f/0x1480 net/ipv6/addrconf.c:-1
process_one_work+0x6fd/0xbc0 kernel/workqueue.c:2301
worker_thread+0xa8e/0x13c0 kernel/workqueue.c:2447
kthread+0x324/0x3b0 kernel/kthread.c:313
ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:298
page last free stack trace:
reset_page_owner include/linux/page_owner.h:28 [inline]
free_pages_prepare mm/page_alloc.c:1349 [inline]
__free_pages_ok+0x80b/0x830 mm/page_alloc.c:1629
free_the_page mm/page_alloc.c:5445 [inline]
__free_pages+0xd8/0x390 mm/page_alloc.c:5454
__free_slab+0xcf/0x190 mm/slub.c:1899
free_slab mm/slub.c:1914 [inline]
discard_slab mm/slub.c:1920 [inline]
unfreeze_partials+0x150/0x180 mm/slub.c:2415
put_cpu_partial+0xc1/0x180 mm/slub.c:2451
__slab_free+0x2c9/0x3a0 mm/slub.c:3100
do_slab_free mm/slub.c:3196 [inline]
___cache_free+0x10e/0x130 mm/slub.c:3215
qlink_free+0x50/0x90 mm/kasan/quarantine.c:157
qlist_free_all+0x5f/0xb0 mm/kasan/quarantine.c:176
kasan_quarantine_reduce+0x14a/0x160 mm/kasan/quarantine.c:283
__kasan_slab_alloc+0x2f/0xe0 mm/kasan/common.c:440
kasan_slab_alloc include/linux/kasan.h:244 [inline]
slab_post_alloc_hook+0x5d/0x2f0 mm/slab.h:580
slab_alloc_node mm/slub.c:2952 [inline]
slab_alloc mm/slub.c:2960 [inline]
__kmalloc+0x17b/0x330 mm/slub.c:4034
kmalloc include/linux/slab.h:560 [inline]
kernfs_fop_write_iter+0x152/0x400 fs/kernfs/file.c:273
call_write_iter include/linux/fs.h:2066 [inline]
new_sync_write fs/read_write.c:518 [inline]
vfs_write+0x770/0xd70 fs/read_write.c:605
ksys_write+0x14a/0x260 fs/read_write.c:658

Memory state around the buggy address:
ffff888117121b00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
ffff888117121b80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
>ffff888117121c00: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
^
ffff888117121c80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
ffff888117121d00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
==================================================================
------------[ cut here ]------------
refcount_t: saturated; leaking memory.
WARNING: CPU: 0 PID: 520 at lib/refcount.c:22 refcount_warn_saturate+0x158/0x1a0 lib/refcount.c:22
Modules linked in:
CPU: 0 PID: 520 Comm: syz.1.64 Tainted: G B W syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 07/16/2026
RIP: 0010:refcount_warn_saturate+0x158/0x1a0 lib/refcount.c:22
Code: 04 01 48 c7 c7 60 48 40 85 e8 44 ca 3a 02 0f 0b eb 8b e8 3b 89 26 ff c6 05 77 75 82 04 01 48 c7 c7 60 48 40 85 e8 28 ca 3a 02 <0f> 0b e9 6c ff ff ff e8 1c 89 26 ff c6 05 5c 75 82 04 01 48 c7 c7
RSP: 0018:ffffc90002d3fc98 EFLAGS: 00010246
RAX: 185a2832233b4700 RBX: 0000000000000001 RCX: ffff8881172c4f00
RDX: 0000000000000000 RSI: 0000000000000001 RDI: 0000000000000000
RBP: ffffc90002d3fca8 R08: ffffc90002d3f627 R09: fffff520005a7ef8
R10: dffffc0000000000 R11: fffff520005a7ec5 R12: ffff8881151a1648
R13: dffffc0000000000 R14: 0000000000000001 R15: 00000000c0000000
FS: 00007f83dd23c6c0(0000) GS:ffff8881f7000000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00007f83dd23bff8 CR3: 00000001153f9000 CR4: 00000000003506b0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
__refcount_add include/linux/refcount.h:-1 [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+0x8c/0x90 fs/configfs/item.c:106
configfs_get_config_item fs/configfs/configfs_internal.h:128 [inline]
get_target fs/configfs/symlink.c:127 [inline]
configfs_symlink+0x44f/0x1320 fs/configfs/symlink.c:192
vfs_symlink+0x339/0x4c0 fs/namei.c:4107
do_symlinkat+0x10e/0x3d0 fs/namei.c:4134
__do_sys_symlinkat fs/namei.c:4148 [inline]
__se_sys_symlinkat fs/namei.c:4145 [inline]
__x64_sys_symlinkat+0x7b/0x90 fs/namei.c:4145
do_syscall_64+0x31/0x40 arch/x86/entry/common.c:46
entry_SYSCALL_64_after_hwframe+0x61/0xcb
RIP: 0033:0x7f83dd3fbe99
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:00007f83dd23c028 EFLAGS: 00000246 ORIG_RAX: 000000000000010a
RAX: ffffffffffffffda RBX: 00007f83dd684090 RCX: 00007f83dd3fbe99
RDX: 0000200000000300 RSI: ffffffffffffff9c RDI: 0000200000000200
RBP: 00007f83dd491eaf R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
R13: 00007f83dd684128 R14: 00007f83dd684090 R15: 00007ffc30d2f6e8
---[ end trace 6d62fcda428b1a98 ]---


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

syzbot

unread,
6:17 AM (1 hour ago) 6:17 AM
to syzkaller-a...@googlegroups.com
Hello,

syzbot found the following issue on:

HEAD commit: 61d896ee2a80 Revert "hdlc_ppp: sync per-proto timers befor..
git tree: android13-5.15-lts
console output: https://syzkaller.appspot.com/x/log.txt?x=17e50aea580000
kernel config: https://syzkaller.appspot.com/x/.config?x=43676e801f1929a9
dashboard link: https://syzkaller.appspot.com/bug?extid=680594a918d6fb148377
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=15bdd8c6580000
C reproducer: https://syzkaller.appspot.com/x/repro.c?x=10150aea580000

Downloadable assets:
disk image: https://storage.googleapis.com/syzbot-assets/bcb85cf50754/disk-61d896ee.raw.xz
vmlinux: https://storage.googleapis.com/syzbot-assets/7e4ac22ab0e5/vmlinux-61d896ee.xz
kernel image: https://storage.googleapis.com/syzbot-assets/14b47a248e31/bzImage-61d896ee.xz

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

==================================================================
BUG: KASAN: use-after-free in instrument_atomic_read_write include/linux/instrumented.h:101 [inline]
BUG: KASAN: use-after-free in atomic_fetch_add_relaxed include/linux/atomic/atomic-instrumented.h:111 [inline]
BUG: KASAN: use-after-free in __refcount_add include/linux/refcount.h:193 [inline]
BUG: KASAN: use-after-free in __refcount_inc include/linux/refcount.h:250 [inline]
BUG: KASAN: use-after-free in refcount_inc include/linux/refcount.h:267 [inline]
BUG: KASAN: use-after-free in kref_get include/linux/kref.h:45 [inline]
BUG: KASAN: use-after-free in config_item_get+0x27/0x90 fs/configfs/item.c:104
Write of size 4 at addr ffff88811d089c24 by task syz.6.130/509

CPU: 0 PID: 509 Comm: syz.6.130 Tainted: G W syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 07/16/2026
Call Trace:
<TASK>
__dump_stack+0x21/0x30 lib/dump_stack.c:88
dump_stack_lvl+0x110/0x170 lib/dump_stack.c:106
print_address_description+0x7f/0x2c0 mm/kasan/report.c:248
__kasan_report mm/kasan/report.c:427 [inline]
kasan_report+0x10f/0x150 mm/kasan/report.c:444
check_region_inline mm/kasan/generic.c:-1 [inline]
kasan_check_range+0x249/0x2a0 mm/kasan/generic.c:189
__kasan_check_write+0x14/0x20 mm/kasan/shadow.c:37
instrument_atomic_read_write include/linux/instrumented.h:101 [inline]
atomic_fetch_add_relaxed include/linux/atomic/atomic-instrumented.h:111 [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+0x27/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+0x44f/0x1330 fs/configfs/symlink.c:191
vfs_symlink+0x29e/0x470 fs/namei.c:4437
do_symlinkat+0x24a/0x5d0 fs/namei.c:4466
__do_sys_symlinkat fs/namei.c:4483 [inline]
__se_sys_symlinkat fs/namei.c:4480 [inline]
__x64_sys_symlinkat+0x99/0xb0 fs/namei.c:4480
x64_sys_call+0x74b/0x9a0 arch/x86/include/generated/asm/syscalls_64.h:267
do_syscall_x64 arch/x86/entry/common.c:50 [inline]
do_syscall_64+0x4c/0xa0 arch/x86/entry/common.c:80
entry_SYSCALL_64_after_hwframe+0x66/0xd0
RIP: 0033:0x7f4d72a62e99
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:00007ffc5751f038 EFLAGS: 00000246 ORIG_RAX: 000000000000010a
RAX: ffffffffffffffda RBX: 00007f4d72ceafa0 RCX: 00007f4d72a62e99
RDX: 0000200000000300 RSI: ffffffffffffff9c RDI: 0000200000000200
RBP: 00007f4d72af8eaf R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
R13: 00007f4d72ceafac R14: 00007f4d72ceafa0 R15: 00007f4d72ceafa0
</TASK>

Allocated by task 509:
kasan_save_stack mm/kasan/common.c:38 [inline]
kasan_set_track mm/kasan/common.c:45 [inline]
set_alloc_info mm/kasan/common.c:433 [inline]
____kasan_kmalloc mm/kasan/common.c:512 [inline]
__kasan_kmalloc+0xd4/0x100 mm/kasan/common.c:521
kasan_kmalloc include/linux/kasan.h:227 [inline]
kmem_cache_alloc_trace+0x119/0x270 mm/slub.c:3274
kmalloc include/linux/slab.h:619 [inline]
kzalloc include/linux/slab.h:750 [inline]
fsg_alloc_inst+0x61/0x5a0 drivers/usb/gadget/function/f_mass_storage.c:3392
try_get_usb_function_instance drivers/usb/gadget/functions.c:28 [inline]
usb_get_function_instance+0xe2/0x2f0 drivers/usb/gadget/functions.c:44
function_make+0x118/0x350 drivers/usb/gadget/configfs.c:642
configfs_mkdir+0x50a/0x9c0 fs/configfs/dir.c:1329
vfs_mkdir+0x38b/0x590 fs/namei.c:4073
do_mkdirat+0x174/0x4d0 fs/namei.c:4098
__do_sys_mkdirat fs/namei.c:4113 [inline]
__se_sys_mkdirat fs/namei.c:4111 [inline]
__x64_sys_mkdirat+0x89/0xa0 fs/namei.c:4111
x64_sys_call+0x37e/0x9a0 arch/x86/include/generated/asm/syscalls_64.h:259
do_syscall_x64 arch/x86/entry/common.c:50 [inline]
do_syscall_64+0x4c/0xa0 arch/x86/entry/common.c:80
entry_SYSCALL_64_after_hwframe+0x66/0xd0

Freed by task 507:
kasan_save_stack mm/kasan/common.c:38 [inline]
kasan_set_track+0x4a/0x70 mm/kasan/common.c:45
kasan_set_free_info+0x23/0x40 mm/kasan/generic.c:370
____kasan_slab_free+0x125/0x160 mm/kasan/common.c:365
__kasan_slab_free+0x11/0x20 mm/kasan/common.c:373
kasan_slab_free include/linux/kasan.h:193 [inline]
slab_free_hook mm/slub.c:1728 [inline]
slab_free_freelist_hook+0xc2/0x190 mm/slub.c:1754
slab_free mm/slub.c:3526 [inline]
kfree+0xc4/0x270 mm/slub.c:4588
fsg_free_inst+0x33c/0x420 drivers/usb/gadget/function/f_mass_storage.c:3383
usb_put_function_instance+0x85/0xa0 drivers/usb/gadget/functions.c:77
fsg_attr_release+0x15/0x20 drivers/usb/gadget/function/f_mass_storage.c:3269
config_item_cleanup fs/configfs/item.c:128 [inline]
config_item_release fs/configfs/item.c:137 [inline]
kref_put include/linux/kref.h:65 [inline]
config_item_put+0x158/0x210 fs/configfs/item.c:149
configfs_rmdir+0x89f/0x960 fs/configfs/dir.c:1540
vfs_rmdir+0x1ae/0x450 fs/namei.c:4157
do_rmdir+0x261/0x6b0 fs/namei.c:4218
__do_sys_rmdir fs/namei.c:4237 [inline]
__se_sys_rmdir fs/namei.c:4235 [inline]
__x64_sys_rmdir+0x49/0x50 fs/namei.c:4235
x64_sys_call+0x25f/0x9a0 arch/x86/include/generated/asm/syscalls_64.h:85
do_syscall_x64 arch/x86/entry/common.c:50 [inline]
do_syscall_64+0x4c/0xa0 arch/x86/entry/common.c:80
entry_SYSCALL_64_after_hwframe+0x66/0xd0

The buggy address belongs to the object at ffff88811d089c00
which belongs to the cache kmalloc-512 of size 512
The buggy address is located 36 bytes inside of
512-byte region [ffff88811d089c00, ffff88811d089e00)
The buggy address belongs to the page:
page:ffffea0004742200 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x11d088
head:ffffea0004742200 order:2 compound_mapcount:0 compound_pincount:0
flags: 0x4000000000010200(slab|head|zone=1)
raw: 4000000000010200 ffffea0004307f00 0000000400000004 ffff888100042f00
raw: 0000000000000000 0000000000100010 00000001ffffffff 0000000000000000
page dumped because: kasan: bad access detected
page_owner tracks the page as allocated
page last allocated via order 2, migratetype Unmovable, gfp_mask 0xd20c0(__GFP_IO|__GFP_FS|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC), pid 213, ts 10270318087, free_ts 0
set_page_owner include/linux/page_owner.h:33 [inline]
post_alloc_hook+0x192/0x1b0 mm/page_alloc.c:2607
prep_new_page+0x1c/0x110 mm/page_alloc.c:2613
get_page_from_freelist+0x2c3a/0x2cd0 mm/page_alloc.c:4487
__alloc_pages+0x1a2/0x460 mm/page_alloc.c:5824
alloc_slab_page mm/slub.c:-1 [inline]
allocate_slab mm/slub.c:1937 [inline]
new_slab+0xa0/0x4d0 mm/slub.c:2000
___slab_alloc+0x3ac/0x840 mm/slub.c:3033
__slab_alloc+0x49/0x90 mm/slub.c:3120
slab_alloc_node mm/slub.c:3211 [inline]
slab_alloc mm/slub.c:3255 [inline]
kmem_cache_alloc_trace+0x146/0x270 mm/slub.c:3272
kmalloc include/linux/slab.h:619 [inline]
kzalloc include/linux/slab.h:750 [inline]
alloc_bprm+0x59/0x740 fs/exec.c:1530
do_execveat_common+0x1aa/0xab0 fs/exec.c:1922
do_execve fs/exec.c:2041 [inline]
__do_sys_execve fs/exec.c:2117 [inline]
__se_sys_execve fs/exec.c:2112 [inline]
__x64_sys_execve+0x92/0xb0 fs/exec.c:2112
x64_sys_call+0x919/0x9a0 arch/x86/include/generated/asm/syscalls_64.h:60
do_syscall_x64 arch/x86/entry/common.c:50 [inline]
do_syscall_64+0x4c/0xa0 arch/x86/entry/common.c:80
entry_SYSCALL_64_after_hwframe+0x66/0xd0
page_owner free stack trace missing

Memory state around the buggy address:
ffff88811d089b00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
ffff88811d089b80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
>ffff88811d089c00: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
^
ffff88811d089c80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
ffff88811d089d00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
==================================================================
------------[ cut here ]------------
refcount_t: saturated; leaking memory.
WARNING: CPU: 0 PID: 509 at lib/refcount.c:22 refcount_warn_saturate+0x158/0x1a0 lib/refcount.c:22
Modules linked in:
CPU: 0 PID: 509 Comm: syz.6.130 Tainted: G B W syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 07/16/2026
RIP: 0010:refcount_warn_saturate+0x158/0x1a0 lib/refcount.c:22
Code: 04 01 48 c7 c7 60 46 63 85 e8 74 47 5a 02 0f 0b eb 8b e8 0b 80 19 ff c6 05 c6 e9 95 04 01 48 c7 c7 60 46 63 85 e8 58 47 5a 02 <0f> 0b e9 6c ff ff ff e8 ec 7f 19 ff c6 05 ab e9 95 04 01 48 c7 c7
RSP: 0018:ffffc9000292fc58 EFLAGS: 00010246
RAX: 3d70716df1b3ad00 RBX: 0000000000000001 RCX: ffff88811d1262c0
RDX: 0000000000000000 RSI: 0000000000000001 RDI: 0000000000000000
RBP: ffffc9000292fc68 R08: ffffc9000292f6c7 R09: 1ffff92000525ed8
R10: dffffc0000000000 R11: fffff52000525ed9 R12: ffff88811ae0ef30
R13: dffffc0000000000 R14: 0000000000000001 R15: 00000000c0000000
FS: 00005555892be500(0000) GS:ffff8881f7000000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 0000001b34563fff CR3: 000000012c648000 CR4: 00000000003506b0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
<TASK>
__refcount_add include/linux/refcount.h:-1 [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+0x8c/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+0x44f/0x1330 fs/configfs/symlink.c:191
vfs_symlink+0x29e/0x470 fs/namei.c:4437
do_symlinkat+0x24a/0x5d0 fs/namei.c:4466
__do_sys_symlinkat fs/namei.c:4483 [inline]
__se_sys_symlinkat fs/namei.c:4480 [inline]
__x64_sys_symlinkat+0x99/0xb0 fs/namei.c:4480
x64_sys_call+0x74b/0x9a0 arch/x86/include/generated/asm/syscalls_64.h:267
do_syscall_x64 arch/x86/entry/common.c:50 [inline]
do_syscall_64+0x4c/0xa0 arch/x86/entry/common.c:80
entry_SYSCALL_64_after_hwframe+0x66/0xd0
RIP: 0033:0x7f4d72a62e99
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:00007ffc5751f038 EFLAGS: 00000246 ORIG_RAX: 000000000000010a
RAX: ffffffffffffffda RBX: 00007f4d72ceafa0 RCX: 00007f4d72a62e99
RDX: 0000200000000300 RSI: ffffffffffffff9c RDI: 0000200000000200
RBP: 00007f4d72af8eaf R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
R13: 00007f4d72ceafac R14: 00007f4d72ceafa0 R15: 00007f4d72ceafa0
</TASK>
---[ end trace 03656b3da17885ef ]---
------------[ cut here ]------------
refcount_t: underflow; use-after-free.
WARNING: CPU: 0 PID: 509 at lib/refcount.c:28 refcount_warn_saturate+0x120/0x1a0 lib/refcount.c:28
Modules linked in:
CPU: 1 PID: 509 Comm: syz.6.130 Tainted: G B W syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 07/16/2026
RIP: 0010:refcount_warn_saturate+0x120/0x1a0 lib/refcount.c:28
Code: 04 01 48 c7 c7 c0 46 63 85 e8 ac 47 5a 02 0f 0b eb c3 e8 43 80 19 ff c6 05 00 ea 95 04 01 48 c7 c7 20 47 63 85 e8 90 47 5a 02 <0f> 0b eb a7 e8 27 80 19 ff c6 05 e1 e9 95 04 01 48 c7 c7 60 46 63
RSP: 0018:ffffc9000292fc38 EFLAGS: 00010246
RAX: 3d70716df1b3ad00 RBX: 0000000000000003 RCX: ffff88811d1262c0
RDX: 0000000000000000 RSI: 0000000080000000 RDI: 0000000000000000
RBP: ffffc9000292fc48 R08: ffff8881f7032f3f R09: 1ffff1103ee065e7
R10: dffffc0000000000 R11: ffffed103ee065e8 R12: 00000000ffffffea
R13: dffffc0000000000 R14: 0000000000000003 R15: 00000000c0000000
FS: 00005555892be500(0000) GS:ffff8881f7100000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 0000001b33e63fff CR3: 000000012c648000 CR4: 00000000003506a0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
<TASK>
__refcount_sub_and_test include/linux/refcount.h:283 [inline]
__refcount_dec_and_test include/linux/refcount.h:315 [inline]
refcount_dec_and_test include/linux/refcount.h:333 [inline]
kref_put include/linux/kref.h:64 [inline]
config_item_put+0x200/0x210 fs/configfs/item.c:149
configfs_symlink+0x4a6/0x1330 fs/configfs/symlink.c:212
vfs_symlink+0x29e/0x470 fs/namei.c:4437
do_symlinkat+0x24a/0x5d0 fs/namei.c:4466
__do_sys_symlinkat fs/namei.c:4483 [inline]
__se_sys_symlinkat fs/namei.c:4480 [inline]
__x64_sys_symlinkat+0x99/0xb0 fs/namei.c:4480
x64_sys_call+0x74b/0x9a0 arch/x86/include/generated/asm/syscalls_64.h:267
do_syscall_x64 arch/x86/entry/common.c:50 [inline]
do_syscall_64+0x4c/0xa0 arch/x86/entry/common.c:80
entry_SYSCALL_64_after_hwframe+0x66/0xd0
RIP: 0033:0x7f4d72a62e99
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:00007ffc5751f038 EFLAGS: 00000246 ORIG_RAX: 000000000000010a
RAX: ffffffffffffffda RBX: 00007f4d72ceafa0 RCX: 00007f4d72a62e99
RDX: 0000200000000300 RSI: ffffffffffffff9c RDI: 0000200000000200
RBP: 00007f4d72af8eaf R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
R13: 00007f4d72ceafac R14: 00007f4d72ceafa0 R15: 00007f4d72ceafa0
</TASK>
---[ end trace 03656b3da17885f0 ]---
Reply all
Reply to author
Forward
0 new messages