Skip to main content

CVE-2022-49804: Vulnerability in Linux Linux

Medium
VulnerabilityCVE-2022-49804cvecve-2022-49804
Published: Thu May 01 2025 (05/01/2025, 14:09:31 UTC)
Source: CVE
Vendor/Project: Linux
Product: Linux

Description

In the Linux kernel, the following vulnerability has been resolved: s390: avoid using global register for current_stack_pointer Commit 30de14b1884b ("s390: current_stack_pointer shouldn't be a function") made current_stack_pointer a global register variable like on many other architectures. Unfortunately on s390 it uncovers old gcc bug which is fixed only since gcc-9.1 [gcc commit 3ad7fed1cc87 ("S/390: Fix PR89775. Stackpointer save/restore instructions removed")] and backported to gcc-8.4 and later. Due to this bug gcc versions prior to 8.4 generate broken code which leads to stack corruptions. Current minimal gcc version required to build the kernel is declared as 5.1. It is not possible to fix all old gcc versions, so work around this problem by avoiding using global register variable for current_stack_pointer.

AI-Powered Analysis

AILast updated: 06/30/2025, 01:54:54 UTC

Technical Analysis

CVE-2022-49804 is a vulnerability identified in the Linux kernel specifically affecting the s390 architecture, which is IBM's mainframe platform. The issue arises from a change introduced in commit 30de14b1884b that made the current_stack_pointer a global register variable, aligning with implementations on other architectures. However, this change exposed a longstanding GCC compiler bug present in versions prior to 8.4. This bug causes the compiler to generate incorrect code for the s390 architecture, leading to stack corruption due to improper handling of the stack pointer. The GCC bug was fixed starting from version 9.1 and backported to 8.4, but the Linux kernel's minimum GCC version requirement is 5.1, which means many builds could still be affected if older GCC versions are used. Because it is impractical to fix all older GCC versions, the Linux kernel maintainers addressed the problem by avoiding the use of a global register variable for current_stack_pointer on s390, thus mitigating the risk of stack corruption caused by the compiler bug. This vulnerability is primarily a build-time issue that can lead to unstable or corrupted kernel behavior on s390 systems if compiled with vulnerable GCC versions. There are no known exploits in the wild, and the vulnerability does not affect other architectures or Linux kernel versions built with newer GCC compilers.

Potential Impact

For European organizations running Linux on s390 mainframe systems, this vulnerability could lead to kernel instability or crashes due to stack corruption if their kernel was compiled with vulnerable GCC versions (prior to 8.4). This could impact the availability and integrity of critical systems, especially in sectors relying on mainframe computing such as banking, insurance, and large-scale enterprise IT environments. Confidentiality impact is minimal as this is not a direct information disclosure vulnerability. However, the potential for system crashes or unpredictable behavior could disrupt business operations and lead to downtime or data integrity issues. Since the vulnerability is tied to the build environment rather than runtime exploitation, the risk is mostly relevant during kernel compilation or updates. Organizations using precompiled kernels from trusted sources with updated GCC versions are less likely to be affected. The lack of known exploits in the wild reduces immediate threat but does not eliminate the risk of accidental system failures or targeted attacks exploiting unstable kernel states.

Mitigation Recommendations

European organizations using Linux on s390 architectures should ensure that their Linux kernels are compiled with GCC version 8.4 or later, ideally 9.1 or newer, to avoid the compiler bug causing stack corruption. If building kernels internally, verify the GCC version and apply the kernel patch that avoids using a global register variable for current_stack_pointer on s390. For organizations relying on vendor-supplied kernels, confirm that the vendor has incorporated this fix and uses appropriate GCC versions. Additionally, implement rigorous testing and validation of kernel builds on s390 systems to detect any instability or crashes potentially related to this issue. Maintain an inventory of s390 systems and their kernel build environments to identify any at risk. Avoid using outdated or unsupported GCC versions for kernel compilation. Regularly monitor Linux kernel updates and security advisories for any further developments related to this vulnerability.

Need more detailed analysis?Get Pro

Technical Details

Data Version
5.1
Assigner Short Name
Linux
Date Reserved
2025-05-01T14:05:17.225Z
Cisa Enriched
false
Cvss Version
null
State
PUBLISHED

Threat ID: 682d982cc4522896dcbe4c6d

Added to database: 5/21/2025, 9:09:00 AM

Last enriched: 6/30/2025, 1:54:54 AM

Last updated: 8/14/2025, 6:32:56 AM

Views: 13

Actions

PRO

Updates to AI analysis are available only with a Pro account. Contact root@offseq.com for access.

Please log in to the Console to use AI analysis features.

Need enhanced features?

Contact root@offseq.com for Pro access with improved analysis and higher rate limits.

Latest Threats