[Android 6.1] KASAN: invalid-free in f_uac2_opts_c_srate_store

0 views
Skip to first unread message

syzbot

unread,
7:26 AM (10 hours ago) 7:26 AM
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=110e1149580000
kernel config: https://syzkaller.appspot.com/x/.config?x=6af0777879025b2
dashboard link: https://syzkaller.appspot.com/bug?extid=b6a7bd0aaf02331c6ebb
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=13c84c79580000
C reproducer: https://syzkaller.appspot.com/x/repro.c?x=12ac5079580000

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+b6a7bd...@syzkaller.appspotmail.com

==================================================================
BUG: KASAN: invalid-free in slab_free mm/slub.c:3712 [inline]
BUG: KASAN: invalid-free in __kmem_cache_free+0xb7/0x1b0 mm/slub.c:3728
Free of addr ffff88810f8aea4c by task syz-executor319/304

CPU: 0 PID: 304 Comm: syz-executor319 Not tainted 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_invalid_free+0xd5/0xf0 mm/kasan/report.c:489
____kasan_slab_free+0x14f/0x180 mm/kasan/common.c:-1
__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
f_uac2_opts_c_srate_store+0x220/0x2a0 drivers/usb/gadget/function/f_uac2.c:2082
flush_write_buffer fs/configfs/file.c:207 [inline]
configfs_write_iter+0x323/0x410 fs/configfs/file.c:229
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
ksys_write+0x14a/0x260 fs/read_write.c:637
__do_sys_write fs/read_write.c:649 [inline]
__se_sys_write fs/read_write.c:646 [inline]
__x64_sys_write+0x7b/0x90 fs/read_write.c:646
x64_sys_call+0x27b/0x9a0 arch/x86/include/generated/asm/syscalls_64.h:2
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:0x7fcac553bcf9
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:00007ffdfce96208 EFLAGS: 00000246 ORIG_RAX: 0000000000000001
RAX: ffffffffffffffda RBX: 666e6f63796d2f2e RCX: 00007fcac553bcf9
RDX: 000000000000001a RSI: 00002000000004c0 RDI: 0000000000000003
RBP: 0000000000000001 R08: 0000000000000000 R09: 00007ffdfce96338
R10: 0000000000000000 R11: 0000000000000246 R12: 00007ffdfce96328
R13: 0000000000000002 R14: 00007fcac55ccca0 R15: 0000000000000002
</TASK>

Allocated by task 304:
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]
__do_kmalloc_node mm/slab_common.c:938 [inline]
__kmalloc_node_track_caller+0xb1/0x1e0 mm/slab_common.c:958
kstrdup+0x3b/0x80 mm/util.c:66
f_uac2_opts_c_srate_store+0x11a/0x2a0 drivers/usb/gadget/function/f_uac2.c:2082
flush_write_buffer fs/configfs/file.c:207 [inline]
configfs_write_iter+0x323/0x410 fs/configfs/file.c:229
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
ksys_write+0x14a/0x260 fs/read_write.c:637
__do_sys_write fs/read_write.c:649 [inline]
__se_sys_write fs/read_write.c:646 [inline]
__x64_sys_write+0x7b/0x90 fs/read_write.c:646
x64_sys_call+0x27b/0x9a0 arch/x86/include/generated/asm/syscalls_64.h:2
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 ffff88810f8aea40
which belongs to the cache kmalloc-32 of size 32
The buggy address is located 12 bytes inside of
32-byte region [ffff88810f8aea40, ffff88810f8aea60)

The buggy address belongs to the physical page:
page:ffffea00043e2b80 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x10f8ae
flags: 0x4000000000000200(slab|zone=1)
raw: 4000000000000200 0000000000000000 dead000000000001 ffff888100042600
raw: 0000000000000000 0000000080400040 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 0x12a20(GFP_ATOMIC|__GFP_NOWARN|__GFP_NORETRY), pid 1, tgid 1 (init), ts 4321050003, free_ts 4320913864
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
kstrdup+0x3b/0x80 mm/util.c:66
get_classes_callback+0x46/0xa0 security/selinux/ss/services.c:3412
hashtab_map+0x106/0x200 security/selinux/ss/hashtab.c:97
security_get_classes+0xc9/0x270 security/selinux/ss/services.c:3433
sel_make_classes security/selinux/selinuxfs.c:1951 [inline]
sel_make_policy_nodes+0xa55/0x1350 security/selinux/selinuxfs.c:574
sel_write_load+0x3dc/0x600 security/selinux/selinuxfs.c:654
page last free stack trace:
reset_page_owner include/linux/page_owner.h:26 [inline]
free_pages_prepare mm/page_alloc.c:1580 [inline]
free_pcp_prepare mm/page_alloc.c:1654 [inline]
free_unref_page_prepare+0x80c/0x820 mm/page_alloc.c:3621
free_unref_page+0x93/0x530 mm/page_alloc.c:3719
free_the_page mm/page_alloc.c:863 [inline]
__free_pages+0x67/0x100 mm/page_alloc.c:6020
free_pages+0x82/0x90 mm/page_alloc.c:6031
sel_make_bools security/selinux/selinuxfs.c:1488 [inline]
sel_make_policy_nodes+0xa05/0x1350 security/selinux/selinuxfs.c:569
sel_write_load+0x3dc/0x600 security/selinux/selinuxfs.c:654
vfs_write+0x3fb/0xd00 fs/read_write.c:582
ksys_write+0x14a/0x260 fs/read_write.c:637
__do_sys_write fs/read_write.c:649 [inline]
__se_sys_write fs/read_write.c:646 [inline]
__x64_sys_write+0x7b/0x90 fs/read_write.c:646
x64_sys_call+0x27b/0x9a0 arch/x86/include/generated/asm/syscalls_64.h:2
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

Memory state around the buggy address:
ffff88810f8ae900: fb fb fb fb fc fc fc fc fb fb fb fb fc fc fc fc
ffff88810f8ae980: fb fb fb fb fc fc fc fc fb fb fb fb fc fc fc fc
>ffff88810f8aea00: fb fb fb fb fc fc fc fc 00 00 00 03 fc fc fc fc


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