# CVE-2021-46929: sctp: use call\_rcu to free endpoint

> Archived entry. Full-text search covers entries since 2026-11-10; exact IDs work for all years.

- **Severity:** HIGH 7.8
- **CVSS:** 7.8 (v3.1, CNA) `CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H`
- **CVSS metrics:** Attack vector: Local; Attack complexity: Low; Privileges required: Low; User interaction: None; Scope: Unchanged; Confidentiality impact: High; Integrity impact: High; Availability impact: High
- **Exploited in the wild:** Not in CISA KEV
- **Public exploit / PoC:** None known
- **Remote exploitation:** Not remotely exploitable (local or adjacent access needed)
- **EPSS:** 0.26% (percentile 11, 2026-11-26)
- **CWE:** CWE-416
- **Published:** 2024-02-27T09:43:58.047Z
- **Modified:** 2026-08-05T08:45:08.476Z

## Who should check

- Anyone running Linux \>= d25adbeb0cdb860fb39e09cdd025e9cfc954c5ab, \< 8873140f95d4977bf37e4cf0d5c5e3f6e34cdd3e; \>= d25adbeb0cdb860fb39e09cdd025e9cfc954c5ab, \< af6e6e58f7ebf86b4e7201694b1e4f3a62cbc3ec; \>= d25adbeb0cdb860fb39e09cdd025e9cfc954c5ab, \< 831de271452b87657fcf8d715ee20519b79caef5; \>= d25adbeb0cdb860fb39e09cdd025e9cfc954c5ab, \< 769d14abd35e0e153b5149c3e1e989a9d719e3ff; \>= d25adbeb0cdb860fb39e09cdd025e9cfc954c5ab, \< 75799e71df1da11394740b43ae5686646179561d; \>= d25adbeb0cdb860fb39e09cdd025e9cfc954c5ab, \< 5ec7d18d1813a5bead0b495045606c93873aecbb
- Anyone running Linux 4.14

## Description

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

sctp: use call\_rcu to free endpoint

This patch is to delay the endpoint free by calling call\_rcu() to fix
another use-after-free issue in sctp\_sock\_dump():

  BUG: KASAN: use-after-free in \_\_lock\_acquire+0x36d9/0x4c20
  Call Trace:
    \_\_lock\_acquire+0x36d9/0x4c20 kernel/locking/lockdep.c:3218
    lock\_acquire+0x1ed/0x520 kernel/locking/lockdep.c:3844
    \_\_raw\_spin\_lock\_bh include/linux/spinlock\_api\_smp.h:135 \[inline\]
    \_raw\_spin\_lock\_bh+0x31/0x40 kernel/locking/spinlock.c:168
    spin\_lock\_bh include/linux/spinlock.h:334 \[inline\]
    \_\_lock\_sock+0x203/0x350 net/core/sock.c:2253
    lock\_sock\_nested+0xfe/0x120 net/core/sock.c:2774
    lock\_sock include/net/sock.h:1492 \[inline\]
    sctp\_sock\_dump+0x122/0xb20 net/sctp/diag.c:324
    sctp\_for\_each\_transport+0x2b5/0x370 net/sctp/socket.c:5091
    sctp\_diag\_dump+0x3ac/0x660 net/sctp/diag.c:527
    \_\_inet\_diag\_dump+0xa8/0x140 net/ipv4/inet\_diag.c:1049
    inet\_diag\_dump+0x9b/0x110 net/ipv4/inet\_diag.c:1065
    netlink\_dump+0x606/0x1080 net/netlink/af\_netlink.c:2244
    \_\_netlink\_dump\_start+0x59a/0x7c0 net/netlink/af\_netlink.c:2352
    netlink\_dump\_start include/linux/netlink.h:216 \[inline\]
    inet\_diag\_handler\_cmd+0x2ce/0x3f0 net/ipv4/inet\_diag.c:1170
    \_\_sock\_diag\_cmd net/core/sock\_diag.c:232 \[inline\]
    sock\_diag\_rcv\_msg+0x31d/0x410 net/core/sock\_diag.c:263
    netlink\_rcv\_skb+0x172/0x440 net/netlink/af\_netlink.c:2477
    sock\_diag\_rcv+0x2a/0x40 net/core/sock\_diag.c:274

