CVE-2024-57982: xfrm: state: fix out-of-bounds read during lookup
In the Linux kernel, the following vulnerability has been resolved:
xfrm: state: fix out-of-bounds read during lookup
lookup and resize can run in parallel.
The xfrm_state_hash_generation seqlock ensures a retry, but the hash
functions can observe a hmask value that is too large for the new hlist
array.
rehash does:
rcu_assign_pointer(net->xfrm.state_bydst, ndst) [..]
net->xfrm.state_hmask = nhashmask;
While state lookup does:
h = xfrm_dst_hash(net, daddr, saddr, tmpl->reqid, encap_family);
hlist_for_each_entry_rcu(x, net->xfrm.state_bydst + h, bydst) {
This is only safe in case the update to state_bydst is larger than
net->xfrm.xfrm_state_hmask (or if the lookup function gets
serialized via state spinlock again).
Fix this by prefetching state_hmask and the associated pointers.
The xfrm_state_hash_generation seqlock retry will ensure that the pointer
and the hmask will be consistent.
The existing helpers, like xfrm_dst_hash(), are now unsafe for RCU side,
add lockdep assertions to document that they are only safe for insert
side.
xfrm_state_lookup_byaddr() uses the spinlock rather than RCU.
AFAICS this is an oversight from back when state lookup was converted to
RCU, this lock should be replaced with RCU in a future patch.
Security readout for executives and security teams
Plain-English summary
CVE-2024-57982 is a Linux kernel flaw in the xfrm networking subsystem. A local low-privileged user could potentially trigger an out-of-bounds read during concurrent state lookup and resize, risking sensitive memory exposure or a crash. The CVE record does not indicate active exploitation.
Executive priority
Treat this as high priority for Linux fleets where untrusted local users or workloads exist. It is not described as remotely exploitable, but kernel memory exposure and crash risk justify prompt, controlled patching.
Technical view
The bug is a CWE-125 out-of-bounds read in xfrm state lookup. A race between lookup and rehash resize can let lookup use a hash mask inconsistent with the current state_bydst array. The fix prefetches state_hmask and related pointers so seqlock retry validates a consistent pair.
Likely exposure
Exposure is most relevant to Linux systems running affected kernel versions or downstream builds that have not incorporated the referenced stable fixes. The CVSS vector requires local access with low privileges and no user interaction.
Exploitation context
The CVE source reports local attack vector, low complexity, low privileges, high confidentiality impact, and high availability impact. KEV status is false in the supplied data, so active exploitation is not supported by the provided evidence.
Researcher notes
Evidence is limited to the CVE description, CVSS data, KEV flag, and kernel stable references. The source does not provide exploit details, affected distribution packages, or confirmed in-the-wild activity.
Mitigation direction
Update Linux kernels through trusted vendor or distribution channels.
Confirm the update includes one of the referenced stable kernel fixes.
Prioritize shared, multi-user, container, and workload-hosting Linux systems.
Limit untrusted local user or workload access until patched.
Monitor vendor advisories for distro-specific fixed package versions.
Validation and detection
Inventory Linux kernel versions and package build identifiers across assets.
Compare installed kernels against vendor advisories and the CVE record.
Check kernel changelogs for the referenced xfrm stable fix commits.
Use authenticated vulnerability scanning where available.
Validate patched systems boot into the updated kernel, not only install it.
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.
cwe · low confidence lookup
CWE-125: Exact CWE lookup
Use the exact CWE identifier as the starting point before reviewing related ATT&CK behavior. Open the exact CWE lookup page first, then review the ATT&CK searches from that MITRE weakness context. This is a Glexia lookup hint, not an official ATT&CK mapping.
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.
CWE links open Glexia weakness intelligence pages with official CWE context, developer remediation guidance, and related CVE mappings.
CWE-125 · source CWE mapping
Out-of-bounds Read
Out-of-bounds Read represents a recurring weakness pattern that can create exploitable paths when design, validation, or implementation controls are missing.