CVE-2024-50041 i40e: Fix macvlan leak by synchronizing access to mac_filter_hash

High 8.8 Published Updated

A race condition in the i40e network driver allows concurrent access to mac_filter_hash, causing memory leaks and potential denial of service.

Exploited in the wild
Not known
Login needed
Any signed-in user
Attackable
Local or same network only
Victim action needed
Not needed
Fix
Available

What is CVE-2024-50041?

CVE-2024-50041 is a high-severity vulnerability in Linux kernel, published on 21 Oct 2024. It can only be exploited from the same machine or local network, with no action from the victim.

Official description

In the Linux kernel, the following vulnerability has been resolved:

i40e: Fix macvlan leak by synchronizing access to mac_filter_hash

This patch addresses a macvlan leak issue in the i40e driver caused by concurrent access to vsi->mac_filter_hash. The leak occurs when multiple threads attempt to modify the mac_filter_hash simultaneously, leading to inconsistent state and potential memory leaks.

To fix this, we now wrap the calls to i40e_del_mac_filter() and zeroing vf->default_lan_addr.addr with spin_lock/unlock_bh(&vsi->mac_filter_hash_lock), ensuring atomic operations and preventing concurrent access.

Additionally, we add lockdep_assert_held(&vsi->mac_filter_hash_lock) in i40e_add_mac_filter() to help catch similar issues in the future.

Reproduction steps: 1. Spawn VFs and configure port vlan on them. 2. Trigger concurrent macvlan operations (e.g., adding and deleting portvlan and/or mac filters). 3. Observe the potential memory leak and inconsistent state in the mac_filter_hash.

This synchronization ensures the integrity of the mac_filter_hash and prevents the described leak.

Weakness: CWE-401

Which versions are affected by CVE-2024-50041?

It affects 1 product.

Products include Linux kernel.

How do I fix CVE-2024-50041?

Apply the vendor's patch.

Is CVE-2024-50041 being exploited?

There is no known exploitation of CVE-2024-50041 in the wild and no public exploit code.

All Linux kernel vulnerabilities

Sources

Also known as AZL-51159, AZL-51198, BELL-CVE-2024-50041, DEBIAN-CVE-2024-50041, GHSA-9748-w7hv-7h34, UBUNTU-CVE-2024-50041.

Is CVE-2024-50041 in your software?

Upload an SBOM and sbomify checks it against every vulnerability here, every day.

Check your SBOMs for free