CVE-2023-53609

Description

A use-after-free flaw was found in the Linux kernel's SCSI subsystem in the command dispatch error handling. A local user can trigger this issue through specific SCSI device operations that cause dispatch failures, where the code attempts to increment a reference counter on a device structure that may have already been freed after returning from the dispatch function. This results in accessing freed memory, leading to kernel panic or potential memory corruption.

Statement

The vulnerability was introduced by a commit that attempted to fix reference counting by incrementing iorequest_cnt after dispatch. However, the design assumption that cmd->device remains valid after scsi_dispatch_cmd() returns is incorrect—the device structure can be freed during or immediately after dispatch in certain error scenarios. When the code then attempts to access cmd->device->iorequest_cnt, it dereferences freed memory. This race window is narrow and requires specific error conditions during SCSI command dispatch, such as device removal concurrent with I/O operations or certain failure paths in lower-level drivers.

Common Vulnerability Scoring System (CVSS) Score Details

Info alert:Important note

CVSS scores for open source components depend on vendor-specific factors (e.g. version or build chain). Therefore, Red Hat's score and impact rating can be different from NVD and other vendors. Red Hat remains the authoritative CVE Naming Authority (CNA) source for its products and services (see Red Hat classifications).

CVSS v3 Score Breakdown

Red HatNVDcve.org
Base Score4.75.57.8
Attack VectorLocalLocalLocal
Attack ComplexityHighLowLow
Privileges RequiredLowLowLow
User InteractionNoneNoneNone
ScopeUnchangedUnchangedUnchanged
ConfidentialityNoneNoneHigh
Integrity ImpactNoneNoneHigh
Availability ImpactHighHighHigh

Vector

Red Hat: CVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:U/C:N/I:N/A:H

NVD: CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H

cve.org: CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H

Understanding the Weakness (CWE)

Confidentiality

Technical Impact: Read Memory

If the expired pointer is used in a read operation, an attacker might be able to control data read in by the application.

Availability

Technical Impact: DoS: Crash, Exit, or Restart

If the expired pointer references a memory location that is not accessible to the product, or points to a location that is "malformed" (such as NULL) or larger than expected by a read or write operation, then a crash may occur.

Integrity,Confidentiality,Availability

Technical Impact: Execute Unauthorized Code or Commands

If the expired pointer is used in a function call, or points to unexpected data in a write operation, then code execution may be possible.

Frequently Asked Questions

Want to get errata notifications? Sign up here.