[Android 6.1] KASAN: invalid-free in f_uac2_opts_p_srate_store

0 views
Skip to first unread message

syzbot

unread,
6:27 PM (2 hours ago) 6:27 PM
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=107a2c9e580000
kernel config: https://syzkaller.appspot.com/x/.config?x=6af0777879025b2
dashboard link: https://syzkaller.appspot.com/bug?extid=0a9828a0e2c091a9ca50
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=171c74c6580000
C reproducer: https://syzkaller.appspot.com/x/repro.c?x=174dee32580000

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+0a9828...@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 ffff888109172c18 by task syz-executor254/305

CPU: 0 PID: 305 Comm: syz-executor254 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_p_srate_store+0x220/0x2a0 drivers/usb/gadget/function/f_uac2.c:2078
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:0x7f58f9b36ff9
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:00007ffeedac2f68 EFLAGS: 00000246 ORIG_RAX: 0000000000000001
RAX: ffffffffffffffda RBX: 73666769666e6f63 RCX: 00007f58f9b36ff9
RDX: 0000000000000055 RSI: 0000200000000340 RDI: 0000000000000003
RBP: 00007ffeedac2f78 R08: 00007f58f9b1bc10 R09: 00007f58f9b1bc10
R10: 00007f58f9b1bc10 R11: 0000000000000246 R12: 0000000000000000
R13: 0000000000000002 R14: 00007f58f9bbeca0 R15: 0000000000000002
</TASK>

Allocated by task 305:
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_p_srate_store+0x11a/0x2a0 drivers/usb/gadget/function/f_uac2.c:2078
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 ffff888109172c00
which belongs to the cache kmalloc-96 of size 96
The buggy address is located 24 bytes inside of
96-byte region [ffff888109172c00, ffff888109172c60)

The buggy address belongs to the physical page:
page:ffffea0004245c80 refcount:1 mapcount:0 mapping:0000000000000000 index:0xffff888109172800 pfn:0x109172
flags: 0x4000000000000200(slab|zone=1)
raw: 4000000000000200 ffffea0004245ac0 dead000000000004 ffff888100042900
raw: ffff888109172800 0000000080200018 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 1536943357, 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
kmalloc_trace+0x29/0xb0 mm/slab_common.c:1028
kmalloc include/linux/slab.h:563 [inline]
kzalloc include/linux/slab.h:699 [inline]
acpi_os_allocate_zeroed include/acpi/platform/aclinuxex.h:57 [inline]
acpi_ut_evaluate_object+0xe4/0x480 drivers/acpi/acpica/uteval.c:50
acpi_ut_execute_power_methods+0x9b/0x1c0 drivers/acpi/acpica/uteval.c:288
acpi_get_object_info+0x523/0xd40 drivers/acpi/acpica/nsxfname.c:356
acpi_set_pnp_ids drivers/acpi/scan.c:1340 [inline]
acpi_init_device_object+0x54d/0x2570 drivers/acpi/scan.c:1776
acpi_add_single_object+0xfe/0x1990 drivers/acpi/scan.c:1826
acpi_bus_check_add+0x38b/0x7e0 drivers/acpi/scan.c:2086
page_owner free stack trace missing

Memory state around the buggy address:
ffff888109172b00: fa fb fb fb fb fb fb fb fb fb fb fb fc fc fc fc
ffff888109172b80: fb fb fb fb fb fb fb fb fb fb fb fb fc fc fc fc
>ffff888109172c00: 00 00 00 00 00 00 00 00 00 03 fc fc fc fc fc fc
^
ffff888109172c80: f


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