CVE-2026-99207

scsi: target: Disable interrupts while holding delayed_cmd_lock

Published Oct 28, 2026 CVSS 3.1 · 5.6 Medium EPSS < 1% KEV · Not listed
Description
In the Linux kernel, the following vulnerability has been resolved:

scsi: target: Disable interrupts while holding delayed_cmd_lock

target_do_delayed_work() takes dev->delayed_cmd_lock with a plain
spin_lock(). It runs from system_percpu_wq, so interrupts stay enabled
while the lock is held. Every other acquisition of that lock uses
spin_lock_irqsave(): target_handle_task_attr() and
transport_complete_ordered_sync() in target_core_transport.c, and
target_non_ordered_release() in target_core_device.c.

That was safe while every caller of transport_complete_task_attr() ran
in process context: target_complete_ok_work() from target_completion_wq,
transport_complete_qf() from dev->qf_work_queue, and
transport_generic_request_failure() from the submit and execute paths.

Since commit 06933066d88a ("scsi: target: Add support for completing
commands from backend context") that is no longer true. With
complete_type=1 on a fabric that sets direct_compl_supp,
target_complete() runs target_complete_ok_work() inline in the backend's
completion context, which target_complete_cmd_with_sense() documents as
"May be called from interrupt context". For iblock that is the bio
end_io.

target_complete_ok_work() starts with transport_complete_task_attr(),
which takes delayed_cmd_lock in two ways:

- Every ORDERED command is put on dev->delayed_cmd_list by
target_handle_task_attr() and dispatched from there by
target_do_delayed_work(), which marks it SCF_TASK_ORDERED_SYNC. Its
completion therefore goes through transport_complete_ordered_sync().

- A SIMPLE command that completes while an ORDERED command is pending
drops the last reference to the killed dev->non_ordered, and
percpu_ref_put() then runs target_non_ordered_release() in the
completing context.

Both take the lock and, if commands are waiting, call
schedule_work(&dev->delayed_cmd_work), which queues on system_percpu_wq,
i.e. on the CPU that took the completion. Further completions for the
same queue are typically delivered there too, so one arriving while the
work holds the lock spins on it forever.

Reaching this needs complete_type=1, which is not the default
(vhost-scsi, the only fabric with direct_compl_supp, defaults to
TARGET_QUEUE_COMPL), a backend whose I/O completes from interrupt
context, and ORDERED commands from the initiator. Linux virtio_scsi
guests send only VIRTIO_SCSI_S_SIMPLE and never take the ordered path;
any guest that uses the ORDERED task attribute, which vhost-scsi
accepts, does.

target_do_delayed_work() is a work item and always runs in process
context, so spin_lock_irq() is sufficient.

Found by inspection; no runtime report. A single ORDERED command goes
through both acquisitions, so with CONFIG_PROVE_LOCKING the first one
completed through direct completion should produce an inconsistent lock
state report on delayed_cmd_lock (hardirq or softirq, depending on where
the backend completes).

Analysis

AI-generated

Technical impact

The flaw lies in the Linux kernel’s SCSI target subsystem: target_do_delayed_work() acquires the delayed_cmd_lock with a plain spin_lock while leaving interrupts enabled. When a command completes from an interrupt or backend context under a fabric that supports direct completion (complete_type=1) and the initiator sends an ORDERED task attribute, the same lock is later required by a work item queued on system_percpu_wq. Because the lock remains held with interrupts on, the work item spins indefinitely, causing a self‑deadlock that halts the kernel and results in a denial of service. The CVE specifies that the vulnerability can lead to a kernel hang, effectively taking down the affected system.

Affected Systems

This issue affects Linux kernel builds that include the SCSI target subsystem with vhost‑scsi or similar fabrics configured for direct completion. Systems running the default kernel with direct completion disabled or which never use the ORDERED task attribute are not affected; the problem manifests only when a fabric accepts ORDERED commands and processes completions from interrupt context. Virtual SCSI guests using virtio_scsi and vhost‑scsi that enable direct completion are especially vulnerable.

Risk and Exploitability

The CVSS score of 5.6 represents a medium severity because the flaw requires a specialized configuration. The EPSS score of 0.00145 (less than 1%) indicates a very low probability of exploitation in the wild, and the vulnerability is not listed in the CISA KEV catalog, suggesting no known active exploitation. However, if an attacker can issue ORDERED SCSI commands against a target that uses direct completion, they can trigger the lock‑deadlock and cause a kernel crash. Based on the description, it is inferred that the attacker must have the ability to send SCSI commands to the target from a client that can understand and transmit the ORDERED attribute; therefore the threat is limited to trusted or compromised initiators in environments exposing the vulnerable fabric.

Remediation

No solution or workaround provided in the CVE record.

OpenCVE Recommended Actions

  • Upgrade the Linux kernel to a released version that contains the patch fixing the delayed_cmd_lock acquisition in target_do_delayed_work.
  • Configure the fabric to disable direct completion (direct_compl_supp) or revert to the default TARGET_QUEUE_COMPL completion type, so that commands are processed in process context.
  • Restrict or disable the use of the ORDERED task attribute on SCSI targets to prevent the trigger of the deadlock condition.

Generated by OpenCVE AI on October 29, 2026 at 18:45 UTC.

Tracking

Sign in to view the affected projects.

Advisories

No advisories available
History
Type Values Removed Values Added
Weaknesses CWE-663
Type Values Removed Values Added
Weaknesses CWE-833
References
Metrics threat_severity

None

cvssV3_1

{'score': 5.6, 'vector': 'CVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:C/C:N/I:N/A:H'}

threat_severity

Moderate

Type Values Removed Values Added
First Time appeared Linux linux
Vendors & Products Linux linux
Type Values Removed Values Added
Weaknesses CWE-663
Type Values Removed Values Added
Description In the Linux kernel, the following vulnerability has been resolved: scsi: target: Disable interrupts while holding delayed_cmd_lock target_do_delayed_work() takes dev->delayed_cmd_lock with a plain spin_lock(). It runs from system_percpu_wq, so interrupts stay enabled while the lock is held. Every other acquisition of that lock uses spin_lock_irqsave(): target_handle_task_attr() and transport_complete_ordered_sync() in target_core_transport.c, and target_non_ordered_release() in target_core_device.c. That was safe while every caller of transport_complete_task_attr() ran in process context: target_complete_ok_work() from target_completion_wq, transport_complete_qf() from dev->qf_work_queue, and transport_generic_request_failure() from the submit and execute paths. Since commit 06933066d88a ("scsi: target: Add support for completing commands from backend context") that is no longer true. With complete_type=1 on a fabric that sets direct_compl_supp, target_complete() runs target_complete_ok_work() inline in the backend's completion context, which target_complete_cmd_with_sense() documents as "May be called from interrupt context". For iblock that is the bio end_io. target_complete_ok_work() starts with transport_complete_task_attr(), which takes delayed_cmd_lock in two ways: - Every ORDERED command is put on dev->delayed_cmd_list by target_handle_task_attr() and dispatched from there by target_do_delayed_work(), which marks it SCF_TASK_ORDERED_SYNC. Its completion therefore goes through transport_complete_ordered_sync(). - A SIMPLE command that completes while an ORDERED command is pending drops the last reference to the killed dev->non_ordered, and percpu_ref_put() then runs target_non_ordered_release() in the completing context. Both take the lock and, if commands are waiting, call schedule_work(&dev->delayed_cmd_work), which queues on system_percpu_wq, i.e. on the CPU that took the completion. Further completions for the same queue are typically delivered there too, so one arriving while the work holds the lock spins on it forever. Reaching this needs complete_type=1, which is not the default (vhost-scsi, the only fabric with direct_compl_supp, defaults to TARGET_QUEUE_COMPL), a backend whose I/O completes from interrupt context, and ORDERED commands from the initiator. Linux virtio_scsi guests send only VIRTIO_SCSI_S_SIMPLE and never take the ordered path; any guest that uses the ORDERED task attribute, which vhost-scsi accepts, does. target_do_delayed_work() is a work item and always runs in process context, so spin_lock_irq() is sufficient. Found by inspection; no runtime report. A single ORDERED command goes through both acquisitions, so with CONFIG_PROVE_LOCKING the first one completed through direct completion should produce an inconsistent lock state report on delayed_cmd_lock (hardirq or softirq, depending on where the backend completes).
Title scsi: target: Disable interrupts while holding delayed_cmd_lock
First Time appeared Linux
Linux linux Kernel
CPEs cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*
Vendors & Products Linux
Linux linux Kernel
References
Weaknesses

Sources

Status
PUBLISHED
Assigner
Linux
Published
Updated
Oct 28, 2026, 10:36 AM
Reserved
Sep 25, 2026, 10:25 AM
Status
Received
Published
Oct 28, 2026, 11:17 AM
Modified
Oct 28, 2026, 11:17 AM
Severity
Moderate
Public date
Oct 28, 2026, 12:00 AM