This issue occurs when asoc is peeled off and the old sk is freed after
getting it by asoc-\>base.sk and before calling lock\_sock(sk).

To prevent the sk free, as a holder of the sk, ep should be alive when
calling lock\_sock(). This patch uses call\_rcu() and moves sock\_put and
ep free into sctp\_endpoint\_destroy\_rcu(), so that it's safe to try to
hold the ep under rcu\_read\_lock in sctp\_transport\_traverse\_process().

If sctp\_endpoint\_hold() returns true, it means this ep is still alive
and we have held it and can continue to dump it; If it returns false,
it means this ep is dead and can be freed after rcu\_read\_unlock, and
we should skip it.

In sctp\_sock\_dump(), after locking the sk, if this ep is different from
tsp-\>asoc-\>ep, it means during this dumping, this asoc was peeled off
before calling lock\_sock(), and the sk should be skipped; If this ep is
the same with tsp-\>asoc-\>ep, it means no peeloff happens on this asoc,
and due to lock\_sock, no peeloff will happen either until release\_sock.

Note that delaying endpoint free won't delay the port release, as the
port release happens in sctp\_endpoint\_destroy() before calling call\_rcu().
Also, freeing endpoint by call\_rcu() makes it safe to access the sk by
asoc-\>base.sk in sctp\_assocs\_seq\_show() and sctp\_rcv().

Thanks Jones to bring this issue up.

v1-\>v2:
  - improve the changelog.
  - add kfree(ep) into sctp\_endpoint\_destroy\_rcu(), as Jakub noticed.

## Affected and fixed versions

- Linux: \>= d25adbeb0cdb860fb39e09cdd025e9cfc954c5ab, \< 8873140f95d4977bf37e4cf0d5c5e3f6e34cdd3e; \>= d25adbeb0cdb860fb39e09cdd025e9cfc954c5ab, \< af6e6e58f7ebf86b4e7201694b1e4f3a62cbc3ec; \>= d25adbeb0cdb860fb39e09cdd025e9cfc954c5ab, \< 831de271452b87657fcf8d715ee20519b79caef5; \>= d25adbeb0cdb860fb39e09cdd025e9cfc954c5ab, \< 769d14abd35e0e153b5149c3e1e989a9d719e3ff; \>= d25adbeb0cdb860fb39e09cdd025e9cfc954c5ab, \< 75799e71df1da11394740b43ae5686646179561d; \>= d25adbeb0cdb860fb39e09cdd025e9cfc954c5ab, \< 5ec7d18d1813a5bead0b495045606c93873aecbb (cvelist)
- Linux: 4.14 (cvelist)

## Mitigation

- Upgrade Linux to 5ec7d18d1813a5bead0b495045606c93873aecbb or later.

## Check your systems with an agent

Paste this into a coding agent:

```text
Check whether anything I run is affected by CVE-2021-46929. Work read-only: do not install, upgrade, delete or change anything.

Details: https://flawdb.com/CVE-2021-46929.md
Affected: Linux >= d25adbeb0cdb860fb39e09cdd025e9cfc954c5ab, < 8873140f95d4977bf37e4cf0d5c5e3f6e34cdd3e; >= d25adbeb0cdb860fb39e09cdd025e9cfc954c5ab, < af6e6e58f7ebf86b4e7201694b1e4f3a62cbc3ec; >= d25adbeb0cdb860fb39e09cdd025e9cfc954c5ab, < 831de271452b87657fcf8d715ee20519b79caef5; >= d25adbeb0cdb860fb39e09c…
Fixed in: Linux 8873140f95d4977bf37e4cf0d5c5e3f6e34cdd3e, Linux 831de271452b87657fcf8d715ee20519b79caef5, Linux 769d14abd35e0e153b5149c3e1e989a9d719e3ff, Linux 75799e71df1da11394740b43ae5686646179561d, Linux 5ec7d18d1813a5bead0b495045606c93873aecbb

Steps:
1. Search this machine and project for Linux: dependency manifests and lockfiles, installed packages, container images and running services.
2. For each match, note the installed version and whether it is inside the affected range.
3. Report a table: location, installed version, affected (yes / no / unsure), evidence. If affected, say which fixed version or mitigation from the details link applies, but don't apply it.
```

