CVE-2021-47459

can: j1939: j1939_netdev_start(): fix UAF for rx_kref of j1939_priv

HIGH
7.8
CVSS Score
Published: May 22, 2024 at 06:23 AM UTC
Updated: August 5, 2026 at 09:24 AM UTC
1 product affected across 1 vendorLinux Kernel

Using Linux by Linux?

Get instant alerts when new vulnerabilities affect Linux - before attackers find them.

Real-time alertsTrack your software stackFree plan available
Severity
HIGH7.8
Exploit prediction
EPSS 0.2%
SSVC
No known exploit

Description

In the Linux kernel, the following vulnerability has been resolved: can: j1939: j1939_netdev_start(): fix UAF for rx_kref of j1939_priv It will trigger UAF for rx_kref of j1939_priv as following. cpu0 cpu1 j1939_sk_bind(socket0, ndev0, ...) j1939_netdev_start j1939_sk_bind(socket1, ndev0, ...) j1939_netdev_start j1939_priv_set j1939_priv_get_by_ndev_locked j1939_jsk_add ..... j1939_netdev_stop kref_put_lock(&priv->rx_kref, ...) kref_get(&priv->rx_kref, ...) REFCOUNT_WARN("addition on 0;...") ==================================================== refcount_t: addition on 0; use-after-free. WARNING: CPU: 1 PID: 20874 at lib/refcount.c:25 refcount_warn_saturate+0x169/0x1e0 RIP: 0010:refcount_warn_saturate+0x169/0x1e0 Call Trace: j1939_netdev_start+0x68b/0x920 j1939_sk_bind+0x426/0xeb0 ? security_socket_bind+0x83/0xb0 The rx_kref's kref_get() and kref_put() should use j1939_netdev_lock to protect.

Affected

Our own answer: ranges merged, affected separated from platform-only, with confidence and review flags.

5.11 ≤ v < 5.14.155.4 ≤ v < 5.10.765.4 ≤ v < 5.14.155.4 ≤ v < 5.155.4 ≤ v < 5.4.1565.5 ≤ v < 5.10.765.15 rc15.15 rc25.15 rc35.15 rc45.15 rc55.15 rc69d71dd0c70099914fcd063135da3c580865e924c
Vendor states this is fixed in 6e8811707e2df0c6ba920f0cad3a3bca7b42132f (fixed)
Vendor states this is fixed in 864e77771a24c877aaf53aee019f78619cbcd668 (fixed)
Vendor states this is fixed in a0e47d2833b4f65e6c799f28c6b636d36b8b936d (fixed)
Vendor states this is fixed in d9d52a3ebd284882f5562c88e55991add5d01586 (fixed)
Vendor states this is fixed in 5.10.76 (unaffected)
Vendor states this is fixed in 5.14.15 (unaffected)
Vendor states this is fixed in 5.15 (unaffected)
Vendor states this is fixed in 5.4 (unaffected)
Vendor states this is fixed in 5.4.156 (unaffected)

References (4)

Patch
Source: 416baaa9-dc9f-4396-8d5f-8c081fb06d67
https://git.kernel.org/stable/c/6e8811707e2df0c6ba920f0cad3a3bca7b42132f
Patch
Source: 416baaa9-dc9f-4396-8d5f-8c081fb06d67
https://git.kernel.org/stable/c/864e77771a24c877aaf53aee019f78619cbcd668
Patch
Source: 416baaa9-dc9f-4396-8d5f-8c081fb06d67
https://git.kernel.org/stable/c/a0e47d2833b4f65e6c799f28c6b636d36b8b936d
Patch
Source: 416baaa9-dc9f-4396-8d5f-8c081fb06d67
https://git.kernel.org/stable/c/d9d52a3ebd284882f5562c88e55991add5d01586

SSVC — Action Prioritization

SSVCNo known exploitNot automatablePartial impact

SSVC signals action urgency (what to patch first), separate from CVSS which measures severity.

CVSS

7.8HIGHLinux
Vector?

Quick Info

StatusMODIFIED
CWE
CWE-416

Get alerted

Stop reading CVE feeds looking for your own stack

Track the products you run and VulnTracker tells you when a new CVE affects them — with what is known about fixing it, and nothing about the rest.

Free plan, no card