CVE-2024-46791 can: mcp251x: fix deadlock if an interrupt occurs during mcp251x_open

Medium 5.5 Published Updated

A race condition in the Linux kernel MCP251x CAN driver can cause a deadlock, leading to a 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-46791?

CVE-2024-46791 is a medium-severity vulnerability in Linux kernel, published on 18 Sep 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:

can: mcp251x: fix deadlock if an interrupt occurs during mcp251x_open

The mcp251x_hw_wake() function is called with the mpc_lock mutex held and disables the interrupt handler so that no interrupts can be processed while waking the device. If an interrupt has already occurred then waiting for the interrupt handler to complete will deadlock because it will be trying to acquire the same mutex.

CPU0 CPU1 ---- ---- mcp251x_open() mutex_lock(&priv->mcp_lock) request_threaded_irq() <interrupt> mcp251x_can_ist() mutex_lock(&priv->mcp_lock) mcp251x_hw_wake() disable_irq() <-- deadlock

Use disable_irq_nosync() instead because the interrupt handler does everything while holding the mutex so it doesn't matter if it's still running.

Weakness: CWE-667

Which versions are affected by CVE-2024-46791?

It affects 1 product.

Products include Linux kernel.

How do I fix CVE-2024-46791?

Apply the vendor's patch.

Is CVE-2024-46791 being exploited?

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

All Linux kernel vulnerabilities

Sources

Also known as AZL-49409, BELL-CVE-2024-46791, DEBIAN-CVE-2024-46791, GHSA-cx7m-fcgf-9rj4, UBUNTU-CVE-2024-46791.

Is CVE-2024-46791 in your software?

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

Check your SBOMs for free