Skip to main content

CVE-2022-21546: Vulnerability in Linux Linux

High
VulnerabilityCVE-2022-21546cvecve-2022-21546
Published: Fri May 02 2025 (05/02/2025, 21:52:09 UTC)
Source: CVE
Vendor/Project: Linux
Product: Linux

Description

In the Linux kernel, the following vulnerability has been resolved: scsi: target: Fix WRITE_SAME No Data Buffer crash In newer version of the SBC specs, we have a NDOB bit that indicates there is no data buffer that gets written out. If this bit is set using commands like "sg_write_same --ndob" we will crash in target_core_iblock/file's execute_write_same handlers when we go to access the se_cmd->t_data_sg because its NULL. This patch adds a check for the NDOB bit in the common WRITE SAME code because we don't support it. And, it adds a check for zero SG elements in each handler in case the initiator tries to send a normal WRITE SAME with no data buffer.

AI-Powered Analysis

AILast updated: 07/05/2025, 03:10:00 UTC

Technical Analysis

CVE-2022-21546 is a vulnerability identified in the Linux kernel's SCSI target subsystem, specifically related to the handling of the WRITE_SAME command when used with the No Data Buffer (NDOB) bit set. The WRITE_SAME command is used in SCSI to write the same data to multiple logical blocks efficiently. In newer versions of the SCSI Block Commands (SBC) specification, the NDOB bit indicates that no data buffer is provided with the WRITE_SAME command. However, the Linux kernel's target_core_iblock and target_core_file modules did not properly handle this scenario. When the NDOB bit is set, the kernel attempts to access the se_cmd->t_data_sg scatter-gather list, which is NULL, leading to a NULL pointer dereference and a crash. This vulnerability arises from a lack of validation for the NDOB bit and zero scatter-gather elements in the WRITE_SAME command handlers. The patch for this issue adds checks to detect the NDOB bit and zero SG elements, preventing the kernel from dereferencing a NULL pointer and thus avoiding the crash. The underlying weakness corresponds to CWE-476 (NULL Pointer Dereference). This vulnerability can cause a denial of service (DoS) by crashing the kernel when a specially crafted WRITE_SAME command with NDOB is issued to a vulnerable Linux system acting as a SCSI target. No known exploits are currently reported in the wild. The affected versions are identified by specific kernel commit hashes, indicating that the issue affects certain Linux kernel versions prior to the patch. No CVSS score has been assigned to this vulnerability yet.

Potential Impact

For European organizations, this vulnerability primarily poses a risk of denial of service on systems running vulnerable Linux kernels configured as SCSI targets. Such systems are often found in storage servers, SAN (Storage Area Network) devices, and virtualized environments where Linux acts as a storage target. A successful exploitation could cause the affected system to crash, leading to service interruptions, potential data unavailability, and operational disruption. This can impact critical infrastructure, data centers, cloud service providers, and enterprises relying on Linux-based storage solutions. Although the vulnerability does not directly lead to data corruption or unauthorized access, the resulting downtime could affect business continuity and service level agreements. Given the widespread use of Linux in European IT infrastructure, especially in data centers and cloud environments, the impact could be significant if exploited. However, the lack of known exploits and the requirement for the attacker to send crafted SCSI WRITE_SAME commands to the target limits the attack surface to environments where the attacker has network or physical access to the storage target interface.

Mitigation Recommendations

European organizations should apply the official Linux kernel patches that address CVE-2022-21546 as soon as they become available for their distributions. Specifically, updating the kernel to a version that includes the fix for the WRITE_SAME NDOB handling is critical. For environments where immediate patching is not feasible, organizations should restrict access to SCSI target interfaces to trusted networks and authenticated users only, minimizing exposure to untrusted actors. Monitoring and logging SCSI commands on storage targets can help detect anomalous WRITE_SAME commands with NDOB bits set. Additionally, organizations should review their storage target configurations to ensure that unnecessary exposure of SCSI target services is minimized, employing network segmentation and access controls. Vendors providing Linux-based storage solutions should be engaged to confirm patch availability and deployment timelines. Finally, maintaining robust backup and recovery procedures will mitigate the impact of potential service disruptions caused by exploitation attempts.

Need more detailed analysis?Get Pro

Technical Details

Data Version
5.1
Assigner Short Name
oracle
Date Reserved
2021-11-15T19:29:08.898Z
Cisa Enriched
true
Cvss Version
null
State
PUBLISHED

Threat ID: 682d9818c4522896dcbd7b54

Added to database: 5/21/2025, 9:08:40 AM

Last enriched: 7/5/2025, 3:10:00 AM

Last updated: 8/13/2025, 6:59:38 AM

Views: 18

Actions

PRO

Updates to AI analysis are available only with a Pro account. Contact root@offseq.com for access.

Please log in to the Console to use AI analysis features.

Need enhanced features?

Contact root@offseq.com for Pro access with improved analysis and higher rate limits.

Latest Threats