Skip to content
OpenAdvisories
Medium · 5.5 CVE-2020-36789 EUVD-2020-24230GHSA-5974-c6r6-2pv9

can: dev: can_get_echo_skb(): prevent call to kfree_skb() in hard IRQ context

Published Apr 17, 2025 · Updated May 11, 2026 · Assigned by Linux

Vendor: Linux Product: Linux Package: linux Package: linux Package: linux-allwinner-5.19 Package: linux-aws Package: linux-aws-5.0 Package: linux-aws-5.11 Package: linux-aws-5.13 Package: linux-aws-5.19 Package: linux-aws-5.3 Package: linux-aws-5.4 Package: linux-aws-5.8 Package: linux-aws-6.2 Package: linux-aws-6.5 Package: linux-aws-fips Package: linux-aws-hwe Package: linux-azure Package: linux-azure-4.15 Package: linux-azure-5.11 Package: linux-azure-5.13 Package: linux-azure-5.19 Package: linux-azure-5.3 Package: linux-azure-5.4 Package: linux-azure-5.8 Package: linux-azure-6.2 Package: linux-azure-6.5 Package: linux-azure-edge Package: linux-azure-fde Package: linux-azure-fde-5.19 Package: linux-azure-fde-6.2 Package: linux-azure-fips Package: linux-fips Package: linux-gcp Package: linux-gcp-4.15 Package: linux-gcp-5.11 Package: linux-gcp-5.13 Package: linux-gcp-5.19 Package: linux-gcp-5.3 Package: linux-gcp-5.4 Package: linux-gcp-5.8 Package: linux-gcp-6.2 Package: linux-gcp-6.5 Package: linux-gcp-fips Package: linux-gke Package: linux-gke-4.15 Package: linux-gke-5.15 Package: linux-gke-5.4 Package: linux-gkeop Package: linux-gkeop-5.15 Package: linux-gkeop-5.4 Package: linux-hwe Package: linux-hwe-5.11 Package: linux-hwe-5.13 Package: linux-hwe-5.19 Package: linux-hwe-5.4 Package: linux-hwe-5.8 Package: linux-hwe-6.2 Package: linux-hwe-6.5 Package: linux-hwe-edge Package: linux-intel-5.13 Package: linux-intel-iot-realtime Package: linux-kvm Package: linux-lowlatency-hwe-5.19 Package: linux-lowlatency-hwe-6.2 Package: linux-lowlatency-hwe-6.5 Package: linux-lts-xenial Package: linux-nvidia-6.2 Package: linux-nvidia-6.5 Package: linux-oem Package: linux-oem-5.10 Package: linux-oem-5.13 Package: linux-oem-5.14 Package: linux-oem-5.17 Package: linux-oem-5.6 Package: linux-oem-6.0 Package: linux-oem-6.1 Package: linux-oem-6.5 Package: linux-oracle Package: linux-oracle-5.0 Package: linux-oracle-5.11 Package: linux-oracle-5.13 Package: linux-oracle-5.3 Package: linux-oracle-5.4 Package: linux-oracle-5.8 Package: linux-oracle-6.5 Package: linux-raspi Package: linux-raspi-5.4 Package: linux-raspi-realtime Package: linux-raspi2 Package: linux-realtime Package: linux-riscv Package: linux-riscv-5.11 Package: linux-riscv-5.19 Package: linux-riscv-5.8 Package: linux-riscv-6.5 Package: linux-starfive-5.19 Package: linux-starfive-6.2 Package: linux-starfive-6.5 Package: linux-vmware Platform: Linux Ecosystem: Debian Ecosystem: Ubuntu

Description

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

can: dev: can_get_echo_skb(): prevent call to kfree_skb() in hard IRQ context

If a driver calls can_get_echo_skb() during a hardware IRQ (which is often, but
not always, the case), the 'WARN_ON(in_irq)' in
net/core/skbuff.c#skb_release_head_state() might be triggered, under network
congestion circumstances, together with the potential risk of a NULL pointer
dereference.

The root cause of this issue is the call to kfree_skb() instead of
dev_kfree_skb_irq() in net/core/dev.c#enqueue_to_backlog().

