Skip to main content

CVE-2022-48744: Vulnerability in Linux Linux

High
VulnerabilityCVE-2022-48744cvecve-2022-48744
Published: Thu Jun 20 2024 (06/20/2024, 11:13:27 UTC)
Source: CVE
Vendor/Project: Linux
Product: Linux

Description

In the Linux kernel, the following vulnerability has been resolved: net/mlx5e: Avoid field-overflowing memcpy() In preparation for FORTIFY_SOURCE performing compile-time and run-time field bounds checking for memcpy(), memmove(), and memset(), avoid intentionally writing across neighboring fields. Use flexible arrays instead of zero-element arrays (which look like they are always overflowing) and split the cross-field memcpy() into two halves that can be appropriately bounds-checked by the compiler. We were doing: #define ETH_HLEN 14 #define VLAN_HLEN 4 ... #define MLX5E_XDP_MIN_INLINE (ETH_HLEN + VLAN_HLEN) ... struct mlx5e_tx_wqe *wqe = mlx5_wq_cyc_get_wqe(wq, pi); ... struct mlx5_wqe_eth_seg *eseg = &wqe->eth; struct mlx5_wqe_data_seg *dseg = wqe->data; ... memcpy(eseg->inline_hdr.start, xdptxd->data, MLX5E_XDP_MIN_INLINE); target is wqe->eth.inline_hdr.start (which the compiler sees as being 2 bytes in size), but copying 18, intending to write across start (really vlan_tci, 2 bytes). The remaining 16 bytes get written into wqe->data[0], covering byte_count (4 bytes), lkey (4 bytes), and addr (8 bytes). struct mlx5e_tx_wqe { struct mlx5_wqe_ctrl_seg ctrl; /* 0 16 */ struct mlx5_wqe_eth_seg eth; /* 16 16 */ struct mlx5_wqe_data_seg data[]; /* 32 0 */ /* size: 32, cachelines: 1, members: 3 */ /* last cacheline: 32 bytes */ }; struct mlx5_wqe_eth_seg { u8 swp_outer_l4_offset; /* 0 1 */ u8 swp_outer_l3_offset; /* 1 1 */ u8 swp_inner_l4_offset; /* 2 1 */ u8 swp_inner_l3_offset; /* 3 1 */ u8 cs_flags; /* 4 1 */ u8 swp_flags; /* 5 1 */ __be16 mss; /* 6 2 */ __be32 flow_table_metadata; /* 8 4 */ union { struct { __be16 sz; /* 12 2 */ u8 start[2]; /* 14 2 */ } inline_hdr; /* 12 4 */ struct { __be16 type; /* 12 2 */ __be16 vlan_tci; /* 14 2 */ } insert; /* 12 4 */ __be32 trailer; /* 12 4 */ }; /* 12 4 */ /* size: 16, cachelines: 1, members: 9 */ /* last cacheline: 16 bytes */ }; struct mlx5_wqe_data_seg { __be32 byte_count; /* 0 4 */ __be32 lkey; /* 4 4 */ __be64 addr; /* 8 8 */ /* size: 16, cachelines: 1, members: 3 */ /* last cacheline: 16 bytes */ }; So, split the memcpy() so the compiler can reason about the buffer sizes. "pahole" shows no size nor member offset changes to struct mlx5e_tx_wqe nor struct mlx5e_umr_wqe. "objdump -d" shows no meaningful object code changes (i.e. only source line number induced differences and optimizations).

AI-Powered Analysis

AILast updated: 06/30/2025, 20:12:56 UTC

Technical Analysis

CVE-2022-48744 is a vulnerability identified in the Linux kernel's mlx5e network driver, specifically within the handling of memory copying operations in the transmit work queue entry (WQE) structures. The issue arises from an unsafe use of memcpy() that copies more bytes than the size of the target field, leading to an overflow into adjacent fields within the data structure. The vulnerability is rooted in the way the mlx5e_tx_wqe structure's eth segment's inline_hdr.start field (2 bytes) is used as a destination for a memcpy() call that copies 18 bytes, unintentionally overwriting neighboring fields such as vlan_tci and the first element of the data segment, which includes critical fields like byte_count, lkey, and addr. This overflow occurs because the compiler cannot properly enforce bounds checking on zero-length arrays and cross-field memcpy operations, which prompted the developers to refactor the code to use flexible arrays and split the memcpy() into two parts that the compiler can verify for safety. The vulnerability does not change the size or layout of the affected structures, and the patch does not introduce significant code changes beyond safer memory operations. While no known exploits are reported in the wild, the flaw could potentially allow an attacker with the ability to trigger these memcpy operations to corrupt kernel memory, leading to undefined behavior such as data corruption, privilege escalation, or denial of service. The vulnerability affects specific Linux kernel versions identified by commit hashes and is relevant to systems using Mellanox mlx5 network drivers, commonly found in high-performance computing and data center environments.

Potential Impact

For European organizations, this vulnerability poses a risk primarily to servers and infrastructure running Linux kernels with the affected mlx5e driver, especially in data centers, cloud providers, and enterprises utilizing Mellanox network adapters for high-speed networking. Exploitation could lead to kernel memory corruption, potentially allowing attackers to escalate privileges, cause system crashes, or disrupt network operations. This could impact confidentiality, integrity, and availability of critical systems, particularly those handling sensitive data or providing essential services. Given the prevalence of Linux in European enterprise and public sector environments, especially in sectors like finance, telecommunications, and research institutions that rely on high-performance networking, the vulnerability could have significant operational and security consequences if exploited. However, exploitation requires triggering specific kernel operations, which may limit the attack surface to privileged or local users or specially crafted network traffic scenarios. The absence of known exploits suggests a lower immediate risk but does not preclude future weaponization.

Mitigation Recommendations

European organizations should prioritize updating their Linux kernels to versions that include the patch addressing CVE-2022-48744. Specifically, they should ensure that their systems run kernel versions incorporating the fix that replaces zero-length arrays with flexible arrays and splits the memcpy() calls to enable compiler bounds checking. Network administrators should audit systems using Mellanox mlx5 network adapters and verify driver versions. Additionally, organizations should implement strict access controls to limit unprivileged users' ability to interact with network driver interfaces or trigger vulnerable code paths. Employing kernel hardening techniques such as enabling FORTIFY_SOURCE, Kernel Address Space Layout Randomization (KASLR), and other memory protection mechanisms can reduce exploitation likelihood. Monitoring kernel logs for anomalies related to mlx5e driver operations and deploying intrusion detection systems capable of recognizing unusual kernel memory corruption attempts can provide early warning. Finally, organizations should maintain an inventory of affected hardware and software to ensure timely patch deployment and compliance verification.

Need more detailed analysis?Get Pro

Technical Details

Data Version
5.1
Assigner Short Name
Linux
Date Reserved
2024-06-20T11:09:39.055Z
Cisa Enriched
true
Cvss Version
null
State
PUBLISHED

Threat ID: 682d982ec4522896dcbe603a

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

Last enriched: 6/30/2025, 8:12:56 PM

Last updated: 8/21/2025, 3:27:00 PM

Views: 17

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