CVE-2022-50549

Description

An ABBA deadlock flaw was found in the Linux kernel's device-mapper thin provisioning subsystem between the memory reclaim path and metadata abort handling. A local user can trigger this issue by initiating cache drop operations while dm-thin operations are active, causing process P1 to hold shrinker_rwsem and wait for pmd->root_lock while process P2 holds pmd->root_lock and waits for shrinker_rwsem during metadata abort. This results in a deadlock manifesting as hung tasks and system unresponsiveness, leading to denial of service.

Statement

The deadlock occurs through a specific interaction between memory management and device-mapper operations. When cache is dropped (via /proc/sys/vm/drop_caches), the shrink_slab path acquires shrinker_rwsem for reading, then processes filesystem operations that may involve dm-thin devices. Concurrently, when dm-thin metadata operations fail, the dm_pool_abort_metadata function acquires pmd->root_lock, destroys the block manager (which unregisters a shrinker), and attempts to acquire shrinker_rwsem for writing. Meanwhile, thin_map operations acquire pmd->root_lock for reading. This creates an ABBA deadlock: P1 holds shrinker_rwsem→waits for pmd->root_lock, P2 holds pmd->root_lock→waits for shrinker_rwsem.

Mitigation

To mitigate this issue, prevent the dm_thin_pool module from being loaded. 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).

CVSS v3 Score Breakdown

Red HatNVDcve.org
Base Score5.55.5N/A
Attack VectorLocalLocalN/A
Attack ComplexityLowLowN/A
Privileges RequiredLowLowN/A
User InteractionNoneNoneN/A
ScopeUnchangedUnchangedN/A
ConfidentialityNoneNoneN/A
Integrity ImpactNoneNoneN/A
Availability ImpactHighHighN/A

Vector

Red Hat: CVSS:3.1/AV:L/AC:L/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

Understanding the Weakness (CWE)

Availability

Technical Impact: DoS: Resource Consumption (CPU); DoS: Resource Consumption (Other); DoS: Crash, Exit, or Restart

Each thread of execution will "hang" and prevent tasks from completing. In some cases, CPU consumption may occur if a lock check occurs in a tight loop.

Frequently Asked Questions

Want to get errata notifications? Sign up here.