CVE-2024-57982

Updated: 2025-12-01 01:34:46.609336

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.0
CVSS Version 3.x HIGH 7.1

Status

OS name Project name Version Score Severity Status Errata Last updated

Statement

AlmaLinux 9.2 ESU kernel 5.14.0 7.1 HIGH Released CLSA-2025:1751916475 2025-07-08 00:23:13
CentOS 8.4 ELS kernel 4.18.0 7.1 HIGH Released CLSA-2025:1753297988 2025-07-24 01:57:29
CentOS 8.5 ELS kernel 4.18.0 7.1 HIGH Released CLSA-2025:1753298320 2025-07-24 01:57:29
CentOS Stream 8 ELS kernel 4.18.0 7.1 HIGH Released CLSA-2025:1757961506 2025-09-16 01:41:21
Oracle Linux 7 ELS kernel-uek 5.4.17 7.1 HIGH Needs Triage 2025-09-15 21:38:17
Ubuntu 16.04 ELS linux-hwe 4.15.0 7.1 HIGH Released CLSA-2025:1753083310 2025-07-22 00:51:26
Ubuntu 18.04 ELS linux 4.15.0 7.1 HIGH Released CLSA-2025:1753083608 2025-07-22 00:51:26