==================================================================
BUG: KASAN: slab-use-after-free in instrument_atomic_read include/linux/instrumented.h:68 [inline]
BUG: KASAN: slab-use-after-free in _test_bit include/asm-generic/bitops/instrumented-non-atomic.h:141 [inline]
BUG: KASAN: slab-use-after-free in tty_port_kopened include/linux/tty_port.h:229 [inline]
BUG: KASAN: slab-use-after-free in check_tty_count+0x1a5/0x330 drivers/tty/tty_io.c:288
Read of size 8 at addr ffff88811f3eb900 by task syz.4.20/506
CPU: 1 UID: 0 PID: 506 Comm: syz.4.20 Not tainted syzkaller #0 83752b23aa6e81f943fbac36002c2e49fb1b9186
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 07/24/2026
Call Trace:
__dump_stack+0x21/0x30 lib/dump_stack.c:94
dump_stack_lvl+0x140/0x1c0 lib/dump_stack.c:120
print_address_description+0x71/0x210 mm/kasan/report.c:377
print_report+0x4a/0x70 mm/kasan/report.c:481
kasan_report+0x162/0x1a0 mm/kasan/report.c:594
check_region_inline mm/kasan/generic.c:-1 [inline]
kasan_check_range+0x25a/0x2b0 mm/kasan/generic.c:189
__kasan_check_read+0x15/0x20 mm/kasan/shadow.c:31
instrument_atomic_read include/linux/instrumented.h:68 [inline]
_test_bit include/asm-generic/bitops/instrumented-non-atomic.h:141 [inline]
tty_port_kopened include/linux/tty_port.h:229 [inline]
check_tty_count+0x1a5/0x330 drivers/tty/tty_io.c:288
tty_release+0x89/0x11e0 drivers/tty/tty_io.c:1737
__fput+0x208/0xa30 fs/file_table.c:447
____fput+0x20/0x30 fs/file_table.c:475
task_work_run+0x1e5/0x260 kernel/task_work.c:246
resume_user_mode_work+0x35/0x50 include/linux/resume_user_mode.h:50
exit_to_user_mode_loop kernel/entry/common.c:114 [inline]
exit_to_user_mode_prepare include/linux/entry-common.h:328 [inline]
__syscall_exit_to_user_mode_work kernel/entry/common.c:207 [inline]
syscall_exit_to_user_mode+0x63/0xb0 kernel/entry/common.c:218
do_syscall_64+0x63/0xf0 arch/x86/entry/common.c:84
entry_SYSCALL_64_after_hwframe+0x76/0x7e
RIP: 0033:0x7ff1ac59e0d9
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:00007fffa3e02ac8 EFLAGS: 00000246 ORIG_RAX: 00000000000001b4
RAX: 0000000000000000 RBX: 00007ff1ac827da0 RCX: 00007ff1ac59e0d9
RDX: 0000000000000000 RSI: 000000000000001e RDI: 0000000000000003
RBP: 00007ff1ac827da0 R08: 00007ff1ac826038 R09: 0000000000000000
R10: 000000000003fda0 R11: 0000000000000246 R12: 000000000001b98d
R13: 00007ff1ac825fac R14: 000000000001b69b R15: 00007fffa3e02bd0
Allocated by task 507:
kasan_save_stack mm/kasan/common.c:49 [inline]
kasan_save_track+0x3e/0x80 mm/kasan/common.c:70
kasan_save_alloc_info+0x3a/0x50 mm/kasan/generic.c:565
poison_kmalloc_redzone mm/kasan/common.c:379 [inline]
__kasan_kmalloc+0x96/0xb0 mm/kasan/common.c:396
kasan_kmalloc include/linux/kasan.h:261 [inline]
__kmalloc_cache_noprof+0x23c/0x470 mm/slub.c:4426
kmalloc_noprof include/linux/slab.h:882 [inline]
kzalloc_noprof include/linux/slab.h:1117 [inline]
gs_port_alloc drivers/usb/gadget/function/u_serial.c:1181 [inline]
gserial_alloc_line_no_console+0x245/0x770 drivers/usb/gadget/function/u_serial.c:1261
obex_alloc_inst+0x9b/0x190 drivers/usb/gadget/function/f_obex.c:434
try_get_usb_function_instance drivers/usb/gadget/functions.c:28 [inline]
usb_get_function_instance+0xfa/0x320 drivers/usb/gadget/functions.c:44
function_make+0x125/0x370 drivers/usb/gadget/configfs.c:631
configfs_mkdir+0x523/0xb70 fs/configfs/dir.c:1339
vfs_mkdir+0x58e/0x810 fs/namei.c:4265
do_mkdirat+0x240/0x530 fs/namei.c:4288
__do_sys_mkdirat fs/namei.c:4303 [inline]
__se_sys_mkdirat fs/namei.c:4301 [inline]
__x64_sys_mkdirat+0x8b/0xa0 fs/namei.c:4301
x64_sys_call+0x2ba8/0x2ee0 arch/x86/include/generated/asm/syscalls_64.h:259
do_syscall_x64 arch/x86/entry/common.c:47 [inline]
do_syscall_64+0x57/0xf0 arch/x86/entry/common.c:78
entry_SYSCALL_64_after_hwframe+0x76/0x7e
Freed by task 507:
kasan_save_stack mm/kasan/common.c:49 [inline]
kasan_save_track+0x3e/0x80 mm/kasan/common.c:70
kasan_save_free_info+0x44/0x50 mm/kasan/generic.c:579
poison_slab_object mm/kasan/common.c:249 [inline]
__kasan_slab_free+0x5f/0x80 mm/kasan/common.c:266
kasan_slab_free include/linux/kasan.h:234 [inline]
slab_free_hook mm/slub.c:2445 [inline]
slab_free mm/slub.c:4714 [inline]
kfree+0x158/0x440 mm/slub.c:4875
gserial_free_port+0x244/0x2e0 drivers/usb/gadget/function/u_serial.c:1225
gserial_free_line+0x9f/0x1b0 drivers/usb/gadget/function/u_serial.c:1242
obex_free_inst+0x3d/0x60 drivers/usb/gadget/function/f_obex.c:420
usb_put_function_instance+0x9f/0xc0 drivers/usb/gadget/functions.c:77
obex_attr_release+0x19/0x30 drivers/usb/gadget/function/f_obex.c:390
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+0x175/0x240 fs/configfs/item.c:149
configfs_rmdir+0x8e8/0x9b0 fs/configfs/dir.c:1550
vfs_rmdir+0x3de/0x560 fs/namei.c:4348
do_rmdir+0x29a/0x590 fs/namei.c:4407
__do_sys_rmdir fs/namei.c:4426 [inline]
__se_sys_rmdir fs/namei.c:4424 [inline]
__x64_sys_rmdir+0x4b/0x60 fs/namei.c:4424
x64_sys_call+0xaf7/0x2ee0 arch/x86/include/generated/asm/syscalls_64.h:85
do_syscall_x64 arch/x86/entry/common.c:47 [inline]
do_syscall_64+0x57/0xf0 arch/x86/entry/common.c:78
entry_SYSCALL_64_after_hwframe+0x76/0x7e
The buggy address belongs to the object at ffff88811f3eb800
which belongs to the cache kmalloc-1k of size 1024
The buggy address is located 256 bytes inside of
freed 1024-byte region [ffff88811f3eb800, ffff88811f3ebc00)
The buggy address belongs to the physical page:
page: refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x11f3e8
head: order:3 mapcount:0 entire_mapcount:0 nr_pages_mapped:0 pincount:0
flags: 0x4000000000000040(head|zone=1)
page_type: f5(slab)
raw: 4000000000000040 ffff888100041dc0 dead000000000100 dead000000000122
raw: 0000000000000000 0000000000100010 00000001f5000000 0000000000000000
head: 4000000000000040 ffff888100041dc0 dead000000000100 dead000000000122
head: 0000000000000000 0000000000100010 00000001f5000000 0000000000000000
head: 4000000000000003 ffffea00047cfa01 ffffffffffffffff 0000000000000000
head: 0000000000000008 0000000000000000 00000000ffffffff 0000000000000000
page dumped because: kasan: bad access detected
page_owner tracks the page as allocated
page last allocated via order 3, migratetype Unmovable, gfp_mask 0xd20c0(__GFP_IO|__GFP_FS|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC), pid 175, tgid 175 (dhcpcd), ts 9237526976, free_ts 0
set_page_owner include/linux/page_owner.h:35 [inline]
post_alloc_hook+0x37d/0x3b0 mm/page_alloc.c:1863
prep_new_page+0x2d/0x180 mm/page_alloc.c:1871
get_page_from_freelist+0x4aea/0x4ba0 mm/page_alloc.c:3948
__alloc_pages_noprof+0x35a/0x7e0 mm/page_alloc.c:5315
alloc_slab_page+0x6b/0x1e0 mm/slub.c:-1
allocate_slab+0x69/0x430 mm/slub.c:2687
new_slab mm/slub.c:2741 [inline]
___slab_alloc+0x591/0x8c0 mm/slub.c:3934
__slab_alloc mm/slub.c:4025 [inline]
__slab_alloc_node mm/slub.c:4078 [inline]
slab_alloc_node mm/slub.c:4239 [inline]
__do_kmalloc_node mm/slub.c:4394 [inline]
__kmalloc_noprof+0x2fc/0x510 mm/slub.c:4407
kmalloc_noprof include/linux/slab.h:886 [inline]
load_elf_phdrs+0x17b/0x3a0 fs/binfmt_elf.c:523
load_elf_binary+0x1c2/0x2d40 fs/binfmt_elf.c:853
search_binary_handler fs/exec.c:1812 [inline]
exec_binprm fs/exec.c:1854 [inline]
bprm_execve+0x717/0x13f0 fs/exec.c:1906
do_execveat_common+0x97e/0xae0 fs/exec.c:2011
do_execve fs/exec.c:2085 [inline]
__do_sys_execve fs/exec.c:2161 [inline]
__se_sys_execve fs/exec.c:2156 [inline]
__x64_sys_execve+0x96/0xb0 fs/exec.c:2156
x64_sys_call+0x12c4/0x2ee0 arch/x86/include/generated/asm/syscalls_64.h:60
do_syscall_x64 arch/x86/entry/common.c:47 [inline]
do_syscall_64+0x57/0xf0 arch/x86/entry/common.c:78
entry_SYSCALL_64_after_hwframe+0x76/0x7e
page_owner free stack trace missing
Memory state around the buggy address:
ffff88811f3eb800: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
ffff88811f3eb880: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
>ffff88811f3eb900: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
^
ffff88811f3eb980: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
ffff88811f3eba00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
==================================================================
------------[ cut here ]------------
WARNING: CPU: 0 PID: 506 at drivers/usb/gadget/function/u_serial.c:691 gs_close+0x181/0x9c0 drivers/usb/gadget/function/u_serial.c:691
Modules linked in:
CPU: 0 UID: 0 PID: 506 Comm: syz.4.20 Tainted: G B syzkaller #0 83752b23aa6e81f943fbac36002c2e49fb1b9186
Tainted: [B]=BAD_PAGE
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 07/24/2026
RIP: 0010:gs_close+0x181/0x9c0 drivers/usb/gadget/function/u_serial.c:691
Code: fa cb fd 41 ff cc 42 0f b6 04 2b 84 c0 0f 85 da 06 00 00 48 8b 44 24 20 44 89 20 48 8b 5c 24 38 e9 d1 02 00 00 e8 0f fa cb fd <0f> 0b 48 8b 5c 24 38 e9 c0 02 00 00 e8 fe f9 cb fd 49 8d bf 78 02
RSP: 0018:ffffc90000e2fba0 EFLAGS: 00010093
RAX: ffffffff83bb7d51 RBX: 1ffff11023e7d718 RCX: ffff88811df8cc00
RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000000000000
RBP: ffffc90000e2fcc0 R08: 0000000000000003 R09: 0000000000000004
R10: dffffc0000000000 R11: fffff520001c5f64 R12: 0000000000000000
R13: dffffc0000000000 R14: 1ffff920001c5f7c R15: ffff88811f3eb800
FS: 0000555583a07500(0000) GS:ffff8881f6e00000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00007fb27d758060 CR3: 0000000120dce000 CR4: 00000000003526b0
Call Trace:
tty_release+0x32f/0x11e0 drivers/tty/tty_io.c:1754
__fput+0x208/0xa30 fs/file_table.c:447
____fput+0x20/0x30 fs/file_table.c:475
task_work_run+0x1e5/0x260 kernel/task_work.c:246
resume_user_mode_work+0x35/0x50 include/linux/resume_user_mode.h:50
exit_to_user_mode_loop kernel/entry/common.c:114 [inline]
exit_to_user_mode_prepare include/linux/entry-common.h:328 [inline]
__syscall_exit_to_user_mode_work kernel/entry/common.c:207 [inline]
syscall_exit_to_user_mode+0x63/0xb0 kernel/entry/common.c:218
do_syscall_64+0x63/0xf0 arch/x86/entry/common.c:84
entry_SYSCALL_64_after_hwframe+0x76/0x7e
RIP: 0033:0x7ff1ac59e0d9
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:00007fffa3e02ac8 EFLAGS: 00000246 ORIG_RAX: 00000000000001b4
RAX: 0000000000000000 RBX: 00007ff1ac827da0 RCX: 00007ff1ac59e0d9
RDX: 0000000000000000 RSI: 000000000000001e RDI: 0000000000000003
RBP: 00007ff1ac827da0 R08: 00007ff1ac826038 R09: 0000000000000000
R10: 000000000003fda0 R11: 0000000000000246 R12: 000000000001b98d
R13: 00007ff1ac825fac R14: 000000000001b69b R15: 00007fffa3e02bd0
---[ end trace 0000000000000000 ]---