CVE-2022-50476

Description

An incorrect function call was found in the Linux kernel Non-Transparent Bridge network driver's interrupt handling. When using AMD PTDMA DMA engines, the TX/RX callback handlers are invoked in hard interrupt context but call the interrupt-unsafe dev_kfree_skb() function to free network buffers, which results in kernel warnings and severe TCP/IP performance degradation.

Statement

The issue arises because ntb_netdev_tx_handler() and ntb_netdev_rx_handler() call dev_kfree_skb() to free socket buffers, but these handlers can be invoked in hard interrupt context when using certain DMA engines like AMD PTDMA. The dev_kfree_skb() function is not safe to call from interrupt context and should only be used in process context. When called from an interrupt handler, it triggers warnings from skb_release_head_state() because in_hardirq() returns true. On Intel IOAT DMA engines this issue doesn't manifest because that driver uses tasklets (softirq context) rather than hard interrupt handlers. On AMD systems, this causes both visible kernel warnings and severe TCP/IP performance degradation (order of magnitude slower than expected).

Mitigation

To mitigate this issue, prevent the ntb_netdev 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 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)

Integrity,Availability,Confidentiality

Technical Impact: Modify Memory; DoS: Crash, Exit, or Restart; Execute Unauthorized Code or Commands

This weakness may result in the corruption of memory, and perhaps instructions, possibly leading to a crash. If the corrupted memory can be effectively controlled, it may be possible to execute arbitrary code.

Frequently Asked Questions

Want to get errata notifications? Sign up here.