[Android 6.1] KASAN: use-after-free Write in config_item_put

1 view
Skip to first unread message

syzbot

unread,
Aug 19, 2026, 9:54:44 PM (2 days ago) Aug 19
to syzkaller-a...@googlegroups.com
Hello,

syzbot found the following issue on:

HEAD commit: 92668decd5e0 UPSTREAM: locking/rtmutex: Skip remove_waiter..
git tree: android14-6.1
console+strace: https://syzkaller.appspot.com/x/log.txt?x=16d73a25580000
kernel config: https://syzkaller.appspot.com/x/.config?x=6af0777879025b2
dashboard link: https://syzkaller.appspot.com/bug?extid=9409f442e41be28dd4ba
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=13a77815580000
C reproducer: https://syzkaller.appspot.com/x/repro.c?x=1000d679580000

Downloadable assets:
disk image: https://storage.googleapis.com/syzbot-assets/d489fb35aec8/disk-92668dec.raw.xz
vmlinux: https://storage.googleapis.com/syzbot-assets/33e640edad62/vmlinux-92668dec.xz
kernel image: https://storage.googleapis.com/syzbot-assets/e0bb511e52c2/bzImage-92668dec.xz

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

RSP: 002b:00007ffe8987d1a8 EFLAGS: 00000246 ORIG_RAX: 000000000000010a
RAX: ffffffffffffffda RBX: 0000000000009a6b RCX: 00007fe33c1b3169
RDX: 0000200000000300 RSI: 00000000ffffff9c RDI: 0000200000000200
RBP: 0000000000000000 R08: 00007ffe8987d1dc R09: 00007ffe8987d1dc
R10: 00007ffe8987d1dc R11: 0000000000000246 R12: 00007ffe8987d1dc
R13: 00007ffe8987d210 R14: 00007ffe8987d1f0 R15: 000000000000004b
</TASK>
---[ end trace 0000000000000000 ]---
==================================================================
BUG: KASAN: use-after-free in instrument_atomic_read_write include/linux/instrumented.h:102 [inline]
BUG: KASAN: use-after-free in atomic_fetch_sub_release include/linux/atomic/atomic-instrumented.h:176 [inline]
BUG: KASAN: use-after-free in __refcount_sub_and_test include/linux/refcount.h:272 [inline]
BUG: KASAN: use-after-free in __refcount_dec_and_test include/linux/refcount.h:315 [inline]
BUG: KASAN: use-after-free in refcount_dec_and_test include/linux/refcount.h:333 [inline]
BUG: KASAN: use-after-free in kref_put include/linux/kref.h:64 [inline]
BUG: KASAN: use-after-free in config_item_put+0x33/0x210 fs/configfs/item.c:149
Write of size 4 at addr ffff8881187d9c24 by task syz-executor919/710

CPU: 1 PID: 710 Comm: syz-executor919 Tainted: G W syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 07/24/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
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:102 [inline]
atomic_fetch_sub_release include/linux/atomic/atomic-instrumented.h:176 [inline]
__refcount_sub_and_test include/linux/refcount.h:272 [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+0x33/0x210 fs/configfs/item.c:149
configfs_symlink+0x4a6/0x1360 fs/configfs/symlink.c:212
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
RIP: 0033:0x7fe33c1b3169
Code: c0 79 93 eb d5 48 8d 7c 1d 00 eb 99 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 d8 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007ffe8987d1a8 EFLAGS: 00000246 ORIG_RAX: 000000000000010a
RAX: ffffffffffffffda RBX: 0000000000009a6b RCX: 00007fe33c1b3169
RDX: 0000200000000300 RSI: 00000000ffffff9c RDI: 0000200000000200
RBP: 0000000000000000 R08: 00007ffe8987d1dc R09: 00007ffe8987d1dc
R10: 00007ffe8987d1dc R11: 0000000000000246 R12: 00007ffe8987d1dc
R13: 00007ffe8987d210 R14: 00007ffe8987d1f0 R15: 000000000000004b
</TASK>

Allocated by task 708:
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]
kmalloc_trace+0x40/0xb0 mm/slab_common.c:1033
kmalloc include/linux/slab.h:563 [inline]
kzalloc include/linux/slab.h:699 [inline]
fsg_alloc_inst+0x61/0x5a0 drivers/usb/gadget/function/f_mass_storage.c:3504
try_get_usb_function_instance drivers/usb/gadget/functions.c:28 [inline]
usb_get_function_instance+0xf3/0x310 drivers/usb/gadget/functions.c:44
function_make+0x118/0x360 drivers/usb/gadget/configfs.c:652
configfs_mkdir+0x518/0x9e0 fs/configfs/dir.c:1329
vfs_mkdir+0x39c/0x580 fs/namei.c:4113
do_mkdirat+0x174/0x4d0 fs/namei.c:4138
__do_sys_mkdirat fs/namei.c:4153 [inline]
__se_sys_mkdirat fs/namei.c:4151 [inline]
__x64_sys_mkdirat+0x89/0xa0 fs/namei.c:4151
x64_sys_call+0x73d/0x9a0 arch/x86/include/generated/asm/syscalls_64.h:259
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 707:
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
fsg_free_inst+0x33c/0x420 drivers/usb/gadget/function/f_mass_storage.c:3495
usb_put_function_instance+0x9b/0xc0 drivers/usb/gadget/functions.c:77
fsg_attr_release+0x15/0x20 drivers/usb/gadget/function/f_mass_storage.c:3381
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+0x166/0x210 fs/configfs/item.c:149
configfs_rmdir+0x8c9/0x980 fs/configfs/dir.c:1540
vfs_rmdir+0x381/0x4f0 fs/namei.c:4198
do_rmdir+0x261/0x6b0 fs/namei.c:4259
__do_sys_rmdir fs/namei.c:4278 [inline]
__se_sys_rmdir fs/namei.c:4276 [inline]
__x64_sys_rmdir+0x49/0x50 fs/namei.c:4276
x64_sys_call+0x68e/0x9a0 arch/x86/include/generated/asm/syscalls_64.h:85
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 ffff8881187d9c00
which belongs to the cache kmalloc-512 of size 512
The buggy address is located 36 bytes inside of
512-byte region [ffff8881187d9c00, ffff8881187d9e00)