This patch prevents the skb to be freed within the call to netif_rx() by
incrementing its reference count with skb_get(). The skb is finally freed by
one of the in-irq-context safe functions: dev_consume_skb_any() or
dev_kfree_skb_any(). The "any" version is used because some drivers might call
can_get_echo_skb() in a normal context.

The reason for this issue to occur is that initially, in the core network
stack, loopback skb were not supposed to be received in hardware IRQ context.
The CAN stack is an exeption.

This bug was previously reported back in 2017 in [1] but the proposed patch
never got accepted.

While [1] directly modifies net/core/dev.c, we try to propose here a
smoother modification local to CAN network stack (the assumption
behind is that only CAN devices are affected by this issue).

[1] http://lore.kernel.org/r/57a3ffb6-3309-3ad5-5a34-e93c3fe3614d@cetitec.com

Affected products

VendorProductAffectedFixed
Linux Linux 2.6.31 4.4.244

Fixed in Linux distributions

Distributions backport fixes, so the version that fixes this vulnerability differs per release — upgrade to at least the version shown. From the distributions' security trackers and advisories.

ReleasePackageFixed inAdvisory
Debian 14 linux 5.9.9-1 —
Debian 13 linux 5.9.9-1 —
Debian 12 linux 5.9.9-1 —
ReleasePackageFixed inAdvisory
Ubuntu 24.04 LTS linux-realtime +1 No fix yet —
Ubuntu 22.04 LTS linux-riscv +32 No fix yet —
Ubuntu 20.04 LTS linux 5.4.0-59.65 —
Ubuntu 20.04 LTS linux-aws 5.4.0-1034.35 —
Ubuntu 20.04 LTS linux-azure 5.4.0-1035.36 —
Ubuntu 20.04 LTS linux-gcp 5.4.0-1033.35 —
Ubuntu 20.04 LTS linux-gke +28 No fix yet —
Ubuntu 20.04 LTS linux-kvm 5.4.0-1031.32 —
Ubuntu 20.04 LTS linux-oracle 5.4.0-1034.36 —
Ubuntu 20.04 LTS linux-raspi 5.4.0-1026.29 —
Ubuntu 18.04 LTS linux 4.15.0-135.139 —
Ubuntu 18.04 LTS linux-aws 4.15.0-1093.99 —
Ubuntu 18.04 LTS linux-aws-5.4 5.4.0-1034.35~18.04.1 —
Ubuntu 18.04 LTS linux-azure-4.15 4.15.0-1106.118 —
Ubuntu 18.04 LTS linux-azure-5.4 5.4.0-1035.36~18.04.1 —
Ubuntu 18.04 LTS linux-gcp +14 No fix yet —
Ubuntu 18.04 LTS linux-gcp-4.15 4.15.0-1092.105 —
Ubuntu 18.04 LTS linux-gcp-5.4 5.4.0-1033.35~18.04.1 —
Ubuntu 18.04 LTS linux-hwe-5.4 5.4.0-59.65~18.04.1 —
Ubuntu 18.04 LTS linux-kvm 4.15.0-1084.86 —
Ubuntu 18.04 LTS linux-oracle 4.15.0-1064.71 —
Ubuntu 18.04 LTS linux-oracle-5.4 5.4.0-1034.36~18.04.1 —
Ubuntu 18.04 LTS linux-raspi-5.4 5.4.0-1026.29~18.04.1 —
Ubuntu 16.04 LTS linux 4.4.0-198.230 —
Ubuntu 16.04 LTS linux-aws 4.4.0-1119.133 —
Ubuntu 16.04 LTS linux-aws-hwe 4.15.0-1093.99~16.04.1 —
Ubuntu 16.04 LTS linux-azure 4.15.0-1106.118~16.04.1 —
Ubuntu 16.04 LTS linux-gcp 4.15.0-1092.105~16.04.1 —
Ubuntu 16.04 LTS linux-hwe 4.15.0-133.137~16.04.1 —
Ubuntu 16.04 LTS linux-hwe-edge No fix yet —
Ubuntu 16.04 LTS linux-kvm 4.4.0-1085.94 —
Ubuntu 16.04 LTS linux-oracle 4.15.0-1064.71~16.04.1 —
Show 7 more (older releases, extended support, other products)
ReleasePackageFixed inAdvisory
Ubuntu Pro FIPS 20.04 LTS linux-aws-fips +2 No fix yet —
Ubuntu Pro FIPS 18.04 LTS linux-fips +3 No fix yet —
Ubuntu Pro FIPS 16.04 LTS linux-fips No fix yet —
Ubuntu Pro FIPS-updates 20.04 LTS linux-aws-fips 5.4.0-1069.73+fips2 —
Ubuntu Pro FIPS-updates 20.04 LTS linux-azure-fips 5.4.0-1073.76+fips1 —
Ubuntu Pro FIPS-updates 20.04 LTS linux-gcp-fips 5.4.0-1067.71~20.04.1 —
Ubuntu Pro FIPS-updates 18.04 LTS linux-aws-fips 4.15.0-2036.38 —
Ubuntu Pro FIPS-updates 18.04 LTS linux-azure-fips 4.15.0-2018.21 —
Ubuntu Pro FIPS-updates 18.04 LTS linux-fips 4.15.0-1052.60 —
Ubuntu Pro FIPS-updates 16.04 LTS linux-fips 4.4.0-1052.58 —
Ubuntu Pro 14.04 LTS linux No fix yet —
Ubuntu Pro 14.04 LTS linux-aws 4.4.0-1083.87 —
Ubuntu Pro 14.04 LTS linux-azure 4.15.0-1106.118~14.04.1 —
Ubuntu Pro 14.04 LTS linux-lts-xenial 4.4.0-198.230~14.04.1 —
ReleasePackageFixed inAdvisory
SLES 15 SP3 kernel-64kb +7 5.3.18-150300.59.204.1 SUSE-SU-2025:01633-1
SLES 15 SP3 kernel-default-base 5.3.18-150300.59.204.1.150300.18.122.1 SUSE-SU-2025:01633-1
SLES 12 SP5 kernel-syms +2 4.12.14-122.258.1 SUSE-SU-2025:01600-1
Show 7 more (older releases, extended support, other products)
ReleasePackageFixed inAdvisory
SLES for SAP 15 SP3 kernel-default-base 5.3.18-150300.59.204.1.150300.18.122.1 SUSE-SU-2025:01633-1
SLES for SAP 15 SP3 kernel-docs +5 5.3.18-150300.59.204.1 SUSE-SU-2025:01633-1
SLE Micro 5.2 kernel-default 5.3.18-150300.59.204.1 SUSE-SU-2025:01633-1
SLE Micro 5.2 kernel-default-base 5.3.18-150300.59.204.1.150300.18.122.1 SUSE-SU-2025:01633-1
SLE Micro 5.2 kernel-rt +1 5.3.18-150300.208.1 SUSE-SU-2025:1574-1
SLE Micro 5.1 kernel-default 5.3.18-150300.59.204.1 SUSE-SU-2025:01633-1
SLE Micro 5.1 kernel-default-base 5.3.18-150300.59.204.1.150300.18.122.1 SUSE-SU-2025:01633-1
SLE Micro 5.1 kernel-rt +1 5.3.18-150300.208.1 SUSE-SU-2025:1574-1
SLE Live Patching 15 SP3 kernel-default 5.3.18-150300.59.204.1 SUSE-SU-2025:01633-1
SLE Live Patching 15 SP3 kernel-livepatch-SLE15-SP3_Update_57 1-150300.7.3.1 SUSE-SU-2025:01633-1
SLE Live Patching 12 SP5 kernel-default 4.12.14-122.258.1 SUSE-SU-2025:01600-1
SLE Live Patching 12 SP5 kgraft-patch-SLE12-SP5_Update_68 1-8.3.1 SUSE-SU-2025:01600-1
SLE HPC 15 SP3 kernel-64kb +6 5.3.18-150300.59.204.1 SUSE-SU-2025:01633-1
SLE HPC 15 SP3 kernel-default-base 5.3.18-150300.59.204.1.150300.18.122.1 SUSE-SU-2025:01633-1
SUSE Enterprise Storage 7.1 kernel-64kb +6 5.3.18-150300.59.204.1 SUSE-SU-2025:01633-1
SUSE Enterprise Storage 7.1 kernel-default-base 5.3.18-150300.59.204.1.150300.18.122.1 SUSE-SU-2025:01633-1

Advisories 4

References