## FAQ

### Is CVE-2021-46929 being exploited?

There is no confirmed exploitation: CVE-2021-46929 is not in the CISA Known Exploited Vulnerabilities catalog. No public exploit code is known. EPSS estimates a 0.26% chance of exploitation in the next 30 days (as of 2026-11-26).

### How serious is CVE-2021-46929?

High: CVSS 7.8 (v3.1, scored by CNA). Not remotely exploitable (local or adjacent access needed).

### Which versions are affected by CVE-2021-46929?

Linux \>= d25adbeb0cdb860fb39e09cdd025e9cfc954c5ab, \< 8873140f95d4977bf37e4cf0d5c5e3f6e34cdd3e; \>= d25adbeb0cdb860fb39e09cdd025e9cfc954c5ab, \< af6e6e58f7ebf86b4e7201694b1e4f3a62cbc3ec; \>= d25adbeb0cdb860fb39e09cdd025e9cfc954c5ab, \< 831de271452b87657fcf8d715ee20519b79caef5; \>= d25adbeb0cdb860fb39e09cdd025e9cfc954c5ab, \< 769d14abd35e0e153b5149c3e1e989a9d719e3ff; \>= d25adbeb0cdb860fb39e09cdd025e9cfc954c5ab, \< 75799e71df1da11394740b43ae5686646179561d; \>= d25adbeb0cdb860fb39e09cdd025e9cfc954c5ab, \< 5ec7d18d1813a5bead0b495045606c93873aecbb; Linux 4.14.

### Is there a fix for CVE-2021-46929?

Yes. Fixed in Linux 8873140f95d4977bf37e4cf0d5c5e3f6e34cdd3e, Linux 831de271452b87657fcf8d715ee20519b79caef5, Linux 769d14abd35e0e153b5149c3e1e989a9d719e3ff, Linux 75799e71df1da11394740b43ae5686646179561d, Linux 5ec7d18d1813a5bead0b495045606c93873aecbb. Upgrade Linux to 5ec7d18d1813a5bead0b495045606c93873aecbb or later.

### How do I check if I'm affected by CVE-2021-46929?

Find where you use the affected software (dependency lockfiles, installed packages, container images, servers) and compare the installed version with the affected range above. The agent prompt on this page does this read-only.

## References

- patch: <https://git.kernel.org/stable/c/8873140f95d4977bf37e4cf0d5c5e3f6e34cdd3e>
- patch: <https://git.kernel.org/stable/c/af6e6e58f7ebf86b4e7201694b1e4f3a62cbc3ec>
- patch: <https://git.kernel.org/stable/c/831de271452b87657fcf8d715ee20519b79caef5>
- patch: <https://git.kernel.org/stable/c/769d14abd35e0e153b5149c3e1e989a9d719e3ff>
- patch: <https://git.kernel.org/stable/c/75799e71df1da11394740b43ae5686646179561d>
- patch: <https://git.kernel.org/stable/c/5ec7d18d1813a5bead0b495045606c93873aecbb>

## Attribution

- CVE Program: CVE® is a registered trademark of The MITRE Corporation. CVE records © 1999–2026 The MITRE Corporation. <https://www.cve.org/Legal/TermsOfUse>
- NVD: This product uses data from the NVD API but is not endorsed or certified by the NVD. <https://nvd.nist.gov/vuln/detail/CVE-2021-46929>

HTML: <https://flawdb.com/CVE-2021-46929> · JSON: <https://flawdb.com/api/v1/entries/CVE-2021-46929>