The buggy address belongs to the physical page:
page:ffffea000461f600 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x1187d8
head:ffffea000461f600 order:2 compound_mapcount:0 compound_pincount:0
flags: 0x4000000000010200(slab|head|zone=1)
raw: 4000000000010200 ffffea0004633800 dead000000000002 ffff888100042f00
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 0xd20c0(__GFP_IO|__GFP_FS|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC), pid 114, tgid 114 (udevd), ts 4433795042, free_ts 0
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
__do_kmalloc_node mm/slab_common.c:937 [inline]
__kmalloc_node_track_caller+0xa1/0x1e0 mm/slab_common.c:958
kmalloc_reserve net/core/skbuff.c:449 [inline]
__alloc_skb+0x226/0x4a0 net/core/skbuff.c:518
alloc_skb include/linux/skbuff.h:1322 [inline]
alloc_skb_with_frags+0xa8/0x620 net/core/skbuff.c:6176
sock_alloc_send_pskb+0x87f/0x9a0 net/core/sock.c:2761
unix_dgram_sendmsg+0x5c1/0x1710 net/unix/af_unix.c:1947
sock_sendmsg_nosec net/socket.c:716 [inline]
__sock_sendmsg net/socket.c:728 [inline]
sock_write_iter+0x2ea/0x3f0 net/socket.c:1133
call_write_iter include/linux/fs.h:2282 [inline]
new_sync_write fs/read_write.c:491 [inline]
vfs_write+0x5ef/0xd00 fs/read_write.c:584
page_owner free stack trace missing

Memory state around the buggy address:
ffff8881187d9b00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
ffff8881187d9b80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
>ffff8881187d9c00: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
^
ffff8881187d9c80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
ffff8881187d9d00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
==================================================================
------------[ cut here ]------------
refcount_t: underflow; use-after-free.
WARNING: CPU: 0 PID: 710 at lib/refcount.c:28 refcount_warn_saturate+0x120/0x1a0 lib/refcount.c:28
Modules linked in:
CPU: 0 PID: 710 Comm: syz-executor919 Tainted: G B W syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 07/24/2026
RIP: 0010:refcount_warn_saturate+0x120/0x1a0 lib/refcount.c:28
Code: 05 01 48 c7 c7 80 0c ca 85 e8 bc 28 d9 fe 0f 0b eb c3 e8 13 9a 08 ff c6 05 f4 c9 26 05 01 48 c7 c7 e0 0c ca 85 e8 a0 28 d9 fe <0f> 0b eb a7 e8 f7 99 08 ff c6 05 d5 c9 26 05 01 48 c7 c7 20 0c ca
RSP: 0018:ffffc900016c7c38 EFLAGS: 00010246
RAX: 4276d47f74e7ce00 RBX: 0000000000000003 RCX: ffff888118f69440
RDX: 0000000000000000 RSI: 0000000000000001 RDI: 0000000000000002
RBP: ffffc900016c7c48 R08: ffffc900016c7827 R09: 1ffff920002d8f04
R10: dffffc0000000000 R11: fffff520002d8f05 R12: 00000000ffffffea
R13: dffffc0000000000 R14: 0000000000000003 R15: 00000000c0000000
FS: 000055556cf37480(0000) GS:ffff8881f6e00000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 000055556cf48858 CR3: 0000000114758000 CR4: 00000000003506b0
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+0x20e/0x210 fs/configfs/item.c:149
configfs_symlink+0x4a6/0x1360 fs/configfs/symlink.c:212
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
RIP: 0033:0x7fe33c1b3169
Code: c0 79 93 eb d5 48 8d 7c 1d 00 eb 99 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 d8 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007ffe8987d1a8 EFLAGS: 00000246 ORIG_RAX: 000000000000010a
RAX: ffffffffffffffda RBX: 0000000000009a6b RCX: 00007fe33c1b3169
RDX: 0000200000000300 RSI: 00000000ffffff9c RDI: 0000200000000200
RBP: 0000000000000000 R08: 00007ffe8987d1dc R09: 00007ffe8987d1dc
R10: 00007ffe8987d1dc R11: 0000000000000246 R12: 00007ffe8987d1dc
R13: 00007ffe8987d210 R14: 00007ffe8987d1f0 R15: 000000000000004b
</TASK>
---[ end trace 0000000000000000 ]---


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