# CVE-2024-42265: protect the fetch of ->fd[fd] in do_dup2() from mispredictions

- Severity: Medium 5.5 (CVSS:3.1, scored by NVD) `CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/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.28%, higher than 22% of CVEs (2026-12-01)
- Published: 2024-08-17T08:54:21.636Z
- Modified: 2026-10-15T01:18:44.810Z
- SSVC (CISA-ADP): exploitation none, automatable no, technical impact partial
- Assigned by: Linux

## Description

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

protect the fetch of ->fd[fd] in do_dup2() from mispredictions

both callers have verified that fd is not greater than ->max_fds;
however, misprediction might end up with
        tofree = fdt->fd[fd];
being speculatively executed.  That's wrong for the same reasons
why it's wrong in close_fd()/file_close_fd_locked(); the same
solution applies - array_index_nospec(fd, fdt->max_fds) could differ
from fd only in case of speculative execution on mispredicted path.

(As written by CVE List.)

## Affected

- Linux Linux: from 8280d16172243702ed43432f826ca6130edb4086 before ed42e8ff509d2a61c6642d1825032072dab79f26; from 8280d16172243702ed43432f826ca6130edb4086 before 41a6c31df77bd8e050136b0a200b537da9e1084a; from 8280d16172243702ed43432f826ca6130edb4086 before 08775b3d6ed117cf4518754ec7300ee42b6a5368; from 8280d16172243702ed43432f826ca6130edb4086 before 3f480493550b6a23d3a65d095d6569d4a7f56a0f; from 8280d16172243702ed43432f826ca6130edb4086 before 5db999fff545b924b24c9afd368ef5c17279b176; from 8280d16172243702ed43432f826ca6130edb4086 before da72e783afd27d9f487836b2e6738146c0edd149; from 8280d16172243702ed43432f826ca6130edb4086 before 1171ceccabfd596ca370c5d2cbb47d110c3f2fe1; from 8280d16172243702ed43432f826ca6130edb4086 before 8aa37bde1a7b645816cda8b80df4753ecf172bf1; 3.7 (not affected: before 3.7; from 4.19.320 up to 4.19.*; from 5.4.282 up to 5.4.*; from 5.10.224 up to 5.10.*; from 5.15.165 up to 5.15.*; from 6.1.104 up to 6.1.*; from 6.6.45 up to 6.6.*; from 6.10.4 up to 6.10.*; from 6.11 up to *)
- linux linux_kernel: before 4.19.320; from 4.20 before 5.4.282; from 5.5 before 5.10.224; from 5.11 before 5.15.165; from 5.16 before 6.1.104; from 6.2 before 6.6.45; from 6.7 before 6.10.4; 6.11

## References

- <https://git.kernel.org/stable/c/ed42e8ff509d2a61c6642d1825032072dab79f26> (patch)
- <https://git.kernel.org/stable/c/41a6c31df77bd8e050136b0a200b537da9e1084a> (patch)
- <https://git.kernel.org/stable/c/08775b3d6ed117cf4518754ec7300ee42b6a5368> (patch)
- <https://git.kernel.org/stable/c/3f480493550b6a23d3a65d095d6569d4a7f56a0f> (patch)
- <https://git.kernel.org/stable/c/5db999fff545b924b24c9afd368ef5c17279b176> (patch)
- <https://git.kernel.org/stable/c/da72e783afd27d9f487836b2e6738146c0edd149> (patch)
- <https://git.kernel.org/stable/c/1171ceccabfd596ca370c5d2cbb47d110c3f2fe1> (patch)
- <https://git.kernel.org/stable/c/8aa37bde1a7b645816cda8b80df4753ecf172bf1> (patch)
- <https://lists.debian.org/debian-lts-announce/2025/01/msg00001.html>
- <https://lists.debian.org/debian-lts-announce/2024/10/msg00003.html>
- <https://cert-portal.siemens.com/productcert/html/ssa-265688.html>

## Sources

- CVE List: [CVE-2024-42265](https://www.cve.org/CVERecord?id=CVE-2024-42265), CVE Terms of Use, modified 2026-10-15
- NVD: [CVE-2024-42265](https://nvd.nist.gov/vuln/detail/CVE-2024-42265), Public domain, modified 2026-10-15

---

Page: https://cve.day/CVE-2024-42265 · Whole record: https://cve.day/CVE-2024-42265.json · Rebuilt by cve.day 2026-11-25T22:58:44.455Z
