CVE-2022-50491

Description

A context violation bug was found in the Linux kernel's CoreSight CTI (Cross Trigger Interface) driver in the hardware enable/disable functions. These functions are called from atomic context but attempt runtime PM operations that can sleep when communicating with firmware. This causes "sleeping function called from invalid context" errors and system hangs when enabling CoreSight tracing, particularly on ARM Juno platforms, resulting in denial of service.

Statement

The CTI component coordinates debugging across multiple cores. When perf enables ETM (Embedded Trace Macrocell) tracing, it builds a trace path and enables each component along that path—including CTI devices. This happens under spinlocks in the perf event scheduling code, creating an atomic context where sleeping is forbidden. The cti_enable_hw and cti_disable_hw functions were calling pm_runtime_get and pm_runtime_put to manage power. These runtime PM calls can communicate with firmware (like ARM SCMI) to control clocks and power domains. Firmware communication typically involves waiting for responses, which means sleeping. Sleeping in atomic context triggers kernel warnings and can cause complete system hangs. The issue became more visible after a revert of SCMI power domain changes made the sleep more likely. The solution: remove the PM calls entirely from these functions. The runtime PM has already been handled at a higher level when building the trace path, so these redundant calls were both wrong and unnecessary.

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)

An unexpected call to blocking code can trigger an infinite loop, or a large loop that causes the software to pause and wait indefinitely.

Frequently Asked Questions

Want to get errata notifications? Sign up here.