Skip to content
Fencer Vulns
high 8.1

CVE-2021-47131 json

net/tls: Fix use-after-free after the TLS device goes down and up

published 2024-03-15 2 y ago modified 2026-08-05 3 mo ago also EUVD-2021-33779

cvss
8.1
version 3.1, CNA
cisa kev
Not listed
not in CISA's catalog
epss
0.8%
EPSS 0.8% chance of exploitation in 30 days, percentile 55%
public exploits
0
none known

Summary

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

net/tls: Fix use-after-free after the TLS device goes down and up

When a netdev with active TLS offload goes down, tls_device_down is called to stop the offload and tear down the TLS context. However, the socket stays alive, and it still points to the TLS context, which is now deallocated. If a netdev goes up, while the connection is still active, and the data flow resumes after a number of TCP retransmissions, it will lead to a use-after-free of the TLS context.

This commit addresses this bug by keeping the context alive until its normal destruction, and implements the necessary fallbacks, so that the connection can resume in software (non-offloaded) kTLS mode.

On the TX side tls_sw_fallback is used to encrypt all packets. The RX side already has all the necessary fallbacks, because receiving non-decrypted packets is supported. The thing needed on the RX side is to block resync requests, which are normally produced after receiving non-decrypted packets.

The necessary synchronization is implemented for a graceful teardown: first the fallbacks are deployed, then the driver resources are released (it used to be possible to have a tls_dev_resync after tls_dev_del).

A new flag called TLS_RX_DEV_DEGRADED is added to indicate the fallback mode. It's used to skip the RX resync logic completely, as it becomes useless, and some objects may be released (for example, resync_async, which is allocated and freed by the driver).

Patch / fix

  • Linux Linux 5.10.43, 5.12.10, 5.13
  • linux Debian 14, Debian 13, Debian 12 5.10.46-1

debian advisories DEBIAN-CVE-2021-47131

  • linux Ubuntu 20.04 LTS 5.4.0-190.210
  • linux-aws Ubuntu 20.04 LTS 5.4.0-1129.139
  • linux-gcp Ubuntu 20.04 LTS 5.4.0-1133.142
  • linux-ibm Ubuntu 20.04 LTS 5.4.0-1076.81
  • linux-iot Ubuntu 20.04 LTS 5.4.0-1041.42
  • linux-kvm Ubuntu 20.04 LTS 5.4.0-1117.124
  • linux-azure Ubuntu 20.04 LTS 5.4.0-1134.141
  • linux-gkeop Ubuntu 20.04 LTS 5.4.0-1096.100

ubuntu advisories UBUNTU-CVE-2021-47131

Ubuntu security data © Canonical Ltd., from https://github.com/canonical/ubuntu-security-notices via OSV; changed: normalised to fixed package versions per release. CC BY-SA 4.0

  • kernel-syms SLES for SAP 12 SP5, SLES 12 SP5 4.12.14-122.219.1
  • kernel-source SLES for SAP 12 SP5, SLES 12 SP5 4.12.14-122.219.1
  • kernel-default SLES for SAP 12 SP5, SLES 12 SP5, SLE Workstation Extension 12 SP5 +2 more 4.12.14-122.219.1
  • kernel-obs-build SLE Software Development Kit 12 SP5 4.12.14-122.219.1
  • kernel-rt SLE Real Time 12 SP5 4.12.14-10.188.1
  • kernel-syms-rt SLE Real Time 12 SP5 4.12.14-10.188.1
  • kernel-rt_debug SLE Real Time 12 SP5 4.12.14-10.188.1
  • kernel-source-rt SLE Real Time 12 SP5 4.12.14-10.188.1

suse advisories SUSE-SU-2024:2184-1SUSE-SU-2024:1983-1SUSE-SU-2024:1650-1SUSE-SU-2024:1645-1SUSE-SU-2024:1643-1SUSE-SU-2024:1642-1

Vendor advisories

What the vendors themselves say about their products: affected, fixed or not affected, and what to do.

red hat product security vex CVE-2021-47131 updated cvss 5.5

kernel: net/tls: Fix use-after-free after the TLS device goes down and up

  • Red Hat Enterprise Linux 6 perf, kernel, python-perf, kernel-kdump, kernel-firmware, kernel-bootwrapper, +1 more Red Hat Enterprise Linux 7 perf, kernel, bpftool, kernel-rt, python-perf, kernel-kdump, +8 more
    affected: no fix planned “Out of support scope”
  • Red Hat Enterprise Linux 8 perf, kernel, bpftool, kernel-rt, kernel-core, kernel-tools, +29 more Red Hat Enterprise Linux 9 rv, perf, rtla, kernel, bpftool, libperf, +83 more
    not affected: vulnerable code not present

Red Hat CSAF VEX © Red Hat, Inc., from https://security.access.redhat.com/data/csaf/v2/vex/; changed: reduced to product statuses and remediations. CC BY 4.0 · csaf

CISA SSVC

Exploitation
none
Automatable
no
Technical impact
partial
Assessed
2 y ago

Exploit prediction

0.75% chance of exploitation in the next 30 days, higher than 55% of all scored CVEs (FIRST EPSS, 2026-11-08).

CVSS scores

assigned by version score vector
CNA 3.1 8.1 CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H
NVD 3.1 7.8 CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H

Affected products

  • Linux Linux

Classification

Weakness
Technology feeds

References

Sources

Fencer Vulns keeps one entry per vulnerability: the CVE id wins, then GHSA, and records that alias each other are merged, except that two CVEs always keep separate entries. The same data is available as JSON.