# CVE-2024-41012: filelock: Remove locks reliably when fcntl/close race is detected

- Priority: **Routine**
- Reason: Not severe (CVSS 7.8, local access); no exploitation reported by the 5 checked sources
- Next step: Fix in the normal cadence
- Status: published
- Published: 2024-07-23 · Modified: 2026-08-05
- Aliases: UBUNTU-CVE-2024-41012, DEBIAN-CVE-2024-41012
- Record: https://cvemate.com/vulnerability/CVE-2024-41012 · JSON: https://cvemate.com/vulnerability/CVE-2024-41012/json

## Description

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

filelock: Remove locks reliably when fcntl/close race is detected

When fcntl_setlk() races with close(), it removes the created lock with
do_lock_file_wait().
However, LSMs can allow the first do_lock_file_wait() that created the lock
while denying the second do_lock_file_wait() that tries to remove the lock.
Separately, posix_lock_file() could also fail to
remove a lock due to GFP_KERNEL allocation failure (when splitting a range
in the middle).

After the bug has been triggered, use-after-free reads will occur in
lock_get_status() when userspace reads /proc/locks. This can likely be used
to read arbitrary kernel memory, but can't corrupt kernel memory.

Fix it by calling locks_remove_posix() instead, which is designed to
reliably get rid of POSIX locks associated with the given file and
files_struct and is also used by filp_flush().
```

## Signals

- CVSS: 7.8 high (v3.1, CVE.org) CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H
- EPSS: 0.23%, percentile 14.757%, as of 2026-12-04
- Known exploited (KEV): CISA not listed, ENISA not listed, CIRCL not listed
- Ransomware use: none recorded
- Public exploits: 0

## Affected (first 20 of 134)

- debian linux (Debian): \< 6.1.106-1 \| \< 6.9.9-1
- ubuntu linux (Ubuntu): All versions (No fix recorded) \| \< 4.4.0-263.297 \| \< 4.15.0-233.245 \| \< 5.4.0-200.220 \| \< 5.15.0-125.135 \| \< 6.8.0-48.48
- ubuntu linux-allwinner-5.19 (Ubuntu): All versions (No fix recorded)
- ubuntu linux-aws (Ubuntu): \< 4.4.0-1140.146 \| \< 4.4.0-1178.193 \| \< 4.15.0-1177.190 \| \< 5.4.0-1135.145 \| \< 5.15.0-1072.78 \| \< 6.8.0-1018.20
- ubuntu linux-aws-5.0 (Ubuntu): All versions (No fix recorded)
- ubuntu linux-aws-5.11 (Ubuntu): All versions (No fix recorded)
- ubuntu linux-aws-5.13 (Ubuntu): All versions (No fix recorded)
- ubuntu linux-aws-5.15 (Ubuntu): \< 5.15.0-1072.78~20.04.1
- ubuntu linux-aws-5.19 (Ubuntu): All versions (No fix recorded)
- ubuntu linux-aws-5.3 (Ubuntu): All versions (No fix recorded)
- ubuntu linux-aws-5.4 (Ubuntu): \< 5.4.0-1135.145~18.04.1
- ubuntu linux-aws-5.8 (Ubuntu): All versions (No fix recorded)
- ubuntu linux-aws-6.2 (Ubuntu): All versions (No fix recorded)
- ubuntu linux-aws-6.5 (Ubuntu): All versions (No fix recorded)
- ubuntu linux-aws-6.8 (Ubuntu): \< 6.8.0-1018.19~22.04.1
- ubuntu linux-aws-fips (Ubuntu): \< 4.15.0-2115.121 \| All versions (No fix recorded) \| \< 5.4.0-1135.145+fips1 \| \< 5.15.0-1072.78+fips1
- ubuntu linux-aws-hwe (Ubuntu): \< 4.15.0-1177.190~16.04.1
- ubuntu linux-azure (Ubuntu): \< 4.15.0-1185.200~14.04.1 \| \< 4.15.0-1185.200~16.04.1 \| All versions (No fix recorded) \| \< 5.4.0-1140.147 \| \< 5.15.0-1075.84 \| \< 6.8.0-1017.20
- ubuntu linux-azure-4.15 (Ubuntu): \< 4.15.0-1185.200
- ubuntu linux-azure-5.11 (Ubuntu): All versions (No fix recorded)

## References (first 20 of 39)

- <https://git.kernel.org/stable/c/d30ff33040834c3b9eee29740acd92f9c7ba2250>
- <https://git.kernel.org/stable/c/dc2ce1dfceaa0767211a9d963ddb029ab21c4235>
- <https://git.kernel.org/stable/c/5661b9c7ec189406c2dde00837aaa4672efb6240>
- <https://git.kernel.org/stable/c/52c87ab18c76c14d7209646ccb3283b3f5d87b22>
- <https://git.kernel.org/stable/c/ef8fc41cd6f95f9a4a3470f085aecf350569a0b3>
- <https://git.kernel.org/stable/c/5f5d0799eb0a01d550c21b7894e26b2d9db55763>
- <https://git.kernel.org/stable/c/b6d223942c34057fdfd8f149e763fa823731b224>
- <https://git.kernel.org/stable/c/3cad1bc010416c6dd780643476bc59ed742436b9>
- <https://lists.debian.org/debian-lts-announce/2025/01/msg00001.html>
- <https://ubuntu.com/security/CVE-2024-41012>
- <https://www.cve.org/CVERecord?id=CVE-2024-41012>
- <https://git.kernel.org/linus/3cad1bc010416c6dd780643476bc59ed742436b9>
- <https://ubuntu.com/security/notices/USN-7088-1>
- <https://ubuntu.com/security/notices/USN-7089-1>
- <https://ubuntu.com/security/notices/USN-7090-1>
- <https://ubuntu.com/security/notices/USN-7088-2>
- <https://ubuntu.com/security/notices/USN-7089-2>
- <https://ubuntu.com/security/notices/USN-7088-3>
- <https://ubuntu.com/security/notices/USN-7089-3>
- <https://ubuntu.com/security/notices/USN-7095-1>

---

Data as of 2026-12-05T03:52:31.070Z. The priority label is CveMate's own model from public evidence, not an official rating, and it knows nothing about your assets. How labels are decided: https://cvemate.com/faq#priority
