* [syzbot] [trace?] WARNING in ring_buffer_map_get_reader (3) @ 2026-09-06 20:15 syzbot 2026-09-07 17:57 ` syzbot 2026-09-10 11:48 ` Forwarded: Re: test patch syzbot 0 siblings, 2 replies; 13+ messages in thread From: syzbot @ 2026-09-06 20:15 UTC (permalink / raw) To: linux-kernel, linux-trace-kernel, mathieu.desnoyers, mhiramat, rostedt, syzkaller-bugs Hello, syzbot found the following issue on: HEAD commit: 89a312991dc6 Merge tag 'cifs-fixes-7.3-rc2' of https://git.. git tree: upstream console output: https://syzkaller.appspot.com/x/log.txt?x=12e4bc15580000 kernel config: https://syzkaller.appspot.com/x/.config?x=8c5c3949d762a91f dashboard link: https://syzkaller.appspot.com/bug?extid=de3d7f9bcc9212f3fae1 compiler: gcc (Debian 14.2.0-19) 14.2.0, GNU ld (GNU Binutils for Debian) 2.44 Unfortunately, I don't have any reproducer for this issue yet. Downloadable assets: disk image (non-bootable): https://storage.googleapis.com/syzbot-assets/d900f083ada3/non_bootable_disk-89a31299.raw.xz vmlinux: https://storage.googleapis.com/syzbot-assets/2299fb3a049a/vmlinux-89a31299.xz kernel image: https://storage.googleapis.com/syzbot-assets/556be545d7b6/bzImage-89a31299.xz IMPORTANT: if you fix the issue, please add the following tag to the commit: Reported-by: syzbot+de3d7f9bcc9212f3fae1@syzkaller.appspotmail.com Cannot find set identified by id 0 to match ------------[ cut here ]------------ !reader WARNING: kernel/trace/ring_buffer.c:7927 at ring_buffer_map_get_reader+0x5f3/0x930 kernel/trace/ring_buffer.c:7927, CPU#0: syz.2.1764/13608 Modules linked in: CPU: 0 UID: 0 PID: 13608 Comm: syz.2.1764 Tainted: G L syzkaller #0 PREEMPT(full) Tainted: [L]=SOFTLOCKUP Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014 RIP: 0010:ring_buffer_map_get_reader+0x5f3/0x930 kernel/trace/ring_buffer.c:7927 Code: ff 48 89 df e8 2e 21 fe ff 48 89 c5 e8 46 8b fb ff 48 85 ed 0f 85 9f fc ff ff 4c 8b 74 24 58 4c 8b 7c 24 60 e8 2e 8b fb ff 90 <0f> 0b 90 e8 25 8b fb ff 49 8d bf d0 01 00 00 48 b8 00 00 00 00 00 RSP: 0018:ffffc90006b57d98 EFLAGS: 00010087 RAX: 000000000000086c RBX: ffff88801c0e5000 RCX: ffffc90024800000 RDX: 0000000000080000 RSI: ffffffff821064e2 RDI: ffff888027852580 RBP: 0000000000000000 R08: 0000000000000007 R09: 0000000000000000 R10: 0000000000000000 R11: ffff88801c0e50b0 R12: ffff88801c0e50b8 R13: dffffc0000000000 R14: ffff88801c0e5198 R15: ffff88801c0ab800 FS: 00007fa41bfdb6c0(0000) GS:ffff8880d5b61000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 00007f60453c8ff8 CR3: 0000000035d0b000 CR4: 0000000000352ef0 Call Trace: <TASK> tracing_buffers_ioctl+0x2e6/0x3d0 kernel/trace/trace.c:7392 vfs_ioctl fs/ioctl.c:51 [inline] __do_sys_ioctl fs/ioctl.c:597 [inline] __se_sys_ioctl fs/ioctl.c:583 [inline] __x64_sys_ioctl+0x18e/0x210 fs/ioctl.c:583 do_syscall_x64 arch/x86/entry/syscall_64.c:61 [inline] do_syscall_64+0x123/0x790 arch/x86/entry/syscall_64.c:84 entry_SYSCALL_64_after_hwframe+0x77/0x7f RIP: 0033:0x7fa41b19e159 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:00007fa41bfdb028 EFLAGS: 00000246 ORIG_RAX: 0000000000000010 RAX: ffffffffffffffda RBX: 00007fa41b425fa0 RCX: 00007fa41b19e159 RDX: 0000000000000000 RSI: 0000000000005220 RDI: 0000000000000007 RBP: 00007fa41b235024 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 00007fa41b426038 R14: 00007fa41b425fa0 R15: 00007ffd22388a08 </TASK> --- 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 syzkaller@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 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 ^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [syzbot] [trace?] WARNING in ring_buffer_map_get_reader (3) 2026-09-06 20:15 [syzbot] [trace?] WARNING in ring_buffer_map_get_reader (3) syzbot @ 2026-09-07 17:57 ` syzbot 2026-09-10 11:48 ` Forwarded: Re: test patch syzbot 1 sibling, 0 replies; 13+ messages in thread From: syzbot @ 2026-09-07 17:57 UTC (permalink / raw) To: linux-kernel, linux-trace-kernel, mathieu.desnoyers, mhiramat, rostedt, syzkaller-bugs syzbot has found a reproducer for the following issue on: HEAD commit: df2908090cda Linux 7.3-rc2 git tree: git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git console output: https://syzkaller.appspot.com/x/log.txt?x=1216caf9580000 kernel config: https://syzkaller.appspot.com/x/.config?x=8c5c3949d762a91f dashboard link: https://syzkaller.appspot.com/bug?extid=de3d7f9bcc9212f3fae1 compiler: gcc (Debian 14.2.0-19) 14.2.0, GNU ld (GNU Binutils for Debian) 2.44 C reproducer: https://syzkaller.appspot.com/x/repro.c?x=1616caf9580000 IMPORTANT: if you fix the issue, please add the following tag to the commit: Reported-by: syzbot+de3d7f9bcc9212f3fae1@syzkaller.appspotmail.com Ring buffer [0] commit overrun lost 3 events at timestamp:71798603963 ------------[ cut here ]------------ !reader WARNING: kernel/trace/ring_buffer.c:7998 at ring_buffer_map_get_reader+0x5f3/0x930 kernel/trace/ring_buffer.c:7998, CPU#1: syz-executor388/6024 Modules linked in: CPU: 1 UID: 0 PID: 6024 Comm: syz-executor388 Not tainted syzkaller #0 PREEMPT(full) Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014 RIP: 0010:ring_buffer_map_get_reader+0x5f3/0x930 kernel/trace/ring_buffer.c:7998 Code: ff 48 89 df e8 be 22 fe ff 48 89 c5 e8 a6 88 fb ff 48 85 ed 0f 85 9f fc ff ff 4c 8b 74 24 58 4c 8b 7c 24 60 e8 8e 88 fb ff 90 <0f> 0b 90 e8 85 88 fb ff 49 8d bf d0 01 00 00 48 b8 00 00 00 00 00 RSP: 0018:ffffc90003977d98 EFLAGS: 00010093 RAX: 0000000000000000 RBX: ffff88801c0e5000 RCX: 0000000000000001 RDX: ffff8880333d4b00 RSI: ffffffff82108882 RDI: ffff8880333d4b00 RBP: 0000000000000000 R08: 0000000000000007 R09: 0000000000000000 R10: 0000000000000000 R11: ffff88801c0e50b0 R12: ffff88801c0e50b8 R13: dffffc0000000000 R14: ffff88801c0e5198 R15: ffff88801c0ab800 FS: 00007f337024b6c0(0000) GS:ffff8880d5c5d000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 0000559c2c45caa0 CR3: 000000003dec3000 CR4: 0000000000352ef0 Call Trace: <TASK> tracing_buffers_ioctl+0x2e6/0x3d0 kernel/trace/trace.c:7381 vfs_ioctl fs/ioctl.c:51 [inline] __do_sys_ioctl fs/ioctl.c:597 [inline] __se_sys_ioctl fs/ioctl.c:583 [inline] __x64_sys_ioctl+0x18e/0x210 fs/ioctl.c:583 do_syscall_x64 arch/x86/entry/syscall_64.c:61 [inline] do_syscall_64+0x123/0x790 arch/x86/entry/syscall_64.c:84 entry_SYSCALL_64_after_hwframe+0x77/0x7f RIP: 0033:0x7f3370a8136b Code: 00 48 89 44 24 18 31 c0 48 8d 44 24 60 c7 04 24 10 00 00 00 48 89 44 24 08 48 8d 44 24 20 48 89 44 24 10 b8 10 00 00 00 0f 05 <89> c2 3d 00 f0 ff ff 77 1c 48 8b 44 24 18 64 48 2b 04 25 28 00 00 RSP: 002b:00007f337024b130 EFLAGS: 00000246 ORIG_RAX: 0000000000000010 RAX: ffffffffffffffda RBX: 00007f337024bcdc RCX: 00007f3370a8136b RDX: 0000000000000000 RSI: 0000000000005220 RDI: 0000000000000004 RBP: 0000000000000021 R08: 0000000000000000 R09: 00007f337024b6c0 R10: 0000000000000008 R11: 0000000000000246 R12: ffffffffffffffd0 R13: 0000000000000000 R14: 00007ffc1cde9710 R15: 00007ffc1cde97f8 </TASK> --- 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. ^ permalink raw reply [flat|nested] 13+ messages in thread
* Forwarded: Re: test patch 2026-09-06 20:15 [syzbot] [trace?] WARNING in ring_buffer_map_get_reader (3) syzbot 2026-09-07 17:57 ` syzbot @ 2026-09-10 11:48 ` syzbot 1 sibling, 0 replies; 13+ messages in thread From: syzbot @ 2026-09-10 11:48 UTC (permalink / raw) To: linux-kernel, syzkaller-bugs For archival purposes, forwarding an incoming command email to linux-kernel@vger.kernel.org, syzkaller-bugs@googlegroups.com. *** Subject: Re: test patch Author: tahasami8@gmail.com #syz test git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master diff --git a/kernel/trace/ring_buffer.c b/kernel/trace/ring_buffer.c index 9c03a555a6ba..98130182e05d 100644 --- a/kernel/trace/ring_buffer.c +++ b/kernel/trace/ring_buffer.c @@ -7995,8 +7995,10 @@ int ring_buffer_map_get_reader(struct trace_buffer *buffer, int cpu) goto out; reader = rb_get_reader_page(cpu_buffer); - if (WARN_ON(!reader)) + if (!reader) { + WARN_ON(cpu_buffer->reader_page != cpu_buffer->commit_page); goto out; + } /* Check if any events were dropped */ missed_events = cpu_buffer->lost_events; ^ permalink raw reply [flat|nested] 13+ messages in thread
* [syzbot] [usb?] KASAN: slab-use-after-free Read in vhci_shutdown_connection
@ 2026-08-01 0:01 syzbot
2026-09-07 13:57 ` Forwarded: Re: test patch syzbot
` (4 more replies)
0 siblings, 5 replies; 13+ messages in thread
From: syzbot @ 2026-08-01 0:01 UTC (permalink / raw)
To: gregkh, i, linux-kernel, linux-usb, shuah, syzkaller-bugs,
valentina.manea.m
Hello,
syzbot found the following issue on:
HEAD commit: f5098b6bae76 Linux 7.2-rc5
git tree: upstream
console output: https://syzkaller.appspot.com/x/log.txt?x=11b391b9580000
kernel config: https://syzkaller.appspot.com/x/.config?x=4e38b15c29e6a1d9
dashboard link: https://syzkaller.appspot.com/bug?extid=31117fde582fe6a0cd62
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=1575d1b9580000
Downloadable assets:
disk image: https://storage.googleapis.com/syzbot-assets/7d76d25427fa/disk-f5098b6b.raw.xz
vmlinux: https://storage.googleapis.com/syzbot-assets/b2a3f9e7cb3e/vmlinux-f5098b6b.xz
kernel image: https://storage.googleapis.com/syzbot-assets/e4d49cdcd799/bzImage-f5098b6b.xz
IMPORTANT: if you fix the issue, please add the following tag to the commit:
Reported-by: syzbot+31117fde582fe6a0cd62@syzkaller.appspotmail.com
vhci_hcd vhci_hcd.0: disconnect device
vhci_hcd vhci_hcd.0: stop threads
==================================================================
BUG: KASAN: slab-use-after-free in vhci_shutdown_connection+0x1d4/0x650 drivers/usb/usbip/vhci_hcd.c:1062
Read of size 8 at addr ffff888020bd1560 by task kworker/u8:9/1170
CPU: 1 UID: 0 PID: 1170 Comm: kworker/u8:9 Not tainted syzkaller #0 PREEMPT(full)
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 07/16/2026
Workqueue: usbip_event event_handler
Call Trace:
<TASK>
dump_stack_lvl+0xe8/0x150 lib/dump_stack.c:120
print_address_description+0x55/0x1e0 mm/kasan/report.c:378
print_report+0x58/0x70 mm/kasan/report.c:482
kasan_report+0x117/0x150 mm/kasan/report.c:595
vhci_shutdown_connection+0x1d4/0x650 drivers/usb/usbip/vhci_hcd.c:1062
event_handler+0x2a4/0x4b0 drivers/usb/usbip/usbip_event.c:79
process_one_work kernel/workqueue.c:3322 [inline]
process_scheduled_works+0xa8e/0x14e0 kernel/workqueue.c:3405
worker_thread+0xa47/0xfb0 kernel/workqueue.c:3486
kthread+0x388/0x470 kernel/kthread.c:436
ret_from_fork+0x514/0xb70 arch/x86/kernel/process.c:158
ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:245
</TASK>
Allocated by task 1:
kasan_save_stack mm/kasan/common.c:57 [inline]
kasan_save_track+0x3e/0x80 mm/kasan/common.c:78
poison_kmalloc_redzone mm/kasan/common.c:398 [inline]
__kasan_kmalloc+0x93/0xb0 mm/kasan/common.c:415
kasan_kmalloc include/linux/kasan.h:263 [inline]
__do_kmalloc_node mm/slub.c:5334 [inline]
__kmalloc_noprof+0x375/0x720 mm/slub.c:5359
_kmalloc_noprof include/linux/slab.h:992 [inline]
_kzalloc_noprof include/linux/slab.h:1309 [inline]
__usb_create_hcd+0x67/0x900 drivers/usb/core/hcd.c:2566
vhci_hcd_probe+0x104/0x3e0 drivers/usb/usbip/vhci_hcd.c:1378
platform_probe+0xf9/0x190 drivers/base/platform.c:1439
call_driver_probe drivers/base/dd.c:-1 [inline]
really_probe+0x254/0xae0 drivers/base/dd.c:706
__driver_probe_device+0x1e8/0x360 drivers/base/dd.c:868
driver_probe_device+0x4f/0x240 drivers/base/dd.c:898
__device_attach_driver+0x270/0x410 drivers/base/dd.c:1026
bus_for_each_drv+0x258/0x2f0 drivers/base/bus.c:500
__device_attach+0x2c4/0x450 drivers/base/dd.c:1098
device_initial_probe+0xa1/0xd0 drivers/base/dd.c:1153
bus_probe_device+0x12a/0x220 drivers/base/bus.c:620
device_add+0x7d7/0xb80 drivers/base/core.c:3772
platform_device_add+0x4bd/0x860 drivers/base/platform.c:762
platform_device_register_full+0x62d/0x710 drivers/base/platform.c:902
vhci_hcd_init+0x227/0x360 drivers/usb/usbip/vhci_hcd.c:1557
do_one_initcall+0x250/0x870 init/main.c:1347
do_initcall_level+0x10a/0x1a0 init/main.c:1409
do_initcalls+0x59/0xa0 init/main.c:1425
kernel_init_freeable+0x29d/0x3e0 init/main.c:1658
kernel_init+0x1d/0x1d0 init/main.c:1548
ret_from_fork+0x514/0xb70 arch/x86/kernel/process.c:158
ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:245
Freed by task 6083:
kasan_save_stack mm/kasan/common.c:57 [inline]
kasan_save_track+0x3e/0x80 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+0x5c/0x80 mm/kasan/common.c:285
kasan_slab_free include/linux/kasan.h:235 [inline]
slab_free_hook mm/slub.c:2677 [inline]
slab_free mm/slub.c:6377 [inline]
kfree+0x1c5/0x640 mm/slub.c:6692
vhci_hcd_remove+0xe4/0x110 drivers/usb/usbip/vhci_hcd.c:1434
device_remove drivers/base/dd.c:616 [inline]
__device_release_driver drivers/base/dd.c:1349 [inline]
device_release_driver_internal+0x48b/0x880 drivers/base/dd.c:1372
unbind_store+0x1a1/0x1d0 drivers/base/bus.c:244
kernfs_fop_write_iter+0x3a4/0x540 fs/kernfs/file.c:345
new_sync_write fs/read_write.c:595 [inline]
vfs_write+0x612/0xba0 fs/read_write.c:687
ksys_write+0x150/0x270 fs/read_write.c:739
do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline]
do_syscall_64+0x174/0x580 arch/x86/entry/syscall_64.c:94
entry_SYSCALL_64_after_hwframe+0x77/0x7f
Last potentially related work creation:
kasan_save_stack+0x3e/0x60 mm/kasan/common.c:57
kasan_record_aux_stack+0xbd/0xd0 mm/kasan/generic.c:556
insert_work+0x3d/0x330 kernel/workqueue.c:2226
__queue_work+0xcd8/0x10a0 kernel/workqueue.c:2401
queue_work_on+0x106/0x1d0 kernel/workqueue.c:2452
usb_rh_urb_dequeue drivers/usb/core/hcd.c:845 [inline]
unlink1+0x344/0x3e0 drivers/usb/core/hcd.c:1580
usb_hcd_unlink_urb+0xe6/0x1e0 drivers/usb/core/hcd.c:1617
usb_kill_urb+0x10b/0x2f0 drivers/usb/core/urb.c:716
hub_quiesce+0x211/0x330 drivers/usb/core/hub.c:1412
hub_suspend+0x904/0xad0 drivers/usb/core/hub.c:4008
usb_suspend_interface drivers/usb/core/driver.c:1323 [inline]
usb_suspend_both+0x285/0x1040 drivers/usb/core/driver.c:1446
usb_runtime_suspend+0x58/0x110 drivers/usb/core/driver.c:2000
__rpm_callback+0x2c7/0x950 drivers/base/power/runtime.c:406
rpm_callback drivers/base/power/runtime.c:460 [inline]
rpm_suspend+0x8a0/0x17b0 drivers/base/power/runtime.c:698
__pm_runtime_suspend+0x12f/0x1a0 drivers/base/power/runtime.c:1167
pm_runtime_autosuspend include/linux/pm_runtime.h:415 [inline]
usb_runtime_idle+0x76/0x90 drivers/usb/core/driver.c:2037
rpm_idle+0x5b4/0x980 drivers/base/power/runtime.c:550
pm_runtime_work+0x11e/0x1b0 drivers/base/power/runtime.c:995
process_one_work kernel/workqueue.c:3322 [inline]
process_scheduled_works+0xa8e/0x14e0 kernel/workqueue.c:3405
worker_thread+0xa47/0xfb0 kernel/workqueue.c:3486
kthread+0x388/0x470 kernel/kthread.c:436
ret_from_fork+0x514/0xb70 arch/x86/kernel/process.c:158
ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:245
Second to last potentially related work creation:
kasan_save_stack+0x3e/0x60 mm/kasan/common.c:57
kasan_record_aux_stack+0xbd/0xd0 mm/kasan/generic.c:556
insert_work+0x3d/0x330 kernel/workqueue.c:2226
__queue_work+0xcd8/0x10a0 kernel/workqueue.c:2401
queue_work_on+0x106/0x1d0 kernel/workqueue.c:2452
rh_call_control drivers/usb/core/hcd.c:706 [inline]
rh_urb_enqueue drivers/usb/core/hcd.c:817 [inline]
usb_hcd_submit_urb+0xa3b/0x1b60 drivers/usb/core/hcd.c:1538
usb_start_wait_urb+0x13f/0x5b0 drivers/usb/core/message.c:62
usb_internal_control_msg drivers/usb/core/message.c:117 [inline]
usb_control_msg+0x234/0x3e0 drivers/usb/core/message.c:167
get_port_status drivers/usb/core/hub.c:607 [inline]
hub_ext_port_status+0x114/0x810 drivers/usb/core/hub.c:624
usb_hub_port_status drivers/usb/core/hub.c:674 [inline]
hub_activate+0x740/0x1b20 drivers/usb/core/hub.c:1185
process_one_work kernel/workqueue.c:3322 [inline]
process_scheduled_works+0xa8e/0x14e0 kernel/workqueue.c:3405
worker_thread+0xa47/0xfb0 kernel/workqueue.c:3486
kthread+0x388/0x470 kernel/kthread.c:436
ret_from_fork+0x514/0xb70 arch/x86/kernel/process.c:158
ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:245
The buggy address belongs to the object at ffff888020bd0000
which belongs to the cache kmalloc-8k of size 8192
The buggy address is located 5472 bytes inside of
freed 8192-byte region [ffff888020bd0000, ffff888020bd2000)
The buggy address belongs to the physical page:
page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x20bd0
head: order:3 mapcount:0 entire_mapcount:0 nr_pages_mapped:0 pincount:0
flags: 0xfff00000000040(head|node=0|zone=1|lastcpupid=0x7ff)
page_type: f5(slab)
raw: 00fff00000000040 ffff88801b005280 dead000000000100 dead000000000122
raw: 0000000000000000 0000000800020002 00000000f5000000 0000000000000000
head: 00fff00000000040 ffff88801b005280 dead000000000100 dead000000000122
head: 0000000000000000 0000000800020002 00000000f5000000 0000000000000000
head: 00fff00000000003 fffffffffffffe01 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 0xd20c0(__GFP_IO|__GFP_FS|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC), pid 10, tgid 10 (kworker/0:1), ts 3790461764, free_ts 0
set_page_owner include/linux/page_owner.h:32 [inline]
post_alloc_hook+0x1f9/0x250 mm/page_alloc.c:1859
prep_new_page mm/page_alloc.c:1867 [inline]
get_page_from_freelist+0x21fa/0x2270 mm/page_alloc.c:3946
__alloc_frozen_pages_noprof+0x18d/0x380 mm/page_alloc.c:5304
alloc_slab_page mm/slub.c:3266 [inline]
allocate_slab+0x79/0x5e0 mm/slub.c:3380
new_slab mm/slub.c:3426 [inline]
refill_objects+0x2d5/0x350 mm/slub.c:7310
refill_sheaf mm/slub.c:2804 [inline]
__pcs_replace_empty_main+0x2bf/0x6b0 mm/slub.c:4675
alloc_from_pcs mm/slub.c:4773 [inline]
slab_alloc_node mm/slub.c:4905 [inline]
__do_kmalloc_node mm/slub.c:5333 [inline]
__kmalloc_noprof+0x485/0x720 mm/slub.c:5359
_kmalloc_noprof include/linux/slab.h:992 [inline]
acpi_ut_initialize_buffer+0xca/0x170 drivers/acpi/acpica/utalloc.c:-1
acpi_rs_create_pci_routing_table+0x1c0/0xd90 drivers/acpi/acpica/rscreate.c:212
acpi_rs_get_prt_method_data+0xdf/0x150 drivers/acpi/acpica/rsutils.c:456
acpi_get_irq_routing_table+0x98/0xe0 drivers/acpi/acpica/rsxface.c:137
acpi_pci_irq_find_prt_entry+0x163/0x1040 drivers/acpi/pci_irq.c:215
acpi_pci_irq_lookup+0x45/0x690 drivers/acpi/pci_irq.c:299
acpi_pci_irq_enable+0x1ee/0x7a0 drivers/acpi/pci_irq.c:414
do_pci_enable_device+0x26f/0x4a0 drivers/pci/pci.c:1998
pci_enable_device_flags+0x5ab/0x700 drivers/pci/pci.c:2089
page_owner free stack trace missing
Memory state around the buggy address:
ffff888020bd1400: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
ffff888020bd1480: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
>ffff888020bd1500: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
^
ffff888020bd1580: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
ffff888020bd1600: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
==================================================================
---
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 syzkaller@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
^ permalink raw reply [flat|nested] 13+ messages in thread* Forwarded: Re: test patch 2026-08-01 0:01 [syzbot] [usb?] KASAN: slab-use-after-free Read in vhci_shutdown_connection syzbot @ 2026-09-07 13:57 ` syzbot 2026-09-07 14:14 ` syzbot ` (3 subsequent siblings) 4 siblings, 0 replies; 13+ messages in thread From: syzbot @ 2026-09-07 13:57 UTC (permalink / raw) To: linux-kernel, syzkaller-bugs For archival purposes, forwarding an incoming command email to linux-kernel@vger.kernel.org, syzkaller-bugs@googlegroups.com. *** Subject: Re: test patch Author: syedtayyabfarooq08@gmail.com #syz test --- a/drivers/usb/usbip/usbip_event.c +++ b/drivers/usb/usbip/usbip_event.c @@ -105,6,11 @@ int usbip_start_eh(struct usbip_device *ud) } EXPORT_SYMBOL_GPL(usbip_start_eh); +#define WORK_QUEUE_NAME "usbip_event" + +static struct workqueue_struct *usbip_queue; +static DECLARE_WORK(usbip_work, event_handler); + void usbip_stop_eh(struct usbip_device *ud) { unsigned long pending = ud->event & ~USBIP_EH_BYE; @@ -115,16 +120,12 @@ void usbip_stop_eh(struct usbip_device *ud) if (pending) usbip_dbg_eh("usbip_eh waiting completion %lx\n", pending); - wait_event_interruptible(ud->eh_waitq, !(ud->event & ~USBIP_EH_BYE)); + wait_event(ud->eh_waitq, !(ud->event & ~USBIP_EH_BYE)); + flush_workqueue(usbip_queue); usbip_dbg_eh("usbip_eh has stopped\n"); } EXPORT_SYMBOL_GPL(usbip_stop_eh); -#define WORK_QUEUE_NAME "usbip_event" - -static struct workqueue_struct *usbip_queue; -static DECLARE_WORK(usbip_work, event_handler); - int usbip_init_eh(void) { usbip_queue = create_singlethread_workqueue(WORK_QUEUE_NAME); ^ permalink raw reply [flat|nested] 13+ messages in thread
* Forwarded: Re: test patch 2026-08-01 0:01 [syzbot] [usb?] KASAN: slab-use-after-free Read in vhci_shutdown_connection syzbot 2026-09-07 13:57 ` Forwarded: Re: test patch syzbot @ 2026-09-07 14:14 ` syzbot 2026-09-08 11:07 ` syzbot ` (2 subsequent siblings) 4 siblings, 0 replies; 13+ messages in thread From: syzbot @ 2026-09-07 14:14 UTC (permalink / raw) To: linux-kernel, syzkaller-bugs For archival purposes, forwarding an incoming command email to linux-kernel@vger.kernel.org, syzkaller-bugs@googlegroups.com. *** Subject: Re: test patch Author: syedtayyabfarooq08@gmail.com #syz test diff --git a/drivers/usb/usbip/usbip_event.c b/drivers/usb/usbip/usbip_event.c index 0e00c2d000f8..e498102e8b26 100644 --- a/drivers/usb/usbip/usbip_event.c +++ b/drivers/usb/usbip/usbip_event.c @@ -105,6 +105,11 @@ int usbip_start_eh(struct usbip_device *ud) } EXPORT_SYMBOL_GPL(usbip_start_eh); +#define WORK_QUEUE_NAME "usbip_event" + +static struct workqueue_struct *usbip_queue; +static DECLARE_WORK(usbip_work, event_handler); + void usbip_stop_eh(struct usbip_device *ud) { unsigned long pending = ud->event & ~USBIP_EH_BYE; @@ -115,16 +120,12 @@ void usbip_stop_eh(struct usbip_device *ud) if (pending) usbip_dbg_eh("usbip_eh waiting completion %lx\n", pending); - wait_event_interruptible(ud->eh_waitq, !(ud->event & ~USBIP_EH_BYE)); + wait_event(ud->eh_waitq, !(ud->event & ~USBIP_EH_BYE)); + flush_workqueue(usbip_queue); usbip_dbg_eh("usbip_eh has stopped\n"); } EXPORT_SYMBOL_GPL(usbip_stop_eh); -#define WORK_QUEUE_NAME "usbip_event" - -static struct workqueue_struct *usbip_queue; -static DECLARE_WORK(usbip_work, event_handler); - int usbip_init_eh(void) { usbip_queue = create_singlethread_workqueue(WORK_QUEUE_NAME); ^ permalink raw reply [flat|nested] 13+ messages in thread
* Forwarded: Re: test patch 2026-08-01 0:01 [syzbot] [usb?] KASAN: slab-use-after-free Read in vhci_shutdown_connection syzbot 2026-09-07 13:57 ` Forwarded: Re: test patch syzbot 2026-09-07 14:14 ` syzbot @ 2026-09-08 11:07 ` syzbot 2026-09-09 6:32 ` syzbot 2026-09-09 12:33 ` syzbot 4 siblings, 0 replies; 13+ messages in thread From: syzbot @ 2026-09-08 11:07 UTC (permalink / raw) To: linux-kernel, syzkaller-bugs For archival purposes, forwarding an incoming command email to linux-kernel@vger.kernel.org, syzkaller-bugs@googlegroups.com. *** Subject: Re: test patch Author: syedtayyabfarooq08@gmail.com #syz test diff --git a/drivers/usb/usbip/usbip_event.c b/drivers/usb/usbip/usbip_event.c index 0e00c2d00..81d761891 100644 --- a/drivers/usb/usbip/usbip_event.c +++ b/drivers/usb/usbip/usbip_event.c @@ -115,7 +115,7 @@ void usbip_stop_eh(struct usbip_device *ud) if (pending) usbip_dbg_eh("usbip_eh waiting completion %lx\n", pending); - wait_event_interruptible(ud->eh_waitq, !(ud->event & ~USBIP_EH_BYE)); + wait_event(ud->eh_waitq, !(ud->event & ~USBIP_EH_BYE)); usbip_dbg_eh("usbip_eh has stopped\n"); } EXPORT_SYMBOL_GPL(usbip_stop_eh); ^ permalink raw reply [flat|nested] 13+ messages in thread
* Forwarded: Re: test patch 2026-08-01 0:01 [syzbot] [usb?] KASAN: slab-use-after-free Read in vhci_shutdown_connection syzbot ` (2 preceding siblings ...) 2026-09-08 11:07 ` syzbot @ 2026-09-09 6:32 ` syzbot 2026-09-09 12:33 ` syzbot 4 siblings, 0 replies; 13+ messages in thread From: syzbot @ 2026-09-09 6:32 UTC (permalink / raw) To: linux-kernel, syzkaller-bugs For archival purposes, forwarding an incoming command email to linux-kernel@vger.kernel.org, syzkaller-bugs@googlegroups.com. *** Subject: Re: test patch Author: syedtayyabfarooq08@gmail.com #syz test diff --git a/drivers/usb/gadget/function/u_serial.c b/drivers/usb/gadget/function/u_serial.c index cdd1dfc666c4..4435cc42d1c0 100644 --- a/drivers/usb/gadget/function/u_serial.c +++ b/drivers/usb/gadget/function/u_serial.c @@ -603,6 +603,41 @@ static int gserial_wakeup_host(struct gserial *gser) /* TTY Driver */ +static int gs_install(struct tty_driver *driver, struct tty_struct *tty) +{ + struct gs_port *port; + struct tty_port *tport; + int ret; + + mutex_lock(&ports[tty->index].lock); + port = ports[tty->index].port; + if (!port) { + mutex_unlock(&ports[tty->index].lock); + return -ENODEV; + } + + tport = tty_port_get(&port->port); + mutex_unlock(&ports[tty->index].lock); + + if (!tport) + return -ENODEV; + + ret = tty_port_install(tport, driver, tty); + if (ret) { + tty_port_put(tport); + return ret; + } + + tty->driver_data = port; + + return 0; +} + +static void gs_cleanup(struct tty_struct *tty) +{ + tty_port_put(tty->port); +} + /* * gs_open sets up the link between a gs_port and its associated TTY. * That link is broken *only* by TTY close(), and all driver methods @@ -911,6 +946,8 @@ static int gs_get_icount(struct tty_struct *tty, static const struct tty_operations gs_tty_ops = { .open = gs_open, .close = gs_close, + .install = gs_install, + .cleanup = gs_cleanup, .write = gs_write, .put_char = gs_put_char, .flush_chars = gs_flush_chars, @@ -1203,6 +1240,18 @@ static void gs_console_exit(struct gs_port *port) #endif +static void gs_port_destruct(struct tty_port *tport) +{ + struct gs_port *port = container_of(tport, struct gs_port, port); + + kfree(port); +} + +static const struct tty_port_operations gs_port_ops = { + .destruct = gs_port_destruct, +}; + + static int gs_port_alloc(unsigned port_num, struct usb_cdc_line_coding *coding) { @@ -1222,6 +1271,7 @@ gs_port_alloc(unsigned port_num, struct usb_cdc_line_coding *coding) } tty_port_init(&port->port); + port->port.ops = &gs_port_ops; spin_lock_init(&port->port_lock); init_waitqueue_head(&port->drain_wait); init_waitqueue_head(&port->close_wait); @@ -1258,8 +1308,7 @@ static void gserial_free_port(struct gs_port *port) /* wait for old opens to finish */ wait_event(port->close_wait, gs_closed(port)); WARN_ON(port->port_usb != NULL); - tty_port_destroy(&port->port); - kfree(port); + tty_port_put(&port->port); } void gserial_free_line(unsigned char port_num) ^ permalink raw reply [flat|nested] 13+ messages in thread
* Forwarded: Re: test patch 2026-08-01 0:01 [syzbot] [usb?] KASAN: slab-use-after-free Read in vhci_shutdown_connection syzbot ` (3 preceding siblings ...) 2026-09-09 6:32 ` syzbot @ 2026-09-09 12:33 ` syzbot 4 siblings, 0 replies; 13+ messages in thread From: syzbot @ 2026-09-09 12:33 UTC (permalink / raw) To: linux-kernel, syzkaller-bugs For archival purposes, forwarding an incoming command email to linux-kernel@vger.kernel.org, syzkaller-bugs@googlegroups.com. *** Subject: Re: test patch Author: syedtayyabfarooq08@gmail.com #syz test: git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master diff --git a/drivers/usb/gadget/function/u_serial.c b/drivers/usb/gadget/function/u_serial.c index cdd1dfc666c4..5974a9303ecf 100644 --- a/drivers/usb/gadget/function/u_serial.c +++ b/drivers/usb/gadget/function/u_serial.c @@ -603,6 +603,41 @@ static int gserial_wakeup_host(struct gserial *gser) /* TTY Driver */ +static int gs_install(struct tty_driver *driver, struct tty_struct *tty) +{ + struct gs_port *port; + struct tty_port *tport; + int ret; + + mutex_lock(&ports[tty->index].lock); + port = ports[tty->index].port; + if (!port) { + mutex_unlock(&ports[tty->index].lock); + return -ENODEV; + } + + tport = tty_port_get(&port->port); + mutex_unlock(&ports[tty->index].lock); + + if (!tport) + return -ENODEV; + + ret = tty_port_install(tport, driver, tty); + if (ret) { + tty_port_put(tport); + return ret; + } + + tty->driver_data = port; + + return 0; +} + +static void gs_cleanup(struct tty_struct *tty) +{ + tty_port_put(tty->port); +} + /* * gs_open sets up the link between a gs_port and its associated TTY. * That link is broken *only* by TTY close(), and all driver methods @@ -695,14 +730,16 @@ static void gs_close(struct tty_struct *tty, struct file *file) struct gs_port *port = tty->driver_data; struct gserial *gser; + if (!port) + return; + spin_lock_irq(&port->port_lock); if (port->port.count != 1) { raced_with_open: - if (port->port.count == 0) - WARN_ON(1); - else + if (port->port.count > 0) --port->port.count; + goto exit; } @@ -911,6 +948,8 @@ static int gs_get_icount(struct tty_struct *tty, static const struct tty_operations gs_tty_ops = { .open = gs_open, .close = gs_close, + .install = gs_install, + .cleanup = gs_cleanup, .write = gs_write, .put_char = gs_put_char, .flush_chars = gs_flush_chars, @@ -1203,6 +1242,18 @@ static void gs_console_exit(struct gs_port *port) #endif +static void gs_port_destruct(struct tty_port *tport) +{ + struct gs_port *port = container_of(tport, struct gs_port, port); + + kfree(port); +} + +static const struct tty_port_operations gs_port_ops = { + .destruct = gs_port_destruct, +}; + + static int gs_port_alloc(unsigned port_num, struct usb_cdc_line_coding *coding) { @@ -1222,6 +1273,7 @@ gs_port_alloc(unsigned port_num, struct usb_cdc_line_coding *coding) } tty_port_init(&port->port); + port->port.ops = &gs_port_ops; spin_lock_init(&port->port_lock); init_waitqueue_head(&port->drain_wait); init_waitqueue_head(&port->close_wait); @@ -1258,8 +1310,7 @@ static void gserial_free_port(struct gs_port *port) /* wait for old opens to finish */ wait_event(port->close_wait, gs_closed(port)); WARN_ON(port->port_usb != NULL); - tty_port_destroy(&port->port); - kfree(port); + tty_port_put(&port->port); } void gserial_free_line(unsigned char port_num) ^ permalink raw reply [flat|nested] 13+ messages in thread
* [syzbot] [serial?] KASAN: slab-use-after-free Write in tty_init_dev
@ 2026-07-31 6:14 syzbot
2026-09-09 7:10 ` Forwarded: Re: test patch syzbot
` (4 more replies)
0 siblings, 5 replies; 13+ messages in thread
From: syzbot @ 2026-07-31 6:14 UTC (permalink / raw)
To: gregkh, jirislaby, linux-kernel, linux-serial, syzkaller-bugs
Hello,
syzbot found the following issue on:
HEAD commit: fc02acf6ac0c Merge tag 'platform-drivers-x86-v7.2-4' of gi..
git tree: upstream
console output: https://syzkaller.appspot.com/x/log.txt?x=133e003e580000
kernel config: https://syzkaller.appspot.com/x/.config?x=145fa60d73086782
dashboard link: https://syzkaller.appspot.com/bug?extid=fe63e4d633540f230624
compiler: gcc (Debian 14.2.0-19) 14.2.0, GNU ld (GNU Binutils for Debian) 2.44
Unfortunately, I don't have any reproducer for this issue yet.
Downloadable assets:
disk image: https://storage.googleapis.com/syzbot-assets/67251350dd03/disk-fc02acf6.raw.xz
vmlinux: https://storage.googleapis.com/syzbot-assets/e4edd57a8c61/vmlinux-fc02acf6.xz
kernel image: https://storage.googleapis.com/syzbot-assets/04ff166cc853/bzImage-fc02acf6.xz
IMPORTANT: if you fix the issue, please add the following tag to the commit:
Reported-by: syzbot+fe63e4d633540f230624@syzkaller.appspotmail.com
==================================================================
BUG: KASAN: slab-use-after-free in tty_init_dev.part.0+0x44f/0x470 drivers/tty/tty_io.c:1424
Write of size 8 at addr ffff88807ca6c128 by task syz.4.611/10653
CPU: 1 UID: 0 PID: 10653 Comm: syz.4.611 Tainted: G L syzkaller #0 PREEMPT(full)
Tainted: [L]=SOFTLOCKUP
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 07/16/2026
Call Trace:
<TASK>
__dump_stack lib/dump_stack.c:94 [inline]
dump_stack_lvl+0x100/0x190 lib/dump_stack.c:120
print_address_description mm/kasan/report.c:378 [inline]
print_report+0x13d/0x4b0 mm/kasan/report.c:482
kasan_report+0xdf/0x1c0 mm/kasan/report.c:595
tty_init_dev.part.0+0x44f/0x470 drivers/tty/tty_io.c:1424
tty_init_dev include/linux/err.h:78 [inline]
tty_open_by_driver drivers/tty/tty_io.c:2073 [inline]
tty_open+0xa63/0xfa0 drivers/tty/tty_io.c:2120
chrdev_open+0x234/0x6a0 fs/char_dev.c:411
do_dentry_open+0x6ab/0x14d0 fs/open.c:947
vfs_open+0x82/0x3f0 fs/open.c:1052
do_open fs/namei.c:4700 [inline]
path_openat+0x2873/0x4280 fs/namei.c:4863
do_file_open+0x20e/0x430 fs/namei.c:4892
do_sys_openat2+0x10f/0x1e0 fs/open.c:1368
do_sys_open fs/open.c:1374 [inline]
__do_sys_openat fs/open.c:1390 [inline]
__se_sys_openat fs/open.c:1385 [inline]
__x64_sys_openat+0x12d/0x210 fs/open.c:1385
do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline]
do_syscall_64+0x115/0x870 arch/x86/entry/syscall_64.c:94
entry_SYSCALL_64_after_hwframe+0x77/0x7f
RIP: 0033:0x7f4bb7d9de99
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:00007f4bb8ba3028 EFLAGS: 00000246 ORIG_RAX: 0000000000000101
RAX: ffffffffffffffda RBX: 00007f4bb8026270 RCX: 00007f4bb7d9de99
RDX: 0000000000000002 RSI: 0000200000000800 RDI: ffffffffffffff9c
RBP: 00007f4bb7e33eaf R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
R13: 00007f4bb8026308 R14: 00007f4bb8026270 R15: 00007ffee78b82f8
</TASK>
Allocated by task 10639:
kasan_save_stack+0x30/0x50 mm/kasan/common.c:57
kasan_save_track+0x14/0x30 mm/kasan/common.c:78
poison_kmalloc_redzone mm/kasan/common.c:398 [inline]
__kasan_kmalloc+0xaa/0xb0 mm/kasan/common.c:415
kasan_kmalloc include/linux/kasan.h:263 [inline]
__kmalloc_cache_noprof+0x2e5/0x6c0 mm/slub.c:5489
_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+0xac/0x710 drivers/usb/gadget/function/u_serial.c:1298
gserial_alloc_line+0x16/0xa0 drivers/usb/gadget/function/u_serial.c:1332
gser_alloc_inst+0x86/0x100 drivers/usb/gadget/function/f_serial.c:325
try_get_usb_function_instance+0x136/0x1f0 drivers/usb/gadget/functions.c:28
usb_get_function_instance+0x16/0x70 drivers/usb/gadget/functions.c:44
function_make+0x18c/0x3f0 drivers/usb/gadget/configfs.c:626
configfs_mkdir+0x51e/0xb70 fs/configfs/dir.c:1360
vfs_mkdir+0x361/0x850 fs/namei.c:5276
filename_mkdirat+0x48b/0x5e0 fs/namei.c:5309
__do_sys_mkdirat fs/namei.c:5330 [inline]
__se_sys_mkdirat fs/namei.c:5327 [inline]
__x64_sys_mkdirat+0x89/0xc0 fs/namei.c:5327
do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline]
do_syscall_64+0x115/0x870 arch/x86/entry/syscall_64.c:94
entry_SYSCALL_64_after_hwframe+0x77/0x7f
Freed by task 10641:
kasan_save_stack+0x30/0x50 mm/kasan/common.c:57
kasan_save_track+0x14/0x30 mm/kasan/common.c:78
kasan_save_free_info+0x3b/0x70 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:2677 [inline]
slab_free mm/slub.c:6377 [inline]
kfree+0x22b/0x6c0 mm/slub.c:6692
gserial_free_port+0x146/0x2f0 drivers/usb/gadget/function/u_serial.c:1262
gserial_free_line+0xf8/0x1e0 drivers/usb/gadget/function/u_serial.c:1279
gser_free_inst+0x3b/0x50 drivers/usb/gadget/function/f_serial.c:311
usb_put_function_instance+0x89/0xc0 drivers/usb/gadget/functions.c:77
config_item_cleanup+0x146/0x240 fs/configfs/item.c:128
config_item_release fs/configfs/item.c:137 [inline]
kref_put include/linux/kref.h:65 [inline]
config_item_put fs/configfs/item.c:149 [inline]
config_item_put+0x93/0xb0 fs/configfs/item.c:146
configfs_rmdir+0x5e3/0x950 fs/configfs/dir.c:1571
vfs_rmdir fs/namei.c:5381 [inline]
vfs_rmdir+0x328/0x8a0 fs/namei.c:5354
filename_rmdir+0x31a/0x5c0 fs/namei.c:5438
__do_sys_rmdir fs/namei.c:5461 [inline]
__se_sys_rmdir fs/namei.c:5458 [inline]
__x64_sys_rmdir+0x46/0x70 fs/namei.c:5458
do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline]
do_syscall_64+0x115/0x870 arch/x86/entry/syscall_64.c:94
entry_SYSCALL_64_after_hwframe+0x77/0x7f
The buggy address belongs to the object at ffff88807ca6c000
which belongs to the cache kmalloc-2k of size 2048
The buggy address is located 296 bytes inside of
freed 2048-byte region [ffff88807ca6c000, ffff88807ca6c800)
The buggy address belongs to the physical page:
page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x7ca68
head: order:3 mapcount:0 entire_mapcount:0 nr_pages_mapped:0 pincount:0
flags: 0xfff00000000040(head|node=0|zone=1|lastcpupid=0x7ff)
page_type: f5(slab)
raw: 00fff00000000040 ffff88813fe28000 dead000000000100 dead000000000122
raw: 0000000000000000 0000000800080008 00000000f5000000 0000000000000000
head: 00fff00000000040 ffff88813fe28000 dead000000000100 dead000000000122
head: 0000000000000000 0000000800080008 00000000f5000000 0000000000000000
head: 00fff00000000003 fffffffffffffe01 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 0xd20c0(__GFP_IO|__GFP_FS|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC), pid 5609, tgid 5609 (syz-executor), ts 72918138577, free_ts 72897580454
set_page_owner include/linux/page_owner.h:32 [inline]
post_alloc_hook+0xfd/0x120 mm/page_alloc.c:1859
prep_new_page mm/page_alloc.c:1867 [inline]
get_page_from_freelist+0xf48/0x3530 mm/page_alloc.c:3946
__alloc_frozen_pages_noprof+0x299/0x2dc0 mm/page_alloc.c:5304
alloc_slab_page mm/slub.c:3266 [inline]
allocate_slab mm/slub.c:3380 [inline]
new_slab+0xa2/0x640 mm/slub.c:3426
refill_objects+0xe3/0x410 mm/slub.c:7310
refill_sheaf mm/slub.c:2804 [inline]
__pcs_replace_empty_main+0x376/0x680 mm/slub.c:4675
alloc_from_pcs mm/slub.c:4773 [inline]
slab_alloc_node mm/slub.c:4905 [inline]
__kmalloc_cache_noprof+0x479/0x6c0 mm/slub.c:5485
_kmalloc_noprof include/linux/slab.h:988 [inline]
_kzalloc_noprof include/linux/slab.h:1309 [inline]
rxrpc_alloc_connection+0xa3/0x770 net/rxrpc/conn_object.c:62
rxrpc_prealloc_service_connection+0x26/0x390 net/rxrpc/conn_service.c:123
rxrpc_service_prealloc_one+0x2c5/0x1040 net/rxrpc/call_accept.c:86
rxrpc_kernel_charge_accept+0xdd/0x120 net/rxrpc/call_accept.c:489
afs_charge_preallocation+0xd8/0x360 fs/afs/rxrpc.c:766
afs_open_socket+0x31e/0x3f0 fs/afs/rxrpc.c:112
afs_net_init+0x825/0xb00 fs/afs/main.c:116
ops_init+0x1e2/0x5f0 net/core/net_namespace.c:137
setup_net+0x118/0x3a0 net/core/net_namespace.c:446
page last free pid 5618 tgid 5618 stack trace:
reset_page_owner include/linux/page_owner.h:25 [inline]
__free_pages_prepare mm/page_alloc.c:1406 [inline]
__free_frozen_pages+0x79f/0x1090 mm/page_alloc.c:2950
qlink_free mm/kasan/quarantine.c:163 [inline]
qlist_free_all+0x47/0xf0 mm/kasan/quarantine.c:179
kasan_quarantine_reduce+0x1a0/0x1f0 mm/kasan/quarantine.c:286
__kasan_slab_alloc+0x69/0x90 mm/kasan/common.c:350
kasan_slab_alloc include/linux/kasan.h:253 [inline]
slab_post_alloc_hook mm/slub.c:4584 [inline]
slab_alloc_node mm/slub.c:4917 [inline]
__kmalloc_cache_noprof+0x265/0x6c0 mm/slub.c:5485
_kmalloc_noprof include/linux/slab.h:988 [inline]
netdev_name_node_alloc net/core/dev.c:276 [inline]
netdev_name_node_head_alloc net/core/dev.c:290 [inline]
register_netdevice+0x50c/0x25a0 net/core/dev.c:11359
__ip_tunnel_create+0x52b/0x670 net/ipv4/ip_tunnel.c:268
ip_tunnel_init_net+0x230/0x780 net/ipv4/ip_tunnel.c:1150
ops_init+0x1e2/0x5f0 net/core/net_namespace.c:137
setup_net+0x118/0x3a0 net/core/net_namespace.c:446
copy_net_ns+0x46f/0x7c0 net/core/net_namespace.c:579
create_new_namespaces+0x3ea/0xac0 kernel/nsproxy.c:132
unshare_nsproxy_namespaces+0xf2/0x220 kernel/nsproxy.c:234
ksys_unshare+0x438/0xab0 kernel/fork.c:3269
__do_sys_unshare kernel/fork.c:3343 [inline]
__se_sys_unshare kernel/fork.c:3341 [inline]
__x64_sys_unshare+0x31/0x40 kernel/fork.c:3341
do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline]
do_syscall_64+0x115/0x870 arch/x86/entry/syscall_64.c:94
Memory state around the buggy address:
ffff88807ca6c000: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
ffff88807ca6c080: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
>ffff88807ca6c100: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
^
ffff88807ca6c180: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
ffff88807ca6c200: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
==================================================================
---
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 syzkaller@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 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
^ permalink raw reply [flat|nested] 13+ messages in thread* Forwarded: Re: test patch 2026-07-31 6:14 [syzbot] [serial?] KASAN: slab-use-after-free Write in tty_init_dev syzbot @ 2026-09-09 7:10 ` syzbot 2026-09-09 7:44 ` syzbot ` (3 subsequent siblings) 4 siblings, 0 replies; 13+ messages in thread From: syzbot @ 2026-09-09 7:10 UTC (permalink / raw) To: linux-kernel, syzkaller-bugs For archival purposes, forwarding an incoming command email to linux-kernel@vger.kernel.org, syzkaller-bugs@googlegroups.com. *** Subject: Re: test patch Author: syedtayyabfarooq08@gmail.com #syz test: git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master diff --git a/drivers/usb/gadget/function/u_serial.c b/drivers/usb/gadget/function/u_serial.c index cdd1dfc666c4..4435cc42d1c0 100644 --- a/drivers/usb/gadget/function/u_serial.c +++ b/drivers/usb/gadget/function/u_serial.c @@ -603,6 +603,41 @@ static int gserial_wakeup_host(struct gserial *gser) /* TTY Driver */ +static int gs_install(struct tty_driver *driver, struct tty_struct *tty) +{ + struct gs_port *port; + struct tty_port *tport; + int ret; + + mutex_lock(&ports[tty->index].lock); + port = ports[tty->index].port; + if (!port) { + mutex_unlock(&ports[tty->index].lock); + return -ENODEV; + } + + tport = tty_port_get(&port->port); + mutex_unlock(&ports[tty->index].lock); + + if (!tport) + return -ENODEV; + + ret = tty_port_install(tport, driver, tty); + if (ret) { + tty_port_put(tport); + return ret; + } + + tty->driver_data = port; + + return 0; +} + +static void gs_cleanup(struct tty_struct *tty) +{ + tty_port_put(tty->port); +} + /* * gs_open sets up the link between a gs_port and its associated TTY. * That link is broken *only* by TTY close(), and all driver methods @@ -911,6 +946,8 @@ static int gs_get_icount(struct tty_struct *tty, static const struct tty_operations gs_tty_ops = { .open = gs_open, .close = gs_close, + .install = gs_install, + .cleanup = gs_cleanup, .write = gs_write, .put_char = gs_put_char, .flush_chars = gs_flush_chars, @@ -1203,6 +1240,18 @@ static void gs_console_exit(struct gs_port *port) #endif +static void gs_port_destruct(struct tty_port *tport) +{ + struct gs_port *port = container_of(tport, struct gs_port, port); + + kfree(port); +} + +static const struct tty_port_operations gs_port_ops = { + .destruct = gs_port_destruct, +}; + + static int gs_port_alloc(unsigned port_num, struct usb_cdc_line_coding *coding) { @@ -1222,6 +1271,7 @@ gs_port_alloc(unsigned port_num, struct usb_cdc_line_coding *coding) } tty_port_init(&port->port); + port->port.ops = &gs_port_ops; spin_lock_init(&port->port_lock); init_waitqueue_head(&port->drain_wait); init_waitqueue_head(&port->close_wait); @@ -1258,8 +1308,7 @@ static void gserial_free_port(struct gs_port *port) /* wait for old opens to finish */ wait_event(port->close_wait, gs_closed(port)); WARN_ON(port->port_usb != NULL); - tty_port_destroy(&port->port); - kfree(port); + tty_port_put(&port->port); } void gserial_free_line(unsigned char port_num) ^ permalink raw reply [flat|nested] 13+ messages in thread
* Forwarded: Re: test patch 2026-07-31 6:14 [syzbot] [serial?] KASAN: slab-use-after-free Write in tty_init_dev syzbot 2026-09-09 7:10 ` Forwarded: Re: test patch syzbot @ 2026-09-09 7:44 ` syzbot 2026-09-09 11:35 ` syzbot ` (2 subsequent siblings) 4 siblings, 0 replies; 13+ messages in thread From: syzbot @ 2026-09-09 7:44 UTC (permalink / raw) To: linux-kernel, syzkaller-bugs For archival purposes, forwarding an incoming command email to linux-kernel@vger.kernel.org, syzkaller-bugs@googlegroups.com. *** Subject: Re: test patch Author: syedtayyabfarooq08@gmail.com #syz test: git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master diff --git a/drivers/usb/gadget/function/u_serial.c b/drivers/usb/gadget/function/u_serial.c index cdd1dfc666c4..4020807a4d2c 100644 --- a/drivers/usb/gadget/function/u_serial.c +++ b/drivers/usb/gadget/function/u_serial.c @@ -603,6 +603,41 @@ static int gserial_wakeup_host(struct gserial *gser) /* TTY Driver */ +static int gs_install(struct tty_driver *driver, struct tty_struct *tty) +{ + struct gs_port *port; + struct tty_port *tport; + int ret; + + mutex_lock(&ports[tty->index].lock); + port = ports[tty->index].port; + if (!port) { + mutex_unlock(&ports[tty->index].lock); + return -ENODEV; + } + + tport = tty_port_get(&port->port); + mutex_unlock(&ports[tty->index].lock); + + if (!tport) + return -ENODEV; + + ret = tty_port_install(tport, driver, tty); + if (ret) { + tty_port_put(tport); + return ret; + } + + tty->driver_data = port; + + return 0; +} + +static void gs_cleanup(struct tty_struct *tty) +{ + tty_port_put(tty->port); +} + /* * gs_open sets up the link between a gs_port and its associated TTY. * That link is broken *only* by TTY close(), and all driver methods @@ -695,6 +730,9 @@ static void gs_close(struct tty_struct *tty, struct file *file) struct gs_port *port = tty->driver_data; struct gserial *gser; + if (!port) + return; + spin_lock_irq(&port->port_lock); if (port->port.count != 1) { @@ -911,6 +949,8 @@ static int gs_get_icount(struct tty_struct *tty, static const struct tty_operations gs_tty_ops = { .open = gs_open, .close = gs_close, + .install = gs_install, + .cleanup = gs_cleanup, .write = gs_write, .put_char = gs_put_char, .flush_chars = gs_flush_chars, @@ -1203,6 +1243,18 @@ static void gs_console_exit(struct gs_port *port) #endif +static void gs_port_destruct(struct tty_port *tport) +{ + struct gs_port *port = container_of(tport, struct gs_port, port); + + kfree(port); +} + +static const struct tty_port_operations gs_port_ops = { + .destruct = gs_port_destruct, +}; + + static int gs_port_alloc(unsigned port_num, struct usb_cdc_line_coding *coding) { @@ -1222,6 +1274,7 @@ gs_port_alloc(unsigned port_num, struct usb_cdc_line_coding *coding) } tty_port_init(&port->port); + port->port.ops = &gs_port_ops; spin_lock_init(&port->port_lock); init_waitqueue_head(&port->drain_wait); init_waitqueue_head(&port->close_wait); @@ -1258,8 +1311,7 @@ static void gserial_free_port(struct gs_port *port) /* wait for old opens to finish */ wait_event(port->close_wait, gs_closed(port)); WARN_ON(port->port_usb != NULL); - tty_port_destroy(&port->port); - kfree(port); + tty_port_put(&port->port); } void gserial_free_line(unsigned char port_num) ^ permalink raw reply [flat|nested] 13+ messages in thread
* Forwarded: Re: test patch 2026-07-31 6:14 [syzbot] [serial?] KASAN: slab-use-after-free Write in tty_init_dev syzbot 2026-09-09 7:10 ` Forwarded: Re: test patch syzbot 2026-09-09 7:44 ` syzbot @ 2026-09-09 11:35 ` syzbot 2026-09-09 13:06 ` syzbot 2026-09-10 6:09 ` syzbot 4 siblings, 0 replies; 13+ messages in thread From: syzbot @ 2026-09-09 11:35 UTC (permalink / raw) To: linux-kernel, syzkaller-bugs For archival purposes, forwarding an incoming command email to linux-kernel@vger.kernel.org, syzkaller-bugs@googlegroups.com. *** Subject: Re: test patch Author: syedtayyabfarooq08@gmail.com #syz test: git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master diff --git a/drivers/usb/gadget/function/u_serial.c b/drivers/usb/gadget/function/u_serial.c index cdd1dfc666c4..c2fba561ba03 100644 --- a/drivers/usb/gadget/function/u_serial.c +++ b/drivers/usb/gadget/function/u_serial.c @@ -603,6 +603,41 @@ static int gserial_wakeup_host(struct gserial *gser) /* TTY Driver */ +static int gs_install(struct tty_driver *driver, struct tty_struct *tty) +{ + struct gs_port *port; + struct tty_port *tport; + int ret; + + mutex_lock(&ports[tty->index].lock); + port = ports[tty->index].port; + if (!port) { + mutex_unlock(&ports[tty->index].lock); + return -ENODEV; + } + + tport = tty_port_get(&port->port); + mutex_unlock(&ports[tty->index].lock); + + if (!tport) + return -ENODEV; + + ret = tty_port_install(tport, driver, tty); + if (ret) { + tty_port_put(tport); + return ret; + } + + tty->driver_data = port; + + return 0; +} + +static void gs_cleanup(struct tty_struct *tty) +{ + tty_port_put(tty->port); +} + /* * gs_open sets up the link between a gs_port and its associated TTY. * That link is broken *only* by TTY close(), and all driver methods @@ -695,15 +730,17 @@ static void gs_close(struct tty_struct *tty, struct file *file) struct gs_port *port = tty->driver_data; struct gserial *gser; + if (!port) + return; + spin_lock_irq(&port->port_lock); if (port->port.count != 1) { raced_with_open: - if (port->port.count == 0) - WARN_ON(1); - else + if (port->port.count > 0) --port->port.count; - goto exit; + + goto exit } pr_debug("gs_close: ttyGS%d (%p,%p) ...\n", port->port_num, tty, file); @@ -911,6 +948,8 @@ static int gs_get_icount(struct tty_struct *tty, static const struct tty_operations gs_tty_ops = { .open = gs_open, .close = gs_close, + .install = gs_install, + .cleanup = gs_cleanup, .write = gs_write, .put_char = gs_put_char, .flush_chars = gs_flush_chars, @@ -1203,6 +1242,18 @@ static void gs_console_exit(struct gs_port *port) #endif +static void gs_port_destruct(struct tty_port *tport) +{ + struct gs_port *port = container_of(tport, struct gs_port, port); + + kfree(port); +} + +static const struct tty_port_operations gs_port_ops = { + .destruct = gs_port_destruct, +}; + + static int gs_port_alloc(unsigned port_num, struct usb_cdc_line_coding *coding) { @@ -1222,6 +1273,7 @@ gs_port_alloc(unsigned port_num, struct usb_cdc_line_coding *coding) } tty_port_init(&port->port); + port->port.ops = &gs_port_ops; spin_lock_init(&port->port_lock); init_waitqueue_head(&port->drain_wait); init_waitqueue_head(&port->close_wait); @@ -1258,8 +1310,7 @@ static void gserial_free_port(struct gs_port *port) /* wait for old opens to finish */ wait_event(port->close_wait, gs_closed(port)); WARN_ON(port->port_usb != NULL); - tty_port_destroy(&port->port); - kfree(port); + tty_port_put(&port->port); } void gserial_free_line(unsigned char port_num) ^ permalink raw reply [flat|nested] 13+ messages in thread
* Forwarded: Re: test patch 2026-07-31 6:14 [syzbot] [serial?] KASAN: slab-use-after-free Write in tty_init_dev syzbot ` (2 preceding siblings ...) 2026-09-09 11:35 ` syzbot @ 2026-09-09 13:06 ` syzbot 2026-09-10 6:09 ` syzbot 4 siblings, 0 replies; 13+ messages in thread From: syzbot @ 2026-09-09 13:06 UTC (permalink / raw) To: linux-kernel, syzkaller-bugs For archival purposes, forwarding an incoming command email to linux-kernel@vger.kernel.org, syzkaller-bugs@googlegroups.com. *** Subject: Re: test patch Author: syedtayyabfarooq08@gmail.com #syz test: git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master diff --git a/drivers/usb/gadget/function/u_serial.c b/drivers/usb/gadget/function/u_serial.c index cdd1dfc666c4..5974a9303ecf 100644 --- a/drivers/usb/gadget/function/u_serial.c +++ b/drivers/usb/gadget/function/u_serial.c @@ -603,6 +603,41 @@ static int gserial_wakeup_host(struct gserial *gser) /* TTY Driver */ +static int gs_install(struct tty_driver *driver, struct tty_struct *tty) +{ + struct gs_port *port; + struct tty_port *tport; + int ret; + + mutex_lock(&ports[tty->index].lock); + port = ports[tty->index].port; + if (!port) { + mutex_unlock(&ports[tty->index].lock); + return -ENODEV; + } + + tport = tty_port_get(&port->port); + mutex_unlock(&ports[tty->index].lock); + + if (!tport) + return -ENODEV; + + ret = tty_port_install(tport, driver, tty); + if (ret) { + tty_port_put(tport); + return ret; + } + + tty->driver_data = port; + + return 0; +} + +static void gs_cleanup(struct tty_struct *tty) +{ + tty_port_put(tty->port); +} + /* * gs_open sets up the link between a gs_port and its associated TTY. * That link is broken *only* by TTY close(), and all driver methods @@ -695,14 +730,16 @@ static void gs_close(struct tty_struct *tty, struct file *file) struct gs_port *port = tty->driver_data; struct gserial *gser; + if (!port) + return; + spin_lock_irq(&port->port_lock); if (port->port.count != 1) { raced_with_open: - if (port->port.count == 0) - WARN_ON(1); - else + if (port->port.count > 0) --port->port.count; + goto exit; } @@ -911,6 +948,8 @@ static int gs_get_icount(struct tty_struct *tty, static const struct tty_operations gs_tty_ops = { .open = gs_open, .close = gs_close, + .install = gs_install, + .cleanup = gs_cleanup, .write = gs_write, .put_char = gs_put_char, .flush_chars = gs_flush_chars, @@ -1203,6 +1242,18 @@ static void gs_console_exit(struct gs_port *port) #endif +static void gs_port_destruct(struct tty_port *tport) +{ + struct gs_port *port = container_of(tport, struct gs_port, port); + + kfree(port); +} + +static const struct tty_port_operations gs_port_ops = { + .destruct = gs_port_destruct, +}; + + static int gs_port_alloc(unsigned port_num, struct usb_cdc_line_coding *coding) { @@ -1222,6 +1273,7 @@ gs_port_alloc(unsigned port_num, struct usb_cdc_line_coding *coding) } tty_port_init(&port->port); + port->port.ops = &gs_port_ops; spin_lock_init(&port->port_lock); init_waitqueue_head(&port->drain_wait); init_waitqueue_head(&port->close_wait); @@ -1258,8 +1310,7 @@ static void gserial_free_port(struct gs_port *port) /* wait for old opens to finish */ wait_event(port->close_wait, gs_closed(port)); WARN_ON(port->port_usb != NULL); - tty_port_destroy(&port->port); - kfree(port); + tty_port_put(&port->port); } void gserial_free_line(unsigned char port_num) ^ permalink raw reply [flat|nested] 13+ messages in thread
* Forwarded: Re: test patch 2026-07-31 6:14 [syzbot] [serial?] KASAN: slab-use-after-free Write in tty_init_dev syzbot ` (3 preceding siblings ...) 2026-09-09 13:06 ` syzbot @ 2026-09-10 6:09 ` syzbot 4 siblings, 0 replies; 13+ messages in thread From: syzbot @ 2026-09-10 6:09 UTC (permalink / raw) To: linux-kernel, syzkaller-bugs For archival purposes, forwarding an incoming command email to linux-kernel@vger.kernel.org, syzkaller-bugs@googlegroups.com. *** Subject: Re: test patch Author: syedtayyabfarooq08@gmail.com #syz test: git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master diff --git a/drivers/usb/gadget/function/u_serial.c b/drivers/usb/gadget/function/u_serial.c index cdd1dfc666c4..9da860589861 100644 --- a/drivers/usb/gadget/function/u_serial.c +++ b/drivers/usb/gadget/function/u_serial.c @@ -603,6 +603,41 @@ static int gserial_wakeup_host(struct gserial *gser) /* TTY Driver */ +static int gs_install(struct tty_driver *driver, struct tty_struct *tty) +{ + struct gs_port *port; + struct tty_port *tport; + int ret; + + mutex_lock(&ports[tty->index].lock); + port = ports[tty->index].port; + if (!port) { + mutex_unlock(&ports[tty->index].lock); + return -ENODEV; + } + + tport = tty_port_get(&port->port); + mutex_unlock(&ports[tty->index].lock); + + if (!tport) + return -ENODEV; + + ret = tty_port_install(tport, driver, tty); + if (ret) { + tty_port_put(tport); + return ret; + } + + tty->driver_data = port; + + return 0; +} + +static void gs_cleanup(struct tty_struct *tty) +{ + tty_port_put(tty->port); +} + /* * gs_open sets up the link between a gs_port and its associated TTY. * That link is broken *only* by TTY close(), and all driver methods @@ -615,7 +650,7 @@ static int gs_open(struct tty_struct *tty, struct file *file) int status = 0; mutex_lock(&ports[port_num].lock); - port = ports[port_num].port; + port = tty->driver_data; if (!port) { status = -ENODEV; goto out; @@ -648,7 +683,6 @@ static int gs_open(struct tty_struct *tty, struct file *file) if (port->port.count++) goto exit_unlock_port; - tty->driver_data = port; port->port.tty = tty; /* if connected, start the I/O stream */ @@ -695,14 +729,16 @@ static void gs_close(struct tty_struct *tty, struct file *file) struct gs_port *port = tty->driver_data; struct gserial *gser; + if (!port) + return; + spin_lock_irq(&port->port_lock); if (port->port.count != 1) { raced_with_open: - if (port->port.count == 0) - WARN_ON(1); - else + if (port->port.count > 0) --port->port.count; + goto exit; } @@ -911,6 +947,8 @@ static int gs_get_icount(struct tty_struct *tty, static const struct tty_operations gs_tty_ops = { .open = gs_open, .close = gs_close, + .install = gs_install, + .cleanup = gs_cleanup, .write = gs_write, .put_char = gs_put_char, .flush_chars = gs_flush_chars, @@ -1203,6 +1241,18 @@ static void gs_console_exit(struct gs_port *port) #endif +static void gs_port_destruct(struct tty_port *tport) +{ + struct gs_port *port = container_of(tport, struct gs_port, port); + + kfree(port); +} + +static const struct tty_port_operations gs_port_ops = { + .destruct = gs_port_destruct, +}; + + static int gs_port_alloc(unsigned port_num, struct usb_cdc_line_coding *coding) { @@ -1222,6 +1272,7 @@ gs_port_alloc(unsigned port_num, struct usb_cdc_line_coding *coding) } tty_port_init(&port->port); + port->port.ops = &gs_port_ops; spin_lock_init(&port->port_lock); init_waitqueue_head(&port->drain_wait); init_waitqueue_head(&port->close_wait); @@ -1258,8 +1309,7 @@ static void gserial_free_port(struct gs_port *port) /* wait for old opens to finish */ wait_event(port->close_wait, gs_closed(port)); WARN_ON(port->port_usb != NULL); - tty_port_destroy(&port->port); - kfree(port); + tty_port_put(&port->port); } void gserial_free_line(unsigned char port_num) ^ permalink raw reply [flat|nested] 13+ messages in thread
end of thread, other threads:[~2026-09-10 11:48 UTC | newest] Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- 2026-09-06 20:15 [syzbot] [trace?] WARNING in ring_buffer_map_get_reader (3) syzbot 2026-09-07 17:57 ` syzbot 2026-09-10 11:48 ` Forwarded: Re: test patch syzbot -- strict thread matches above, loose matches on Subject: below -- 2026-08-01 0:01 [syzbot] [usb?] KASAN: slab-use-after-free Read in vhci_shutdown_connection syzbot 2026-09-07 13:57 ` Forwarded: Re: test patch syzbot 2026-09-07 14:14 ` syzbot 2026-09-08 11:07 ` syzbot 2026-09-09 6:32 ` syzbot 2026-09-09 12:33 ` syzbot 2026-07-31 6:14 [syzbot] [serial?] KASAN: slab-use-after-free Write in tty_init_dev syzbot 2026-09-09 7:10 ` Forwarded: Re: test patch syzbot 2026-09-09 7:44 ` syzbot 2026-09-09 11:35 ` syzbot 2026-09-09 13:06 ` syzbot 2026-09-10 6:09 ` syzbot
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®