==================================================================
BUG: KASAN: slab-use-after-free in instrument_atomic_read include/linux/instrumented.h:82 [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:234 [inline]
BUG: KASAN: slab-use-after-free in check_tty_count+0x1a3/0x330 drivers/tty/tty_io.c:287
Read of size 8 at addr ffff8881192b30f0 by task syz.6.19/554
CPU: 0 UID: 0 PID: 554 Comm: syz.6.19 Not tainted syzkaller #0 PREEMPT
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+0x98/0xe0 lib/dump_stack.c:120
print_address_description+0x77/0x210 mm/kasan/report.c:378
print_report+0x5b/0x80 mm/kasan/report.c:482
kasan_report+0x161/0x1a0 mm/kasan/report.c:595
check_region_inline mm/kasan/generic.c:-1 [inline]
kasan_check_range+0x26c/0x2d0 mm/kasan/generic.c:200
__kasan_check_read+0x11/0x20 mm/kasan/shadow.c:31
instrument_atomic_read include/linux/instrumented.h:82 [inline]
_test_bit include/asm-generic/bitops/instrumented-non-atomic.h:141 [inline]
tty_port_kopened include/linux/tty_port.h:234 [inline]
check_tty_count+0x1a3/0x330 drivers/tty/tty_io.c:287
tty_release+0x85/0x11e0 drivers/tty/tty_io.c:1701
__fput+0x3bf/0x9c0 fs/file_table.c:512
____fput+0x1c/0x40 fs/file_table.c:540
task_work_run+0x1e3/0x260 kernel/task_work.c:233
resume_user_mode_work include/linux/resume_user_mode.h:50 [inline]
__exit_to_user_mode_loop kernel/entry/common.c:70 [inline]
exit_to_user_mode_loop+0xa8/0xd0 kernel/entry/common.c:101
__exit_to_user_mode_prepare include/linux/irq-entry-common.h:207 [inline]
syscall_exit_to_user_mode_prepare include/linux/irq-entry-common.h:230 [inline]
syscall_exit_to_user_mode include/linux/entry-common.h:336 [inline]
do_syscall_64+0x1d2/0x290 arch/x86/entry/syscall_64.c:89
entry_SYSCALL_64_after_hwframe+0x76/0x7e
RIP: 0033:0x7f0d1b79e0d9
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:00007fff79c88828 EFLAGS: 00000246 ORIG_RAX: 00000000000001b4
RAX: 0000000000000000 RBX: 00007f0d1ba27da0 RCX: 00007f0d1b79e0d9
RDX: 0000000000000000 RSI: 000000000000001e RDI: 0000000000000003
RBP: 00007f0d1ba27da0 R08: 00007f0d1ba26038 R09: 0000000000000000
R10: 000000000003fda0 R11: 0000000000000246 R12: 000000000000b0b8
R13: 00007f0d1ba25fac R14: 000000000000adcc R15: 00007fff79c88930
Allocated by task 555:
kasan_save_stack mm/kasan/common.c:57 [inline]
kasan_save_track+0x3a/0x70 mm/kasan/common.c:78
kasan_save_alloc_info+0x36/0x40 mm/kasan/generic.c:570
poison_kmalloc_redzone mm/kasan/common.c:398 [inline]
__kasan_kmalloc+0x96/0xb0 mm/kasan/common.c:415
kasan_kmalloc include/linux/kasan.h:263 [inline]
__kmalloc_cache_noprof+0x226/0x3d0 mm/slub.c:5484
_kmalloc_noprof include/linux/slab.h:988 [inline]
_kzalloc_noprof include/linux/slab.h:1309 [inline]
gs_port_alloc drivers/usb/gadget/function/u_serial.c:1218 [inline]
gserial_alloc_line_no_console+0x238/0x6c0 drivers/usb/gadget/function/u_serial.c:1298
obex_alloc_inst+0x86/0xe0 drivers/usb/gadget/function/f_obex.c:434
try_get_usb_function_instance drivers/usb/gadget/functions.c:28 [inline]
usb_get_function_instance+0xf6/0x320 drivers/usb/gadget/functions.c:44
function_make+0x120/0x370 drivers/usb/gadget/configfs.c:626
configfs_mkdir+0x4f7/0x9f0 fs/configfs/dir.c:1360
vfs_mkdir+0x433/0x650 fs/namei.c:5410
filename_mkdirat+0x19a/0x3f0 fs/namei.c:5443
__do_sys_mkdirat fs/namei.c:5464 [inline]
__se_sys_mkdirat+0x38/0x160 fs/namei.c:5461
__x64_sys_mkdirat+0x7b/0xa0 fs/namei.c:5461
x64_sys_call+0x373/0x2610 arch/x86/include/generated/asm/syscalls_64.h:259
do_syscall_x64 arch/x86/entry/syscall_64.c:61 [inline]
do_syscall_64+0xae/0x290 arch/x86/entry/syscall_64.c:84
entry_SYSCALL_64_after_hwframe+0x76/0x7e
Freed by task 555:
kasan_save_stack mm/kasan/common.c:57 [inline]
kasan_save_track+0x3a/0x70 mm/kasan/common.c:78
kasan_save_free_info+0x40/0x50 mm/kasan/generic.c:584
poison_slab_object mm/kasan/common.c:253 [inline]
__kasan_slab_free+0x5f/0x80 mm/kasan/common.c:285
kasan_slab_free include/linux/kasan.h:235 [inline]
slab_free_hook mm/slub.c:2678 [inline]
slab_free mm/slub.c:6372 [inline]
kfree+0x15d/0x440 mm/slub.c:6687
gserial_free_port+0x22e/0x2a0 drivers/usb/gadget/function/u_serial.c:1262
gserial_free_line+0x9b/0x1b0 drivers/usb/gadget/function/u_serial.c:1279
obex_free_inst+0x39/0x60 drivers/usb/gadget/function/f_obex.c:420
usb_put_function_instance+0x9e/0xc0 drivers/usb/gadget/functions.c:77
obex_attr_release+0x15/0x20 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+0x174/0x230 fs/configfs/item.c:149
configfs_rmdir+0x8ee/0x9b0 fs/configfs/dir.c:1571
vfs_rmdir+0x43a/0x720 fs/namei.c:5515
filename_rmdir+0x22d/0x4a0 fs/namei.c:5572
__do_sys_rmdir fs/namei.c:5595 [inline]
__se_sys_rmdir+0x31/0x160 fs/namei.c:5592
__x64_sys_rmdir+0x38/0x50 fs/namei.c:5592
x64_sys_call+0x215c/0x2610 arch/x86/include/generated/asm/syscalls_64.h:85
do_syscall_x64 arch/x86/entry/syscall_64.c:61 [inline]
do_syscall_64+0xae/0x290 arch/x86/entry/syscall_64.c:84
entry_SYSCALL_64_after_hwframe+0x76/0x7e
The buggy address belongs to the object at ffff8881192b3000
which belongs to the cache kmalloc-1k of size 1024
The buggy address is located 240 bytes inside of
freed 1024-byte region [ffff8881192b3000, ffff8881192b3400)
The buggy address belongs to the physical page:
page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x1192b0
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 0000000800100010 00000000f5000000 0000000000000000
head: 4000000000000040 ffff888100041dc0 dead000000000100 dead000000000122
head: 0000000000000000 0000000800100010 00000000f5000000 0000000000000000
head: 4000000000000003 ffffea000464ac01 00000000ffffffff 00000000ffffffff
head: ffffffffffffffff 0000000000000000 00000000ffffffff 0000000000000008
page dumped because: kasan: bad access detected
page_owner tracks the page as allocated
page last allocated via order 3, migratetype Unmovable, gfp_mask 0xd2820(GFP_ATOMIC|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC), pid 12, tgid 12 (kworker/u8:0), ts 44169071985
set_page_owner include/linux/page_owner.h:33 [inline]
post_alloc_hook+0x1da/0x210 mm/page_alloc.c:1871
prep_new_page mm/page_alloc.c:1879 [inline]
get_page_from_freelist+0x1fc2/0x2030 mm/page_alloc.c:3943
__alloc_frozen_pages_noprof+0x2ef/0x5e0 mm/page_alloc.c:5436
alloc_slab_page mm/slub.c:-1 [inline]
allocate_slab+0x7d/0x520 mm/slub.c:3382
new_slab mm/slub.c:3428 [inline]
refill_objects+0x58f/0x680 mm/slub.c:7305
refill_sheaf mm/slub.c:2805 [inline]
__pcs_replace_empty_main+0x1f0/0x530 mm/slub.c:4677
alloc_from_pcs mm/slub.c:4775 [inline]
slab_alloc_node mm/slub.c:4907 [inline]
__do_kmalloc_node mm/slub.c:5336 [inline]
__kmalloc_node_track_caller_noprof+0x379/0x500 mm/slub.c:5466
kmalloc_reserve+0x13a/0x240 net/core/skbuff.c:637
__alloc_skb+0x199/0x700 net/core/skbuff.c:715
alloc_skb include/linux/skbuff.h:1384 [inline]
nlmsg_new include/net/netlink.h:1055 [inline]
br_info_notify+0xae/0x180 net/bridge/br_netlink.c:653
br_ifinfo_notify+0x2a/0x40 net/bridge/br_netlink.c:676
br_make_forwarding+0x13d/0x200 net/bridge/br_stp.c:475
br_port_state_selection+0x17c/0x5c0 net/bridge/br_stp.c:-1
br_stp_enable_port+0x171/0x250 net/bridge/br_stp_if.c:94
br_port_carrier_check+0x361/0x460 net/bridge/br_if.c:90
br_device_event+0x51e/0x880 net/bridge/br.c:101
page last free pid 505 tgid 505 ts 44092815525 stack trace:
reset_page_owner include/linux/page_owner.h:26 [inline]
__free_pages_prepare mm/page_alloc.c:1418 [inline]
__free_frozen_pages+0xa78/0xbe0 mm/page_alloc.c:2962
free_frozen_pages+0xb/0x30 mm/page_alloc.c:2999
__free_slab+0x129/0x1d0 mm/slub.c:3443
free_slab+0x1b/0x120 mm/slub.c:3477
discard_slab+0x23/0x40 mm/slub.c:3483
__slab_free+0x25c/0x290 mm/slub.c:5736
___cache_free+0x79/0x90 mm/slub.c:6444
qlink_free mm/kasan/quarantine.c:163 [inline]
qlist_free_all+0xbe/0x130 mm/kasan/quarantine.c:179
kasan_quarantine_reduce+0x14b/0x180 mm/kasan/quarantine.c:286
__kasan_slab_alloc+0x24/0x80 mm/kasan/common.c:350
kasan_slab_alloc include/linux/kasan.h:253 [inline]
slab_post_alloc_hook mm/slub.c:4586 [inline]
slab_alloc_node mm/slub.c:4919 [inline]
kmem_cache_alloc_lru_noprof+0x1b4/0x3c0 mm/slub.c:4952
__d_alloc+0x3e/0x6c0 fs/dcache.c:1907
d_alloc_pseudo+0x21/0xc0 fs/dcache.c:2038
alloc_path_pseudo+0x103/0x220 fs/file_table.c:407
alloc_file_pseudo+0xa4/0x1e0 fs/file_table.c:423
sock_alloc_file+0xbc/0x2f0 net/socket.c:557
Memory state around the buggy address:
ffff8881192b2f80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
ffff8881192b3000: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
>ffff8881192b3080: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
^
ffff8881192b3100: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
ffff8881192b3180: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
==================================================================
------------[ cut here ]------------
WARNING: drivers/usb/gadget/function/u_serial.c:703 at gs_close+0x180/0xaa0 drivers/usb/gadget/function/u_serial.c:703, CPU#0: syz.6.19/554
Modules linked in:
CPU: 0 UID: 0 PID: 554 Comm: syz.6.19 Tainted: G B syzkaller #0 PREEMPT
Tainted: [B]=BAD_PAGE
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 07/24/2026
RIP: 0010:gs_close+0x180/0xaa0 drivers/usb/gadget/function/u_serial.c:703
Code: 27 ce fd 41 ff cc 42 0f b6 04 33 84 c0 0f 85 b4 07 00 00 48 8b 44 24 30 44 89 20 48 8b 5c 24 38 e9 af 02 00 00 e8 50 27 ce fd <0f> 0b 48 8b 5c 24 38 e9 9e 02 00 00 e8 3f 27 ce fd 49 8d bf 20 02
RSP: 0018:ffffc90000f07b80 EFLAGS: 00010093
RAX: ffffffff83d730a0 RBX: 1ffff11023256616 RCX: ffff888118b9e900
RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000000000000
RBP: ffffc90000f07ca0 R08: 0000000000000003 R09: 0000000000000004
R10: dffffc0000000000 R11: fffff520001e0f60 R12: 0000000000000000
R13: 1ffff920001e0f78 R14: dffffc0000000000 R15: ffff8881192b3000
FS: 0000555571aba500(0000) GS:ffff88826de0e000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00007f6c27feb7c0 CR3: 0000000107782000 CR4: 00000000003526b0
Call Trace:
tty_release+0x32c/0x11e0 drivers/tty/tty_io.c:1718
__fput+0x3bf/0x9c0 fs/file_table.c:512
____fput+0x1c/0x40 fs/file_table.c:540
task_work_run+0x1e3/0x260 kernel/task_work.c:233
resume_user_mode_work include/linux/resume_user_mode.h:50 [inline]
__exit_to_user_mode_loop kernel/entry/common.c:70 [inline]
exit_to_user_mode_loop+0xa8/0xd0 kernel/entry/common.c:101
__exit_to_user_mode_prepare include/linux/irq-entry-common.h:207 [inline]
syscall_exit_to_user_mode_prepare include/linux/irq-entry-common.h:230 [inline]
syscall_exit_to_user_mode include/linux/entry-common.h:336 [inline]
do_syscall_64+0x1d2/0x290 arch/x86/entry/syscall_64.c:89
entry_SYSCALL_64_after_hwframe+0x76/0x7e
RIP: 0033:0x7f0d1b79e0d9
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:00007fff79c88828 EFLAGS: 00000246 ORIG_RAX: 00000000000001b4
RAX: 0000000000000000 RBX: 00007f0d1ba27da0 RCX: 00007f0d1b79e0d9
RDX: 0000000000000000 RSI: 000000000000001e RDI: 0000000000000003
RBP: 00007f0d1ba27da0 R08: 00007f0d1ba26038 R09: 0000000000000000
R10: 000000000003fda0 R11: 0000000000000246 R12: 000000000000b0b8
R13: 00007f0d1ba25fac R14: 000000000000adcc R15: 00007fff79c88930
---[ end trace 0000000000000000 ]---