CVE-2023-53627

Description

A race condition was found in the Linux kernel HiSilicon SAS controller driver's task slot management. A local user with privileges to trigger SCSI operations can cause concurrent list operations where the completion queue thread deletes entries from sas_dev.list while the SCSI error handler traverses it without proper locking, which leads to dereferencing freed or NULL list pointers and results in denial of service via kernel panic or potentially memory corruption.

Statement

The issue arises because of missing locking when accessing the shared sas_dev.list structure. Two code paths can execute concurrently: the completion queue thread (cq thread) calls slot_complete_v3_hw() → hisi_sas_slot_task_free() → list_del_init() to remove completed task slots, while the SCSI error handler thread calls sas_scsi_find_task() → hisi_sas_abort_task() → dereg_device_v3_hw() → list_for_each_entry_safe() to traverse the same list when aborting tasks. Without synchronization, the deletion can invalidate list pointers while traversal is in progress. When the error handler attempts to follow the next pointer in the list after a concurrent deletion, it dereferences a NULL or freed pointer (register x1 = 0x0000000000000000 in the crash dump), causing a kernel panic. The race window is narrow and requires precise timing between I/O completion and error handling paths, which can be triggered under heavy I/O workload with concurrent errors. While this reliably causes availability impact through kernel panics, the underlying list corruption represents a memory safety violation. With sufficient control over timing and heap layout, race conditions on linked list structures can potentially be leveraged for more sophisticated attacks beyond denial of service, though such exploitation would be complex.

Mitigation

To mitigate this issue, prevent the hisi_sas_v3_hw module from loading. See https://access.redhat.com/solutions/41278 for instructions on blacklisting kernel modules.

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).

The following CVSS metrics and score provided are preliminary and subject to review.

CVSS v3 Score Breakdown

Red HatNVDcve.org
Base Score6.45.57.8
Attack VectorLocalLocalLocal
Attack ComplexityHighLowLow
Privileges RequiredHighLowLow
User InteractionNoneNoneNone
ScopeUnchangedUnchangedUnchanged
ConfidentialityHighNoneHigh
Integrity ImpactHighNoneHigh
Availability ImpactHighHighHigh

Vector

Red Hat: CVSS:3.1/AV:L/AC:H/PR:H/UI:N/S:U/C:H/I:H/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)

Integrity,Confidentiality,Other

Technical Impact: Modify Application Data; Read Application Data; Alter Execution Logic

Frequently Asked Questions

Want to get errata notifications? Sign up here.