CVE-2022-50546

Description

An uninitialized variable flaw was found in the Linux kernel's ext4 filesystem in the inode eviction path. A local user can trigger this issue by creating filesystem operations that cause inode allocation to fail before the i_flags field is initialized, followed by inode cleanup that attempts to read the uninitialized field. This causes the kernel to access uninitialized memory, resulting in unpredictable behavior and denial of service through a kernel crash.

Statement

The ext4_alloc_inode function allocates memory for new inodes but fails to initialize the ei->i_flags field. When __ext4_new_inode encounters an error before setting i_flags and calls iput to clean up, the subsequent ext4_evict_inode function attempts to read the uninitialized i_flags value. This accesses undefined memory contents, triggering KMSAN (Kernel Memory Sanitizer) warnings and potentially causing kernel crashes or unpredictable behavior. The issue occurs during normal filesystem operations like mkdir or mknod when inode allocation fails partway through, which can happen under memory pressure or filesystem corruption. Any local user performing filesystem operations on ext4 volumes can potentially trigger this condition.

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.57.8N/A
Attack VectorLocalLocalN/A
Attack ComplexityLowLowN/A
Privileges RequiredLowLowN/A
User InteractionNoneNoneN/A
ScopeUnchangedUnchangedN/A
ConfidentialityNoneHighN/A
Integrity ImpactNoneHighN/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:H/I:H/A:H

Understanding the Weakness (CWE)

Confidentiality

Technical Impact: Read Memory; Read Application Data

When reusing a resource such as memory or a program variable, the original contents of that resource may not be cleared before it is sent to an untrusted party.

Availability

Technical Impact: DoS: Crash, Exit, or Restart

The uninitialized resource may contain values that cause program flow to change in ways that the programmer did not intend.

Frequently Asked Questions

Want to get errata notifications? Sign up here.