CVE-2021-46994 can: mcp251x: fix resume from sleep before interface was brought up

Medium 5.5 Published Updated

A null pointer dereference in the Linux kernel MCP251x CAN driver causes a system crash when resuming from sleep before the interface is enabled.

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-2021-46994?

CVE-2021-46994 is a medium-severity vulnerability in Linux kernel, published on 28 Feb 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 resume from sleep before interface was brought up

Since 8ce8c0abcba3 the driver queues work via priv->restart_work when resuming after suspend, even when the interface was not previously enabled. This causes a null dereference error as the workqueue is only allocated and initialized in mcp251x_open().

To fix this we move the workqueue init to mcp251x_can_probe() as there is no reason to do it later and repeat it whenever mcp251x_open() is called.

[mkl: fix error handling in mcp251x_stop()]

Weakness: CWE-476

Which versions are affected by CVE-2021-46994?

It affects 1 product.

Products include Linux kernel.

How do I fix CVE-2021-46994?

Apply the vendor's patch.

Is CVE-2021-46994 being exploited?

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

All Linux kernel vulnerabilities

Sources

Also known as DEBIAN-CVE-2021-46994, GHSA-9h3w-jq64-m799, UBUNTU-CVE-2021-46994.

Is CVE-2021-46994 in your software?

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

Check your SBOMs for free