Skip to main content

CVE-2022-49338: Vulnerability in Linux Linux

High
VulnerabilityCVE-2022-49338cvecve-2022-49338
Published: Wed Feb 26 2025 (02/26/2025, 02:10:56 UTC)
Source: CVE
Vendor/Project: Linux
Product: Linux

Description

In the Linux kernel, the following vulnerability has been resolved: net/mlx5e: CT: Fix cleanup of CT before cleanup of TC ct rules CT cleanup assumes that all tc rules were deleted first, and so is free to delete the CT shared resources (e.g the dr_action fwd_action which is shared for all tuples). But currently for uplink, this is happens in reverse, causing the below trace. CT cleanup is called from: mlx5e_cleanup_rep_tx()->mlx5e_cleanup_uplink_rep_tx()-> mlx5e_rep_tc_cleanup()->mlx5e_tc_esw_cleanup()-> mlx5_tc_ct_clean() Only afterwards, tc cleanup is called from: mlx5e_cleanup_rep_tx()->mlx5e_tc_ht_cleanup() which would have deleted all the tc ct rules, and so delete all the offloaded tuples. Fix this reversing the order of init and on cleanup, which will result in tc cleanup then ct cleanup. [ 9443.593347] WARNING: CPU: 2 PID: 206774 at drivers/net/ethernet/mellanox/mlx5/core/steering/dr_action.c:1882 mlx5dr_action_destroy+0x188/0x1a0 [mlx5_core] [ 9443.593349] Modules linked in: act_ct nf_flow_table rdma_ucm(O) rdma_cm(O) iw_cm(O) ib_ipoib(O) ib_cm(O) ib_umad(O) mlx5_core(O-) mlxfw(O) mlxdevm(O) auxiliary(O) ib_uverbs(O) psample ib_core(O) mlx_compat(O) ip_gre gre ip_tunnel act_vlan bonding geneve esp6_offload esp6 esp4_offload esp4 act_tunnel_key vxlan ip6_udp_tunnel udp_tunnel act_mirred act_skbedit act_gact cls_flower sch_ingress nfnetlink_cttimeout nfnetlink xfrm_user xfrm_algo 8021q garp stp ipmi_devintf mrp ipmi_msghandler llc openvswitch nsh nf_conncount nf_nat mst_pciconf(O) dm_multipath sbsa_gwdt uio_pdrv_genirq uio mlxbf_pmc mlxbf_pka mlx_trio mlx_bootctl(O) bluefield_edac sch_fq_codel ip_tables ipv6 crc_ccitt btrfs zstd_compress raid10 raid456 async_raid6_recov async_memcpy async_pq async_xor async_tx xor xor_neon raid6_pq raid1 raid0 crct10dif_ce i2c_mlxbf gpio_mlxbf2 mlxbf_gige aes_neon_bs aes_neon_blk [last unloaded: mlx5_ib] [ 9443.593419] CPU: 2 PID: 206774 Comm: modprobe Tainted: G O 5.4.0-1023.24.gc14613d-bluefield #1 [ 9443.593422] Hardware name: https://www.mellanox.com BlueField SoC/BlueField SoC, BIOS BlueField:143ebaf Jan 11 2022 [ 9443.593424] pstate: 20000005 (nzCv daif -PAN -UAO) [ 9443.593489] pc : mlx5dr_action_destroy+0x188/0x1a0 [mlx5_core] [ 9443.593545] lr : mlx5_ct_fs_smfs_destroy+0x24/0x30 [mlx5_core] [ 9443.593546] sp : ffff8000135dbab0 [ 9443.593548] x29: ffff8000135dbab0 x28: ffff0003a6ab8e80 [ 9443.593550] x27: 0000000000000000 x26: ffff0003e07d7000 [ 9443.593552] x25: ffff800009609de0 x24: ffff000397fb2120 [ 9443.593554] x23: ffff0003975c0000 x22: 0000000000000000 [ 9443.593556] x21: ffff0003975f08c0 x20: ffff800009609de0 [ 9443.593558] x19: ffff0003c8a13380 x18: 0000000000000014 [ 9443.593560] x17: 0000000067f5f125 x16: 000000006529c620 [ 9443.593561] x15: 000000000000000b x14: 0000000000000000 [ 9443.593563] x13: 0000000000000002 x12: 0000000000000001 [ 9443.593565] x11: ffff800011108868 x10: 0000000000000000 [ 9443.593567] x9 : 0000000000000000 x8 : ffff8000117fb270 [ 9443.593569] x7 : ffff0003ebc01288 x6 : 0000000000000000 [ 9443.593571] x5 : ffff800009591ab8 x4 : fffffe000f6d9a20 [ 9443.593572] x3 : 0000000080040001 x2 : fffffe000f6d9a20 [ 9443.593574] x1 : ffff8000095901d8 x0 : 0000000000000025 [ 9443.593577] Call trace: [ 9443.593634] mlx5dr_action_destroy+0x188/0x1a0 [mlx5_core] [ 9443.593688] mlx5_ct_fs_smfs_destroy+0x24/0x30 [mlx5_core] [ 9443.593743] mlx5_tc_ct_clean+0x34/0xa8 [mlx5_core] [ 9443.593797] mlx5e_tc_esw_cleanup+0x58/0x88 [mlx5_core] [ 9443.593851] mlx5e_rep_tc_cleanup+0x24/0x30 [mlx5_core] [ 9443.593905] mlx5e_cleanup_rep_tx+0x6c/0x78 [mlx5_core] [ 9443.593959] mlx5e_detach_netdev+0x74/0x98 [mlx5_core] [ 9443.594013] mlx5e_netdev_change_profile+0x70/0x180 [mlx5_core] [ 9443.594067] mlx5e_netdev_attach_nic_profile+0x34/0x40 [mlx5_core] [ 9443.594122] mlx5e_vport_rep_unload+0x15c/0x1a8 [mlx5_core] [ 9443.594177] mlx5_eswitch_unregister_vport_reps+0x228/0x298 [mlx5_core] [ 9443.594231] mlx5e_rep_remove+0x2c/0x38 ---truncated---

