[v5.15] possible deadlock in usbip_sockfd_store

0 views
Skip to first unread message

syzbot

unread,
Aug 11, 2026, 3:53:29 PM (6 days ago) Aug 11
to syzkaller...@googlegroups.com
Hello,

syzbot found the following issue on:

HEAD commit: aabd761612db Linux 5.15.215
git tree: linux-5.15.y
console output: https://syzkaller.appspot.com/x/log.txt?x=11f37879580000
kernel config: https://syzkaller.appspot.com/x/.config?x=f161cbc9aef65db0
dashboard link: https://syzkaller.appspot.com/bug?extid=ee622888c194a0fba03f
compiler: Debian clang version 22.1.8 (++20260613092233+e80beda6e255-1~exp1~20260613092250.77), Debian LLD 22.1.8

Unfortunately, I don't have any reproducer for this issue yet.

Downloadable assets:
disk image: https://storage.googleapis.com/syzbot-assets/f636f56d3662/disk-aabd7616.raw.xz
vmlinux: https://storage.googleapis.com/syzbot-assets/f1a46620f40c/vmlinux-aabd7616.xz
kernel image: https://storage.googleapis.com/syzbot-assets/9b78bb48b022/bzImage-aabd7616.xz

IMPORTANT: if you fix the issue, please add the following tag to the commit:
Reported-by: syzbot+ee6228...@syzkaller.appspotmail.com

usbip-vudc usbip-vudc.0: failed to lookup sock
========================================================
WARNING: possible irq lock inversion dependency detected
syzkaller #0 Not tainted
--------------------------------------------------------
syz.4.368/6040 just changed the state of lock:
ffff888148594908 (&udc->lock){+.+.}-{2:2}, at: usbip_sockfd_store+0x131/0x8d0 drivers/usb/usbip/vudc_sysfs.c:116
but this lock was taken by another, SOFTIRQ-safe lock in the past:
(&gi->spinlock){..-.}-{2:2}


and interrupts could create inverse lock ordering between them.


other info that might help us debug this:
Possible interrupt unsafe locking scenario:

CPU0 CPU1
---- ----
lock(&udc->lock);
local_irq_disable();
lock(&gi->spinlock);
lock(&udc->lock);
<Interrupt>
lock(&gi->spinlock);

*** DEADLOCK ***

6 locks held by syz.4.368/6040:
#0: ffff88801ee2b4f0 (&f->f_pos_lock){+.+.}-{3:3}, at: __fdget_pos+0x2bf/0x370 fs/file.c:1056
#1: ffff8880260ae460 (sb_writers#8){.+.+}-{0:0}, at: vfs_write+0x296/0xd70 fs/read_write.c:590
#2: ffff8880204cd088 (&of->mutex){+.+.}-{3:3}, at: kernfs_fop_write_iter+0x1dc/0x500 fs/kernfs/file.c:287
#3: ffff8881484f5008 (kn->active#801){.+.+}-{0:0}, at: kernfs_fop_write_iter+0x1fd/0x500 fs/kernfs/file.c:288
#4: ffff888148594708 (&ud->sysfs_lock){+.+.}-{3:3}, at: usbip_sockfd_store+0x11f/0x8d0 drivers/usb/usbip/vudc_sysfs.c:115
#5: ffff888148594908 (&udc->lock){+.+.}-{2:2}, at: usbip_sockfd_store+0x131/0x8d0 drivers/usb/usbip/vudc_sysfs.c:116

