CVE-2021-47668: can: dev: can_restart: fix use after free bug

Published Apr 17, 2025
·
Updated

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

can: dev: canrestart: fix use after free bug

After calling netifrxni(skb), dereferencing skb is unsafe. Especially, the canframe cf which aliases skb memory is accessed after the netifrxni() in: stats->rxbytes += cf->len;

Reordering the lines solves the issue.

Affected Software

11 affected components
Linux Linux kernel
Linux Linux kernel>=2.6.31<4.4.254
Linux Linux kernel>=4.5<4.9.254
Linux Linux kernel>=4.10<4.14.218
Linux Linux kernel>=4.15<4.19.171
Linux Linux kernel>=4.20<5.4.93
Linux Linux kernel>=5.5<5.10.11
Linux Linux kernel=5.11-rc1
Linux Linux kernel=5.11-rc2
Linux Linux kernel=5.11-rc3
Linux Linux kernel=5.11-rc4

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. Configuration

    Reorder the lines in can: dev: can_restart: fix use after free bug so that after calling netif_rx_ni(skb), you do not access cf->len (where cf aliases skb memory). Concretely, ensure 'stats->rx_bytes += cf->len;' executes before the 'netif_rx_ni()' call.

    Linux kernel (can: dev: can_restart) Reorder statement after netif_rx_ni() = Move stats->rx_bytes += cf->len to occur before the netif_rx_ni() call so cf (aliasing skb memory) is not accessed after netif_rx_ni(skb)

Event History

Apr 17, 2025
CVE Published
via MITRE·06:01 PM
Data Sourced
via MITRE·06:01 PM
DescriptionSeverity
Data Sourced
via NVD·06:15 PM
RemedyDescriptionSeverityWeaknessAffected Software

Frequently Asked Questions

1

What is the severity of CVE-2021-47668?

CVE-2021-47668 has been classified with a moderate severity level due to the potential for a use-after-free condition in the Linux kernel.

2

How do I fix CVE-2021-47668?

To fix CVE-2021-47668, you should update to the latest version of the Linux kernel that includes the patch addressing this vulnerability.

3

Which versions of the Linux kernel are affected by CVE-2021-47668?

CVE-2021-47668 affects multiple versions of the Linux kernel prior to the application of the relevant patches.

4

What is a use-after-free bug in the context of CVE-2021-47668?

In CVE-2021-47668, a use-after-free bug occurs when the memory of a data structure is accessed after it has been freed, potentially leading to memory corruption.

5

Can CVE-2021-47668 be exploited remotely?

Yes, an attacker with appropriate privileges could potentially exploit CVE-2021-47668, but remote exploitation is contingent on specific conditions being met.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203