Skip to contentSkip to conversation

CVE-2021-47670: can: peak_usb: fix use after free bugs

DISCUSSION Greg Kroah-Hartman 1 participant 1 message Apr 17, 2025

lore
Share & tools
lore
#0 lore raw

From: Greg Kroah-Hartman <[email protected]>

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

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

can: peak_usb: fix use after free bugs

After calling peak_usb_netif_rx_ni(skb), dereferencing skb is unsafe. Especially, the can_frame cf which aliases skb memory is accessed after the peak_usb_netif_rx_ni().

Reordering the lines solves the issue.

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

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

	Issue introduced in 4.0 with commit 0a25e1f4f18566b750ebd3ae995af64e23111e63 and fixed in 4.19.171 with commit 5408824636fa0dfedb9ecb0d94abd573131bfbbe
	Issue introduced in 4.0 with commit 0a25e1f4f18566b750ebd3ae995af64e23111e63 and fixed in 5.4.93 with commit ddd1416f44130377798c1430b76503513b7497c2
	Issue introduced in 4.0 with commit 0a25e1f4f18566b750ebd3ae995af64e23111e63 and fixed in 5.10.11 with commit ec939c13c3fff2114479769c8380b7f1a54feca9
	Issue introduced in 4.0 with commit 0a25e1f4f18566b750ebd3ae995af64e23111e63 and fixed in 5.11 with commit 50aca891d7a554db0901b245167cd653d73aaa71

Please see https://www.kernel.org for 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-47670

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/usb/peak_usb/pcan_usb_fd.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/5408824636fa0dfedb9ecb0d94abd573131bfbbe
	https://git.kernel.org/stable/c/ddd1416f44130377798c1430b76503513b7497c2
	https://git.kernel.org/stable/c/ec939c13c3fff2114479769c8380b7f1a54feca9
	https://git.kernel.org/stable/c/50aca891d7a554db0901b245167cd653d73aaa71