Description
In the Linux kernel, the following vulnerability has been resolved:

scsi: sg: Resolve soft lockup issue when opening /dev/sgX

The parameter def_reserved_size defines the default buffer size reserved
for each Sg_fd and should be restricted to a range between 0 and 1,048,576
(see https://tldp.org/HOWTO/SCSI-Generic-HOWTO/proc.html). Although the
function sg_proc_write_dressz enforces this limit, it is possible to bypass
it by directly modifying the module parameter as shown below, which then
causes a soft lockup:

echo -1 > /sys/module/sg/parameters/def_reserved_size
exec 4<> /dev/sg0

watchdog: BUG: soft lockup - CPU#5 stuck for 26 seconds! [bash:537]
Modules loaded:
CPU: 5 UID: 0 PID: 537 Command: bash, kernel version 6.19.0-rc3+ #134,
PREEMPT disabled
Hardware: QEMU Standard PC (i440FX + PIIX, 1996), BIOS version
1.16.1-2.fc37 dated 04/01/2014
...
Call Trace:

sg_build_reserve+0x5c/0xa0
sg_add_sfp+0x168/0x270
sg_open+0x16e/0x340
chrdev_open+0xbe/0x230
do_dentry_open+0x175/0x480
vfs_open+0x34/0xf0
do_open+0x265/0x3d0
path_openat+0x110/0x290
do_filp_open+0xc3/0x170
do_sys_openat2+0x71/0xe0
__x64_sys_openat+0x6d/0xa0
do_syscall_64+0x62/0x310
entry_SYSCALL_64_after_hwframe+0x76/0x7e

The fix is to use module_param_cb to validate and reject invalid values
assigned to def_reserved_size.
Published: 2026-06-26
Score: n/a
EPSS: n/a
KEV: No
Impact: n/a
Action: n/a
AI Analysis

Impact

The vulnerability resides in the SCSI generic (sg) kernel module, allowing a user to set the module parameter def_reserved_size to an out‑of‑range value, such as –1. The lack of input validation permits this breach, which then leads the kernel to allocate an invalid buffer size when opening an /dev/sgX device. This misbehaviour manifests as a soft lockup, where a CPU core is observed stuck for extended periods, effectively crippling the system until a reboot or kernel recovery. The issue does not expose code execution or information disclosure; its primary impact is a denial‑of‑service that can affect the kernel’s responsiveness and availability.

Affected Systems

All Linux kernel releases that include the sg module with the vulnerable def_reserved_size handling are affected, as the flaw is tied to the kernel’s sg driver. The vendor list indicates Linux:Linux, meaning the flaw is present in the upstream kernel distribution. Specific affected kernel release numbers are not enumerated in the current data, so systems running any kernel version that compiles or loads the sg module should be considered potentially vulnerable.

Risk and Exploitability

The vulnerability requires local access to modify the sysfs parameter /sys/module/sg/parameters/def_reserved_size, which typically demands root or elevated privileges. Once set to an invalid value and followed by opening an sg device, a non‑preemptive kernel may experience a soft lockup, effectively causing a DoS. EPSS is not available and the flaw is not listed in the CISA KEV catalog, yet its impact is significant due to the kernel lockup. The CVSS score is undefined in the provided data; however, because the flaw can bring the entire system to a halt, it should be treated as a high‑severity local DoS.

Generated by OpenCVE AI on June 26, 2026 at 22:13 UTC.

Remediation

No vendor fix or workaround currently provided.

OpenCVE Recommended Actions

  • Replace the kernel with a patched release that validates def_reserved_size using module_param_cb and rejects out‑of‑range values.
  • If a patched kernel is not yet available, set def_reserved_size to a safe value within 0–1,048,576, e.g. 1048576, before using any sg devices and restrict write access to that sysfs entry to privileged users only.
  • Adjust udev or systemd‑udev rules to set or restrict the def_reserved_size parameter and mark it immutable so it cannot be modified by non‑privileged processes.
  • Apply general kernel hardening guidance: keep the system updated, limit local root access, and consider using container or chroot isolation to prevent kernel module abuse.

Generated by OpenCVE AI on June 26, 2026 at 22:13 UTC.

Tracking

Sign in to view the affected projects.

Advisories

No advisories yet.

History

Fri, 26 Jun 2026 22:00:00 +0000

Type Values Removed Values Added
Weaknesses CWE-682

Fri, 26 Jun 2026 20:15:00 +0000

Type Values Removed Values Added
Description In the Linux kernel, the following vulnerability has been resolved: scsi: sg: Resolve soft lockup issue when opening /dev/sgX The parameter def_reserved_size defines the default buffer size reserved for each Sg_fd and should be restricted to a range between 0 and 1,048,576 (see https://tldp.org/HOWTO/SCSI-Generic-HOWTO/proc.html). Although the function sg_proc_write_dressz enforces this limit, it is possible to bypass it by directly modifying the module parameter as shown below, which then causes a soft lockup: echo -1 > /sys/module/sg/parameters/def_reserved_size exec 4<> /dev/sg0 watchdog: BUG: soft lockup - CPU#5 stuck for 26 seconds! [bash:537] Modules loaded: CPU: 5 UID: 0 PID: 537 Command: bash, kernel version 6.19.0-rc3+ #134, PREEMPT disabled Hardware: QEMU Standard PC (i440FX + PIIX, 1996), BIOS version 1.16.1-2.fc37 dated 04/01/2014 ... Call Trace: sg_build_reserve+0x5c/0xa0 sg_add_sfp+0x168/0x270 sg_open+0x16e/0x340 chrdev_open+0xbe/0x230 do_dentry_open+0x175/0x480 vfs_open+0x34/0xf0 do_open+0x265/0x3d0 path_openat+0x110/0x290 do_filp_open+0xc3/0x170 do_sys_openat2+0x71/0xe0 __x64_sys_openat+0x6d/0xa0 do_syscall_64+0x62/0x310 entry_SYSCALL_64_after_hwframe+0x76/0x7e The fix is to use module_param_cb to validate and reject invalid values assigned to def_reserved_size.
Title scsi: sg: Resolve soft lockup issue when opening /dev/sgX
First Time appeared Linux
Linux linux Kernel
CPEs cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*
Vendors & Products Linux
Linux linux Kernel
References

Subscriptions

Linux Linux Kernel
cve-icon MITRE

Status: PUBLISHED

Assigner: Linux

Published:

Updated: 2026-06-26T19:41:00.056Z

Reserved: 2026-06-09T07:44:35.397Z

Link: CVE-2026-53304

cve-icon Vulnrichment

No data.

cve-icon NVD

No data.

cve-icon Redhat

No data.

cve-icon OpenCVE Enrichment

Updated: 2026-06-26T22:15:06Z

Weaknesses