the shortest dependencies between 2nd lock and 1st lock:
-> (&gi->spinlock){..-.}-{2:2} {
IN-SOFTIRQ-W at:
lock_acquire+0x19e/0x400 kernel/locking/lockdep.c:5623
__raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:110 [inline]
_raw_spin_lock_irqsave+0xb0/0x100 kernel/locking/spinlock.c:162
configfs_composite_setup+0x5d/0x100 drivers/usb/gadget/configfs.c:1485
dummy_timer+0x1338/0x33c0 drivers/usb/gadget/udc/dummy_hcd.c:1930
call_timer_fn+0x17b/0x540 kernel/time/timer.c:1648
expire_timers kernel/time/timer.c:1699 [inline]
__run_timers+0x56c/0x810 kernel/time/timer.c:1970
run_timer_softirq+0x63/0xf0 kernel/time/timer.c:1983
handle_softirqs+0x336/0x830 kernel/softirq.c:576
__do_softirq kernel/softirq.c:610 [inline]
invoke_softirq kernel/softirq.c:450 [inline]
__irq_exit_rcu+0x13b/0x230 kernel/softirq.c:659
irq_exit_rcu+0x5/0x20 kernel/softirq.c:671
instr_sysvec_apic_timer_interrupt arch/x86/kernel/apic/apic.c:1108 [inline]
sysvec_apic_timer_interrupt+0xa0/0xc0 arch/x86/kernel/apic/apic.c:1108
asm_sysvec_apic_timer_interrupt+0x16/0x20 arch/x86/include/asm/idtentry.h:676
__nr_to_section include/linux/mmzone.h:1383 [inline]
__pfn_to_section include/linux/mmzone.h:1468 [inline]
lookup_page_ext+0x97/0x120 mm/page_ext.c:209
__set_page_owner+0x23/0x2d0 mm/page_owner.c:175
prep_new_page mm/page_alloc.c:2426 [inline]
get_page_from_freelist+0x24f6/0x2670 mm/page_alloc.c:4192
__alloc_pages+0x1ee/0x480 mm/page_alloc.c:5501
alloc_pages_vma+0x2bc/0x790 mm/mempolicy.c:2146
wp_page_copy+0x252/0x2090 mm/memory.c:3056
handle_pte_fault mm/memory.c:4668 [inline]
__handle_mm_fault mm/memory.c:4785 [inline]
handle_mm_fault+0x1fbd/0x4440 mm/memory.c:4883
do_user_addr_fault+0x494/0xc90 arch/x86/mm/fault.c:1355
handle_page_fault arch/x86/mm/fault.c:1443 [inline]
exc_page_fault+0x60/0x100 arch/x86/mm/fault.c:1496
asm_exc_page_fault+0x22/0x30 arch/x86/include/asm/idtentry.h:606
INITIAL USE at:
lock_acquire+0x19e/0x400 kernel/locking/lockdep.c:5623
__raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:110 [inline]
_raw_spin_lock_irqsave+0xb0/0x100 kernel/locking/spinlock.c:162
configfs_composite_reset+0x53/0xf0 drivers/usb/gadget/configfs.c:1530
usb_gadget_udc_reset+0x3e/0x120 drivers/usb/gadget/udc/core.c:1123
set_link_state+0x7fb/0x11d0 drivers/usb/gadget/udc/dummy_hcd.c:470
dummy_hub_control+0xaa1/0x1a90 drivers/usb/gadget/udc/dummy_hcd.c:-1
rh_call_control drivers/usb/core/hcd.c:681 [inline]
rh_urb_enqueue drivers/usb/core/hcd.c:846 [inline]
usb_hcd_submit_urb+0xe68/0x1970 drivers/usb/core/hcd.c:1553
usb_start_wait_urb+0x13c/0x580 drivers/usb/core/message.c:61
usb_internal_control_msg drivers/usb/core/message.c:116 [inline]
usb_control_msg+0x231/0x3e0 drivers/usb/core/message.c:166
set_port_feature drivers/usb/core/hub.c:455 [inline]
hub_port_reset+0x3ad/0x1870 drivers/usb/core/hub.c:3045
hub_port_init+0x25e/0x2850 drivers/usb/core/hub.c:4868
hub_port_connect drivers/usb/core/hub.c:5426 [inline]
hub_port_connect_change drivers/usb/core/hub.c:5637 [inline]
port_event drivers/usb/core/hub.c:5799 [inline]
hub_event+0x276d/0x5260 drivers/usb/core/hub.c:5881
process_one_work+0x867/0xff0 kernel/workqueue.c:2310
worker_thread+0xad7/0x12a0 kernel/workqueue.c:2457
kthread+0x42e/0x520 kernel/kthread.c:334
ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:287
}
... key at: [<ffffffff96654760>] gadgets_make.__key+0x0/0x20
... acquired at:
__raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:110 [inline]
_raw_spin_lock_irqsave+0xb0/0x100 kernel/locking/spinlock.c:162
vep_queue+0x61/0x1c0 drivers/usb/usbip/vudc_dev.c:323
usb_ep_queue+0xe6/0x350 drivers/usb/gadget/udc/core.c:288
composite_ep0_queue drivers/usb/gadget/composite.c:1561 [inline]
composite_setup+0x1d7a/0x2b60 drivers/usb/gadget/composite.c:2154
configfs_composite_setup+0xc3/0x100 drivers/usb/gadget/configfs.c:1492
get_gadget_descs+0x179/0x4f0 drivers/usb/usbip/vudc_sysfs.c:41
vgadget_pullup+0x15b/0x2f0 drivers/usb/usbip/vudc_dev.c:169
usb_gadget_connect+0x9c/0x2f0 drivers/usb/gadget/udc/core.c:718
usb_udc_connect_control drivers/usb/gadget/udc/core.c:1086 [inline]
udc_bind_to_driver+0x4b5/0x5f0 drivers/usb/gadget/udc/core.c:1583
usb_gadget_probe_driver+0x1fb/0x380 drivers/usb/gadget/udc/core.c:1637
gadget_dev_desc_UDC_store+0x1ba/0x2e0 drivers/usb/gadget/configfs.c:289
flush_write_buffer fs/configfs/file.c:207 [inline]
configfs_write_iter+0x30b/0x400 fs/configfs/file.c:229
call_write_iter include/linux/fs.h:2173 [inline]
new_sync_write fs/read_write.c:507 [inline]
vfs_write+0x748/0xd70 fs/read_write.c:594
ksys_write+0x153/0x260 fs/read_write.c:647
do_syscall_x64 arch/x86/entry/common.c:50 [inline]
do_syscall_64+0x4c/0xa0 arch/x86/entry/common.c:80
entry_SYSCALL_64_after_hwframe+0x66/0xd0

