CVE-2024-41012: filelock: Remove locks reliably when fcntl/close race is detected
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().
Security readout for executives and security teams
Plain-English summary
A local Linux user may trigger a file-locking race that leaves stale lock state referencing freed memory. Reading /proc/locks afterward can expose kernel memory. This could disclose sensitive information, but the supplied technical description says the flaw cannot corrupt kernel memory.
Executive priority
Treat as an expedited patching issue on shared, multi-user, or multi-tenant Linux systems. Other systems can follow risk-based kernel maintenance after confirming vendor status. There is no supplied evidence of active exploitation, but potential kernel-memory disclosure warrants timely remediation.
Technical view
A race between fcntl_setlk() and close() may create a POSIX lock that later cannot be removed because an LSM denies removal or memory allocation fails. Subsequent lock_get_status() access through /proc/locks causes use-after-free reads. The fix uses locks_remove_posix() to remove locks reliably.
Likely exposure
Exposure is limited to Linux systems running affected or unpatched vendor kernels where a user has local, low-privileged access. Multi-user and multi-tenant hosts deserve particular attention. Distribution backports mean version strings alone may not establish vulnerability.
Exploitation context
The supplied CVSS vector describes local, low-complexity exploitation requiring low privileges and no user interaction. The source suggests arbitrary kernel-memory disclosure is likely, but provides no evidence of memory corruption. This CVE is not listed as KEV in the supplied bundle, and no active exploitation is cited.
Researcher notes
The key failure is unreliable cleanup after a fcntl_setlk()/close() race. Cleanup may fail through differing LSM decisions or allocation failure during lock-range splitting. The resulting dangling lock is read through /proc/locks. The supplied description supports disclosure, not kernel-memory modification; the CVSS integrity and availability impacts are therefore not technically explained by the narrative.
Mitigation direction
Apply vendor kernel updates incorporating the cited stable fixes.
Consult distribution security guidance because patched package versions may differ from upstream versions.
Prioritize shared systems allowing untrusted or low-privileged local users.
Reduce unnecessary local account access until affected kernels are updated.
Validation and detection
Inventory running kernel versions across Linux hosts.
Check vendor advisories and package changelogs for CVE-2024-41012 or the cited fixes.
Confirm updated kernels are running after maintenance.
Do not rely solely on upstream version numbers when distributions use backported patches.
Generated from the cited source records. This long-tail analysis has not been individually reviewed by a named human.
Potential ATT&CK relevance
Conservative CVE-to-ATT&CK context
These mappings and lookup hints may be relevant to the vulnerability behavior, CWE, affected product, or exposure path. Glexia-inferred context is not an official MITRE, ATT&CK, CWE, or CVE Program mapping.
ATT&CK lookup starting points
Use these exact CWE pages and searches to review the Glexia ATT&CK library from this CVE's weakness and description context.
cve · low confidence lookup
CVE-2024-41012 mapping review
Open the CVE-to-ATT&CK bridge for reviewed, inferred, or future official mappings tied to this CVE.
These fields come from the CVE record and ADP containers, not from Glexia's Take. They preserve time-varying source decisions such as CISA SSVC, KEV status, CVSS metrics, and provider references.
We collect every scored CVSS vector available in the official CNA and ADP containers. When more than one version is present, the table keeps the source vectors side by side instead of collapsing them into the highest score.