CVE-2024-57982

Updated: 2025-03-25 01:42:18.213571

Description:

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.


Links NIST CIRCL RHEL Ubuntu

Severity

Severity Score
CVSS Version 2.x 0
CVSS Version 3.x HIGH 7.1000000000000005

Status

OS name Project name Version Score Severity Status Errata Last updated

Statement

AlmaLinux 9.2 ESU kernel 5.14.0 7.1 HIGH In Progress 2025-05-10 05:06:03
CentOS 8.4 ELS kernel 4.18.0 7.1 HIGH Needs Triage 2025-03-07 23:37:16
CentOS 8.5 ELS kernel 4.18.0 7.1 HIGH Needs Triage 2025-03-07 23:37:15
CentOS Stream 8 ELS kernel 4.18.0 7.1 HIGH Needs Triage 2025-03-07 23:37:18
Ubuntu 16.04 ELS linux-hwe 4.15.0 7.1 HIGH In Progress 2025-04-06 03:46:26
Ubuntu 18.04 ELS linux 4.15.0 7.1 HIGH In Progress 2025-04-06 03:46:23