-> (&udc->lock){+.+.}-{2:2} {
HARDIRQ-ON-W at:
trace_hardirqs_on+0x67/0x80 kernel/trace/trace_preemptirq.c:49
__raw_spin_unlock_irq include/linux/spinlock_api_smp.h:168 [inline]
_raw_spin_unlock_irq+0x1f/0x40 kernel/locking/spinlock.c:202
spin_unlock_irq include/linux/spinlock.h:414 [inline]
usbip_sockfd_store+0x3cb/0x8d0 drivers/usb/usbip/vudc_sysfs.c:222
kernfs_fop_write_iter+0x3a8/0x500 fs/kernfs/file.c:296
call_write_iter include/linux/fs.h:2173 [inline]
new_sync_write fs/read_write.c:507 [inline]
vfs_write+0x748/0xd70 fs/read_write.c:594
ksys_write+0x153/0x260 fs/read_write.c:647
do_syscall_x64 arch/x86/entry/common.c:50 [inline]
do_syscall_64+0x4c/0xa0 arch/x86/entry/common.c:80
entry_SYSCALL_64_after_hwframe+0x66/0xd0
SOFTIRQ-ON-W at:
trace_hardirqs_on+0x67/0x80 kernel/trace/trace_preemptirq.c:49
__raw_spin_unlock_irq include/linux/spinlock_api_smp.h:168 [inline]
_raw_spin_unlock_irq+0x1f/0x40 kernel/locking/spinlock.c:202
spin_unlock_irq include/linux/spinlock.h:414 [inline]
usbip_sockfd_store+0x3cb/0x8d0 drivers/usb/usbip/vudc_sysfs.c:222
kernfs_fop_write_iter+0x3a8/0x500 fs/kernfs/file.c:296
call_write_iter include/linux/fs.h:2173 [inline]
new_sync_write fs/read_write.c:507 [inline]
vfs_write+0x748/0xd70 fs/read_write.c:594
ksys_write+0x153/0x260 fs/read_write.c:647
do_syscall_x64 arch/x86/entry/common.c:50 [inline]
do_syscall_64+0x4c/0xa0 arch/x86/entry/common.c:80
entry_SYSCALL_64_after_hwframe+0x66/0xd0
INITIAL USE at:
lock_acquire+0x19e/0x400 kernel/locking/lockdep.c:5623
__raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:110 [inline]
_raw_spin_lock_irqsave+0xb0/0x100 kernel/locking/spinlock.c:162
vgadget_udc_start+0x2d/0xa0 drivers/usb/usbip/vudc_dev.c:199
usb_gadget_udc_start drivers/usb/gadget/udc/core.c:1150 [inline]
udc_bind_to_driver+0x2b5/0x5f0 drivers/usb/gadget/udc/core.c:1577
usb_gadget_probe_driver+0x1fb/0x380 drivers/usb/gadget/udc/core.c:1637
gadget_dev_desc_UDC_store+0x1ba/0x2e0 drivers/usb/gadget/configfs.c:289
flush_write_buffer fs/configfs/file.c:207 [inline]
configfs_write_iter+0x30b/0x400 fs/configfs/file.c:229
call_write_iter include/linux/fs.h:2173 [inline]
new_sync_write fs/read_write.c:507 [inline]
vfs_write+0x748/0xd70 fs/read_write.c:594
ksys_write+0x153/0x260 fs/read_write.c:647
do_syscall_x64 arch/x86/entry/common.c:50 [inline]
do_syscall_64+0x4c/0xa0 arch/x86/entry/common.c:80
entry_SYSCALL_64_after_hwframe+0x66/0xd0
}
... key at: [<ffffffff96657220>] init_vudc_hw.__key+0x0/0x20
... acquired at:
mark_lock+0x208/0x320 kernel/locking/lockdep.c:4591
mark_held_locks kernel/locking/lockdep.c:4193 [inline]
__trace_hardirqs_on_caller kernel/locking/lockdep.c:4219 [inline]
lockdep_hardirqs_on_prepare+0x380/0x7c0 kernel/locking/lockdep.c:4278
trace_hardirqs_on+0x67/0x80 kernel/trace/trace_preemptirq.c:49
__raw_spin_unlock_irq include/linux/spinlock_api_smp.h:168 [inline]
_raw_spin_unlock_irq+0x1f/0x40 kernel/locking/spinlock.c:202
spin_unlock_irq include/linux/spinlock.h:414 [inline]
usbip_sockfd_store+0x3cb/0x8d0 drivers/usb/usbip/vudc_sysfs.c:222
kernfs_fop_write_iter+0x3a8/0x500 fs/kernfs/file.c:296
call_write_iter include/linux/fs.h:2173 [inline]
new_sync_write fs/read_write.c:507 [inline]
vfs_write+0x748/0xd70 fs/read_write.c:594
ksys_write+0x153/0x260 fs/read_write.c:647
do_syscall_x64 arch/x86/entry/common.c:50 [inline]
do_syscall_64+0x4c/0xa0 arch/x86/entry/common.c:80
entry_SYSCALL_64_after_hwframe+0x66/0xd0