AI-Powered Analysis

AILast updated: 06/30/2025, 05:58:12 UTC

Technical Analysis

CVE-2022-49338 is a vulnerability in the Linux kernel specifically affecting the Mellanox mlx5 Ethernet driver, which is used for high-performance network interface cards (NICs) and related hardware such as BlueField SoCs. The vulnerability arises from an incorrect order of cleanup operations in the connection tracking (CT) and traffic control (TC) subsystems within the mlx5e driver. The CT cleanup process assumes that all TC connection tracking rules have been deleted before it runs, allowing it to safely free shared resources such as dr_action and fwd_action objects. However, in the affected versions, the cleanup order is reversed for uplink interfaces, causing CT cleanup to free resources that are still in use by TC rules. This leads to use-after-free conditions and kernel warnings or crashes, as evidenced by the provided kernel trace logs. The root cause is a logic flaw in the mlx5e_cleanup_rep_tx() function and its call chain, where CT cleanup is invoked before TC cleanup, violating the expected resource management sequence. The fix involves reversing the order of initialization and cleanup so that TC cleanup occurs before CT cleanup, preventing premature freeing of shared resources. This vulnerability is relevant to Linux kernel versions incorporating the affected mlx5e driver code, particularly in environments using Mellanox hardware such as BlueField SoCs. No known exploits are reported in the wild, and no CVSS score has been assigned yet.

Potential Impact

For European organizations, especially those operating data centers, cloud infrastructure, or high-performance computing environments that utilize Mellanox network adapters or BlueField SoCs, this vulnerability could lead to system instability or denial of service due to kernel crashes triggered by the improper cleanup sequence. The use-after-free condition could potentially be leveraged by a local attacker or malicious process with sufficient privileges to cause a kernel panic or disrupt network services, impacting availability. While there is no direct indication of privilege escalation or remote code execution, the instability risks could affect critical infrastructure, including telecommunications, financial services, and research institutions that rely on Linux servers with Mellanox hardware. The vulnerability may also impact virtualized environments or container platforms that use these NICs for network offloading and acceleration, potentially disrupting multi-tenant services. Given the specialized hardware involved, the impact is more pronounced in organizations with advanced networking setups rather than general-purpose Linux deployments.

Mitigation Recommendations

European organizations should promptly apply the Linux kernel patches that reorder the cleanup operations in the mlx5e driver to ensure TC cleanup precedes CT cleanup. Until patches are applied, administrators should consider the following mitigations: 1) Limit or avoid using the affected Mellanox mlx5e driver features related to connection tracking and traffic control on uplink interfaces, if feasible. 2) Restrict access to systems with Mellanox hardware to trusted users and processes to reduce the risk of local exploitation. 3) Monitor kernel logs for warnings or crashes related to mlx5_core and mlx5e modules to detect potential exploitation attempts or instability. 4) Coordinate with hardware vendors and Linux distribution maintainers to obtain and deploy vendor-specific kernel updates. 5) In virtualized or containerized environments, isolate workloads using affected hardware to minimize impact scope. 6) Employ kernel live patching solutions if available to reduce downtime during patch deployment. These targeted steps go beyond generic advice by focusing on the specific driver and hardware context of the vulnerability.

Need more detailed analysis?Get Pro

Technical Details

Data Version
5.1
Assigner Short Name
Linux
Date Reserved
2025-02-26T02:08:31.539Z
Cisa Enriched
false
Cvss Version
null
State
PUBLISHED

Threat ID: 682d982dc4522896dcbe56eb

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

Last enriched: 6/30/2025, 5:58:12 AM

Last updated: 7/31/2025, 4:00:12 PM

Views: 9

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