Skip to contentSkip to conversation

CVE-2021-46995: can: mcp251xfd: mcp251xfd_probe(): fix an error pointer dereference in probe

DISCUSSION Greg Kroah-Hartman 1 participant 1 message Feb 28, 2024

lore
Share & tools
lore
#0 lore raw

From: [email protected]

Description
===========

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

can: mcp251xfd: mcp251xfd_probe(): fix an error pointer dereference in probe

When we converted this code to use dev_err_probe() we accidentally removed a return. It means that if devm_clk_get() it will lead to an Oops when we call clk_get_rate() on the next line.

The Linux kernel CVE team has assigned CVE-2021-46995 to this issue.

Affected and fixed versions
===========================

Issue introduced in 5.12 with commit cf8ee6de2543 and fixed in 5.12.5 with commit 15f8f96ec7fc Issue introduced in 5.12 with commit cf8ee6de2543 and fixed in 5.13 with commit 4cc7faa40697

Please see https://www.kernel.org or a full list of currently supported kernel versions by the kernel community.

Unaffected versions might change over time as fixes are backported to older supported kernel versions. The official CVE entry at

	https://cve.org/CVERecord/?id=CVE-2021-46995

will be updated if fixes are backported, please check that for the most up to date information about this issue.

Affected files
==============

The file(s) affected by this issue are:

	drivers/net/can/spi/mcp251xfd/mcp251xfd-core.c

Mitigation
==========

The Linux kernel CVE team recommends that you update to the latest stable kernel version for this, and many other bugfixes. Individual changes are never tested alone, but rather are part of a larger kernel release. Cherry-picking individual commits is not recommended or supported by the Linux kernel community at all. If however, updating to the latest release is impossible, the individual changes to resolve this issue can be found at these commits:

	https://git.kernel.org/stable/c/15f8f96ec7fc35024d4e03296e4d838fcea33d83
	https://git.kernel.org/stable/c/4cc7faa406975b460aa674606291dea197c1210c