stack backtrace:
CPU: 0 PID: 6040 Comm: syz.4.368 Not tainted syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 07/24/2026
Call Trace:
<TASK>
dump_stack_lvl+0x188/0x250 lib/dump_stack.c:106
check_usage_backwards kernel/locking/lockdep.c:-1 [inline]
mark_lock_irq+0x675/0x900 kernel/locking/lockdep.c:4155
mark_lock+0x208/0x320 kernel/locking/lockdep.c:4591
mark_held_locks kernel/locking/lockdep.c:4193 [inline]
__trace_hardirqs_on_caller kernel/locking/lockdep.c:4219 [inline]
lockdep_hardirqs_on_prepare+0x380/0x7c0 kernel/locking/lockdep.c:4278
trace_hardirqs_on+0x67/0x80 kernel/trace/trace_preemptirq.c:49
__raw_spin_unlock_irq include/linux/spinlock_api_smp.h:168 [inline]
_raw_spin_unlock_irq+0x1f/0x40 kernel/locking/spinlock.c:202
spin_unlock_irq include/linux/spinlock.h:414 [inline]
usbip_sockfd_store+0x3cb/0x8d0 drivers/usb/usbip/vudc_sysfs.c:222
kernfs_fop_write_iter+0x3a8/0x500 fs/kernfs/file.c:296
call_write_iter include/linux/fs.h:2173 [inline]
new_sync_write fs/read_write.c:507 [inline]
vfs_write+0x748/0xd70 fs/read_write.c:594
ksys_write+0x153/0x260 fs/read_write.c:647
do_syscall_x64 arch/x86/entry/common.c:50 [inline]
do_syscall_64+0x4c/0xa0 arch/x86/entry/common.c:80
entry_SYSCALL_64_after_hwframe+0x66/0xd0
RIP: 0033:0x7fe43ec3d0d9
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:00007fe43ce95028 EFLAGS: 00000246 ORIG_RAX: 0000000000000001
RAX: ffffffffffffffda RBX: 00007fe43eec4fa0 RCX: 00007fe43ec3d0d9
RDX: 0000000000000002 RSI: 0000200000000640 RDI: 0000000000000003
RBP: 00007fe43ecd4024 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
R13: 00007fe43eec5038 R14: 00007fe43eec4fa0 R15: 00007ffd0e4b4fc8
</TASK>
------------[ cut here ]------------
raw_local_irq_restore() called with IRQs enabled
WARNING: CPU: 0 PID: 6040 at kernel/locking/irqflag-debug.c:10 warn_bogus_irq_restore+0x1d/0x20 kernel/locking/irqflag-debug.c:10
Modules linked in:
CPU: 0 PID: 6040 Comm: syz.4.368 Not tainted syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 07/24/2026
RIP: 0010:warn_bogus_irq_restore+0x1d/0x20 kernel/locking/irqflag-debug.c:10
Code: 24 48 c7 c7 80 e9 29 8a e8 c0 09 f5 ff 80 3d 09 3f b7 03 00 74 01 c3 c6 05 ff 3e b7 03 01 48 c7 c7 60 23 2b 8a e8 23 15 f5 ff <0f> 0b c3 41 56 53 48 83 ec 10 65 48 8b 04 25 28 00 00 00 48 89 44
RSP: 0018:ffffc90003e5fad8 EFLAGS: 00010246
RAX: 123f6d7be06ffa00 RBX: 0000000000000a06 RCX: 0000000000080000
RDX: ffffc9000e5da000 RSI: 000000000007ffff RDI: 0000000000080000
RBP: ffffc90003e5fb70 R08: ffffc90003e5f607 R09: 1ffff920007cbec0
R10: dffffc0000000000 R11: fffff520007cbec1 R12: dffffc0000000000
R13: dffffc0000000000 R14: ffff8881485948f0 R15: 1ffff920007cbf5c
FS: 00007fe43ce956c0(0000) GS:ffff8880b9000000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00007fc325c1edac CR3: 0000000023dbe000 CR4: 00000000003506f0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
<TASK>
__raw_spin_unlock_irqrestore include/linux/spinlock_api_smp.h:160 [inline]
_raw_spin_unlock_irqrestore+0xfe/0x120 kernel/locking/spinlock.c:194
spin_unlock_irqrestore include/linux/spinlock.h:419 [inline]
usbip_sockfd_store+0x716/0x8d0 drivers/usb/usbip/vudc_sysfs.c:224
kernfs_fop_write_iter+0x3a8/0x500 fs/kernfs/file.c:296
call_write_iter include/linux/fs.h:2173 [inline]
new_sync_write fs/read_write.c:507 [inline]
vfs_write+0x748/0xd70 fs/read_write.c:594
ksys_write+0x153/0x260 fs/read_write.c:647
do_syscall_x64 arch/x86/entry/common.c:50 [inline]
do_syscall_64+0x4c/0xa0 arch/x86/entry/common.c:80
entry_SYSCALL_64_after_hwframe+0x66/0xd0
RIP: 0033:0x7fe43ec3d0d9
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:00007fe43ce95028 EFLAGS: 00000246 ORIG_RAX: 0000000000000001
RAX: ffffffffffffffda RBX: 00007fe43eec4fa0 RCX: 00007fe43ec3d0d9
RDX: 0000000000000002 RSI: 0000200000000640 RDI: 0000000000000003
RBP: 00007fe43ecd4024 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
R13: 00007fe43eec5038 R14: 00007fe43eec4fa0 R15: 00007ffd0e4b4fc8
</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 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 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