# CVE-2021-47496: net/tls: Fix flipped sign in tls_err_abort() calls

- Severity: Critical 9.8 (CVSS:3.1, scored by Linux) `CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H`
- Known to be exploited: not in CISA's catalogue, which lists only what CISA has confirmed
- Likelihood of exploitation in the next 30 days (EPSS): 0.48%, higher than 43% of CVEs (2026-12-01)
- Published: 2024-05-22T08:19:43.489Z
- Modified: 2026-08-05T08:48:05.957Z
- Weaknesses: CWE-787
- SSVC (CISA-ADP): exploitation none, automatable no, technical impact partial
- Assigned by: Linux

## Description

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

net/tls: Fix flipped sign in tls_err_abort() calls

sk->sk_err appears to expect a positive value, a convention that ktls
doesn't always follow and that leads to memory corruption in other code.
For instance,

    [kworker]
    tls_encrypt_done(..., err=<negative error from crypto request>)
      tls_err_abort(.., err)
        sk->sk_err = err;

    [task]
    splice_from_pipe_feed
      ...
        tls_sw_do_sendpage
          if (sk->sk_err) {
            ret = -sk->sk_err;  // ret is positive

    splice_from_pipe_feed (continued)
      ret = actor(...)  // ret is still positive and interpreted as bytes
                        // written, resulting in underflow of buf->len and
                        // sd->len, leading to huge buf->offset and bogus
                        // addresses computed in later calls to actor()

Fix all tls_err_abort() callers to pass a negative error code
consistently and centralize the error-prone sign flip there, throwing in
a warning to catch future misuse and uninlining the function so it
really does only warn once.

(As written by CVE List.)

## Affected

- Linux Linux: from c46234ebb4d1eee5e09819f49169e51cfc6eb909 before e0cfd5159f314d6b304d030363650b06a2299cbb; from c46234ebb4d1eee5e09819f49169e51cfc6eb909 before f3dec7e7ace38224f82cf83f0049159d067c2e19; from c46234ebb4d1eee5e09819f49169e51cfc6eb909 before e41473543f75f7dbc5d605007e6f883f1bd13b9a; from c46234ebb4d1eee5e09819f49169e51cfc6eb909 before da353fac65fede6b8b4cfe207f0d9408e3121105; 4.17 (not affected: before 4.17; from 5.4.157 up to 5.4.*; from 5.10.77 up to 5.10.*; from 5.14.16 up to 5.14.*; from 5.15 up to *)
- linux linux_kernel: from 4.17 before 5.4.157; from 5.5 before 5.10.77; from 5.11 before 5.14.16; 5.15

## Every score

- Linux: CVSS:3.1 9.8 Critical `CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H`
- NVD: CVSS:3.1 7.8 High `CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H`

## References

- <https://git.kernel.org/stable/c/e0cfd5159f314d6b304d030363650b06a2299cbb> (patch)
- <https://git.kernel.org/stable/c/f3dec7e7ace38224f82cf83f0049159d067c2e19> (patch)
- <https://git.kernel.org/stable/c/e41473543f75f7dbc5d605007e6f883f1bd13b9a> (patch)
- <https://git.kernel.org/stable/c/da353fac65fede6b8b4cfe207f0d9408e3121105> (patch)

## Sources

- CVE List: [CVE-2021-47496](https://www.cve.org/CVERecord?id=CVE-2021-47496), CVE Terms of Use, modified 2026-08-05
- NVD: [CVE-2021-47496](https://nvd.nist.gov/vuln/detail/CVE-2021-47496), Public domain, modified 2026-08-04

---

Page: https://cve.day/CVE-2021-47496 · Whole record: https://cve.day/CVE-2021-47496.json · Rebuilt by cve.day 2026-11-25T22:58:08.885Z
