MEDIUM 5.5

CVE-2026-53304: Linux Kernel sg Driver Soft Lockup via Invalid Module Parameter

A vulnerability in the Linux kernel's SCSI generic (sg) driver allows a local attacker with sufficient privileges to trigger a system hang by setting an invalid module parameter. The issue occurs when the def_reserved_size parameter is set to an out-of-range value (like -1) and then a SCSI device file is opened, causing the kernel to enter an infinite loop that freezes the CPU. This is a denial-of-service vulnerability requiring local access to exploit.

Source data · NVD / CISA · public domain

CVSS
3.1 · 5.5 MEDIUM · CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H
Weaknesses (CWE)
CWE-667
Affected products
1 configuration(s)
Published / Modified
2026-06-26 / 2026-07-06

NVD description (verbatim)

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.

8 reference(s) · View on NVD →

SEC.co analysis · AI-assisted, reviewed against source

Technical summary

CVE-2026-53304 is a soft lockup vulnerability in the Linux kernel's sg (SCSI Generic) driver. The def_reserved_size module parameter is intended to define the default buffer size per Sg_fd file descriptor, with valid values between 0 and 1,048,576 bytes. While the sg_proc_write_dressz sysctl handler enforces this range, the parameter can be directly modified via /sys/module/sg/parameters/def_reserved_size, bypassing validation. When an out-of-range value (negative or excessively large) is set and a device file under /dev/sgX is subsequently opened, the sg_build_reserve function enters an infinite or near-infinite loop during memory allocation, causing a watchdog-detected CPU lockup. The fix involves implementing proper validation callbacks using module_param_cb to reject invalid values at assignment time rather than relying solely on sysctl enforcement.

Business impact

This vulnerability can disrupt operations on systems that expose SCSI generic device access to unprivileged or semi-trusted local users. On affected systems, an attacker could render a node unresponsive by triggering a soft lockup, causing service interruptions and potential cascading failures in clustered or virtualized environments. Data processing on SCSI devices would be interrupted. Recovery typically requires system restart, resulting in downtime and administrative overhead. The impact is primarily availability-focused and localized to systems where SCSI generic device files are actively used.

Affected systems

The vulnerability affects Linux kernel versions prior to the patch that implements module_param_cb validation for the sg driver's def_reserved_size parameter. Any Linux system with an sg (SCSI Generic) driver compiled as a module or built-in is potentially vulnerable if the kernel version predates the fix. Systems that do not expose /dev/sgX device files to local users or run heavily restricted environments have reduced exposure. Both physical servers and virtual machines running vulnerable Linux kernels are in scope.

Exploitability

Exploitation requires local access to the system and sufficient privileges (typically root or membership in a group with device access). The attack is straightforward: write an invalid value to /sys/module/sg/parameters/def_reserved_size, then attempt to open a SCSI device file. No special tools or advanced techniques are needed. However, the attacker must already have login capability and appropriate user privileges, making this a local privilege escalation or local denial-of-service vector rather than a remote attack. The CVSS score of 5.5 (Medium) reflects the local requirement and absence of confidentiality or integrity impact.

Remediation

Apply a kernel update that includes the fix implementing module_param_cb validation for def_reserved_size. The patch adds input validation at parameter assignment time, preventing out-of-range values from being set via the sysfs interface. Systems should update to a patched kernel version as released by their Linux distribution. Verify against your vendor's advisory for specific patched versions applicable to your kernel branch. Until patched, restrict write access to /sys/module/sg/parameters/def_reserved_size via filesystem permissions and limit who can open /dev/sgX files.

Patch guidance

Obtain and deploy kernel updates from your Linux distribution's vendor. Check your distribution's security advisories for CVE-2026-53304 to identify the specific patched kernel versions. Typical remediation involves updating the kernel package via your package manager (apt, yum, zypper, etc.) and rebooting to activate the fix. For production environments, schedule patching during a maintenance window and test in a staging environment first. Long-term kernel support (LTS) branches should receive patches; verify availability before deploying to production systems.

Detection guidance

Monitor for soft lockup warnings in kernel logs (dmesg, journalctl) mentioning sg_build_reserve or sg-related functions, particularly around device open operations on /dev/sgX. Audit access to /sys/module/sg/parameters/def_reserved_size for unauthorized modification attempts. Check for privilege escalation or container escape scenarios where a local user attempts to set module parameters. Log and alert on repeated failures to open SCSI device files preceded by parameter changes. Use tools like auditd to track modifications to sysfs sg driver parameters.

Why prioritize this

While the CVSS score is Medium (5.5), the vulnerability should be prioritized for systems that (1) actively use SCSI generic device access, (2) run untrusted or semi-trusted local user workloads, or (3) operate in multi-tenant virtualization environments. The ease of exploitation and the severity of impact (complete CPU lockup requiring reboot) warrant timely patching. Organizations with strict local access controls or those not using sg driver features can deprioritize, but general-purpose systems should treat this as a standard-priority patch.

Risk score, explained

The CVSS 3.1 score of 5.5 reflects a Medium severity vulnerability with local attack vector (AV:L), low attack complexity (AC:L), low privileges required (PR:L), no user interaction (UI:N), unchanged scope (S:U), no confidentiality or integrity impact (C:N/I:N), but high availability impact (A:H). The score appropriately captures that a local user can completely deny service to the system by freezing a CPU, but requires pre-existing local access. The absence of remote exploitability and data compromise limits the score below High, yet the practical impact of a system lockup is severe.

Frequently asked questions

Can this vulnerability be exploited remotely?

No. The vulnerability requires local access to the system and the ability to modify module parameters via /sys or to open SCSI device files. Remote attackers cannot trigger this issue without first gaining local shell access.

What versions of the Linux kernel are affected?

The vulnerability affects Linux kernel versions prior to the patch implementing module_param_cb validation for the sg driver. The exact affected range depends on the kernel branch; verify against your Linux distribution's security advisory for specific version numbers.

If we do not use SCSI generic devices, are we safe?

Systems that do not use SCSI generic device files (/dev/sgX) or do not load the sg driver module have no exposure to this vulnerability. However, many distributions load the sg driver by default; verify your kernel configuration and loaded modules.

What is the recommended remediation timeline?

Apply available kernel patches as soon as they become available from your distribution vendor. For non-critical systems, standard patching schedules (monthly or quarterly) are acceptable. For production SCSI-heavy environments or multi-tenant systems, prioritize patching within 1–2 weeks.

This analysis is based on the CVE record and public vulnerability data as of the publication date. Specific patch versions, affected kernel branches, and remediation steps vary by Linux distribution; consult your vendor's security advisory for definitive guidance. SEC.co makes no warranty regarding the completeness or accuracy of this analysis. Testing patches in a non-production environment before deployment is strongly recommended. For authoritative information, refer to the Linux kernel mailing list, your distribution's security bulletin, and the TLDP SCSI Generic HOWTO documentation. Source: NVD (public-domain), retrieved 2026-08-05. Analysis generated by SEC.co (claude-haiku-4-5).