# CVE-2024-40938: landlock: Fix d_parent walk

- 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.25%, higher than 17% of CVEs (2026-12-01)
- Published: 2024-07-12T12:25:14.463Z
- Modified: 2026-06-17T07:46:54.663Z
- SSVC (CISA-ADP): exploitation none, automatable no, technical impact partial
- Assigned by: Linux

## Description

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

landlock: Fix d_parent walk

The WARN_ON_ONCE() in collect_domain_accesses() can be triggered when
trying to link a root mount point.  This cannot work in practice because
this directory is mounted, but the VFS check is done after the call to
security_path_link().

Do not use source directory's d_parent when the source directory is the
mount point.

[mic: Fix commit message]

(As written by CVE List.)

## Affected

- Linux Linux: from b91c3e4ea756b12b7d992529226edce1cfd854d7 before b6e5e696435832b33e40775f060ef5c95f4fda1f; from b91c3e4ea756b12b7d992529226edce1cfd854d7 before cc30d05b34f9a087a6928d09b131f7b491e9ab11; from b91c3e4ea756b12b7d992529226edce1cfd854d7 before c7618c7b0b8c45bcef34410cc1d1e953eb17f8f6; from b91c3e4ea756b12b7d992529226edce1cfd854d7 before 88da52ccd66e65f2e63a6c35c9dff55d448ef4dc; 5.19 (not affected: before 5.19; from 6.1.95 up to 6.1.*; from 6.6.35 up to 6.6.*; from 6.9.6 up to 6.9.*; from 6.10 up to *)
- linux linux_kernel: from 5.19 before 6.1.95; from 6.2 before 6.6.35; from 6.7 before 6.9.6; 6.10

## References

- <https://git.kernel.org/stable/c/b6e5e696435832b33e40775f060ef5c95f4fda1f> (patch)
- <https://git.kernel.org/stable/c/cc30d05b34f9a087a6928d09b131f7b491e9ab11> (patch)
- <https://git.kernel.org/stable/c/c7618c7b0b8c45bcef34410cc1d1e953eb17f8f6> (patch)
- <https://git.kernel.org/stable/c/88da52ccd66e65f2e63a6c35c9dff55d448ef4dc> (patch)
- <https://lists.debian.org/debian-lts-announce/2025/01/msg00001.html>

## Sources

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

---

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