CVE-2024-50182: secretmem: disable memfd_secret() if arch cannot set direct map
In the Linux kernel, the following vulnerability has been resolved:
secretmem: disable memfd_secret() if arch cannot set direct map
Return -ENOSYS from memfd_secret() syscall if !can_set_direct_map(). This
is the case for example on some arm64 configurations, where marking 4k
PTEs in the direct map not present can only be done if the direct map is
set up at 4k granularity in the first place (as ARM's break-before-make
semantics do not easily allow breaking apart large/gigantic pages).
More precisely, on arm64 systems with !can_set_direct_map(),
set_direct_map_invalid_noflush() is a no-op, however it returns success
(0) instead of an error. This means that memfd_secret will seemingly
"work" (e.g. syscall succeeds, you can mmap the fd and fault in pages),
but it does not actually achieve its goal of removing its memory from the
direct map.
Note that with this patch, memfd_secret() will start erroring on systems
where can_set_direct_map() returns false (arm64 with
CONFIG_RODATA_FULL_DEFAULT_ENABLED=n, CONFIG_DEBUG_PAGEALLOC=n and
CONFIG_KFENCE=n), but that still seems better than the current silent
failure. Since CONFIG_RODATA_FULL_DEFAULT_ENABLED defaults to 'y', most
arm64 systems actually have a working memfd_secret() and aren't be
affected.
From going through the iterations of the original memfd_secret patch
series, it seems that disabling the syscall in these scenarios was the
intended behavior [1] (preferred over having
set_direct_map_invalid_noflush return an error as that would result in
SIGBUSes at page-fault time), however the check for it got dropped between
v16 [2] and v17 [3], when secretmem moved away from CMA allocations.
[1]: https://lore.kernel.org/lkml/20201124164930.GK8537@kernel.org/
[2]: https://lore.kernel.org/lkml/20210121122723.3446-11-rppt@kernel.org/#t
[3]: https://lore.kernel.org/lkml/20201125092208.12544-10-rppt@kernel.org/
Security readout for executives and security teams
Plain-English summary
On certain arm64 Linux systems, applications can successfully create secret memory even though the kernel fails to remove that memory from its normal direct mapping. Software may therefore believe sensitive data is specially protected when it is not, creating confidentiality and integrity risk for secrets held there.
Executive priority
Treat as an expedited, targeted remediation rather than an enterprise-wide emergency. Identify arm64 systems and memfd_secret-dependent applications first, then patch confirmed exposures through supported distribution channels. Systems without the cited configuration combination are lower priority. Escalate where secret memory protects credentials, cryptographic material, or similarly sensitive data.
Technical view
When can_set_direct_map() is false, set_direct_map_invalid_noflush() performs no isolation but reports success. memfd_secret() consequently appears functional while its pages remain directly mapped. The correction makes memfd_secret() return ENOSYS on unsupported configurations. The supplied CVSS 3.1 score is 7.1, requiring local access and low privileges, with high confidentiality and integrity impact.
Likely exposure
Exposure is narrow but consequential: affected Linux kernels on arm64 where CONFIG_RODATA_FULL_DEFAULT_ENABLED, CONFIG_DEBUG_PAGEALLOC, and CONFIG_KFENCE are all disabled, particularly when workloads rely on memfd_secret(). The source says most arm64 systems are unaffected because CONFIG_RODATA_FULL_DEFAULT_ENABLED defaults to enabled. Exact distribution exposure requires vendor confirmation.
Exploitation context
The weakness requires local access and low privileges according to the supplied CVSS vector. It represents a silent security-control failure rather than proof of remote compromise. The bundle reports no CISA KEV listing and provides no evidence of active exploitation or a public exploit.
Researcher notes
The key invariant is whether secretmem pages can actually be removed from the direct map. The flaw arose because an unsupported operation returned success. Researchers should distinguish syscall success from achieved isolation and map distribution kernels to the relevant stable commits. The supplied affected-version data is insufficient to define every vendor package boundary.
Mitigation direction
Install a vendor-supported kernel containing the applicable referenced stable fix.
Prioritize affected arm64 systems running workloads that rely on memfd_secret() for sensitive data.
Consult the operating-system vendor for exact fixed package versions and reboot requirements.
Until updated, do not assume successful memfd_secret() calls provide the intended memory isolation.
Validation and detection
Inventory Linux kernel versions, architectures, and workloads using memfd_secret().
On arm64, review the three cited kernel configuration settings that determine exposure.
Confirm the installed vendor kernel incorporates the applicable referenced stable fix.
In controlled testing, verify unsupported configurations return ENOSYS instead of silently succeeding.
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-50182 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.