CVE-2026-99157

scsi: bsg: Pass reply_len to bsg_setup_queue() to fit UFS ARPMB replies

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

scsi: bsg: Pass reply_len to bsg_setup_queue() to fit UFS ARPMB replies

bsg-lib allocates a 96-byte (SCSI_SENSE_BUFFERSIZE) reply buffer per
job, but struct ufs_rpmb_reply is 104 bytes: a 40-byte struct
ufs_bsg_reply followed by a 64-byte EHS. When an Advanced RPMB command
returns an EHS, ufshcd_advanced_rpmb_req_handler() copies it right after
the 40-byte header and writes 8 bytes past the end of the buffer.

Let each BSG transport pass its reply buffer size to bsg_setup_queue()
and have ufs_bsg request sizeof(struct ufs_rpmb_reply), so the full
reply reaches user space. Other transports keep SCSI_SENSE_BUFFERSIZE.

Analysis

AI-generated

Technical impact

The Linux kernel’s SCSI BSG transport allocates a 96‑byte reply buffer for each job but Advanced RPMB replies require 104 bytes. When a UFS device returns an Extended Host State (EHS) segment, the kernel copies data past the allocated buffer, writing eight bytes beyond the allocated memory. This out‑of‑bounds write corrupts kernel stack memory and can be triggered by a crafted RPMB command, potentially allowing a local attacker to overflow the buffer and execute arbitrary code in kernel mode. The weakness is an example of a memory corruption flaw (CWE‑787).

Affected Systems

All Linux kernel releases that incorporate the bsg library before the patch commits 2effbe746452c108188f85a6951f2b0b65653840, 7a755f6d47b811d3abd93c1642ce5e63894540b8, and ec6b083915e8146e147314a5f4f1285d07b57bfc. The vulnerability impacts any system that uses the SCSI BSG transport for UFS devices without the patch, regardless of user privileges.

Risk and Exploitability

The CVSS score is 4.4, indicating moderate severity. The EPSS score is below 1%, implying that the likelihood of a public exploit is low. The vulnerability is not listed in CISA’s KEV catalog, and the attack requires local access to a UFS device and the ability to issue a malformed RPMB command. Because the overflow occurs in kernel mode, an exploitation attempt could lead to privilege escalation to root if successfully triggered.

Remediation

No solution or workaround provided in the CVE record.

OpenCVE Recommended Actions

  • Deploy the kernel patches that expand the bsg reply buffer to match the full size of struct ufs_rpmb_reply – these changes are available in the Git commits referenced above.
  • Reboot or reload the kernel after applying the patches to ensure the updated buffer size takes effect.
  • If an immediate kernel upgrade is infeasible, restrict access to the UFS RPMB interface by removing write or read permissions from the device node for untrusted users until the patch can be applied.

Generated by OpenCVE AI on November 2, 2026 at 01:54 UTC.

Tracking

Sign in to view the affected projects.

Advisories

Source ID Title
Debian DLA Debian DLA DLA-4904-1 linux-6.12 security update
History
Type Values Removed Values Added
Weaknesses CWE-787
References
Metrics threat_severity

None

cvssV3_1

{'score': 4.4, 'vector': 'CVSS:3.1/AV:L/AC:L/PR:H/UI:N/S:U/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
Description In the Linux kernel, the following vulnerability has been resolved: scsi: bsg: Pass reply_len to bsg_setup_queue() to fit UFS ARPMB replies bsg-lib allocates a 96-byte (SCSI_SENSE_BUFFERSIZE) reply buffer per job, but struct ufs_rpmb_reply is 104 bytes: a 40-byte struct ufs_bsg_reply followed by a 64-byte EHS. When an Advanced RPMB command returns an EHS, ufshcd_advanced_rpmb_req_handler() copies it right after the 40-byte header and writes 8 bytes past the end of the buffer. Let each BSG transport pass its reply buffer size to bsg_setup_queue() and have ufs_bsg request sizeof(struct ufs_rpmb_reply), so the full reply reaches user space. Other transports keep SCSI_SENSE_BUFFERSIZE.
Title scsi: bsg: Pass reply_len to bsg_setup_queue() to fit UFS ARPMB replies
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 30, 2026, 12:42 PM
Reserved
Sep 25, 2026, 10:25 AM
Status
Received
Published
Oct 28, 2026, 11:17 AM
Modified
Oct 30, 2026, 1:21 PM
Severity
Moderate
Public date
Oct 28, 2026, 10:35 AM