Junglewise Threat Intelligence

CVE-2024-40959: Linux Kernel NULL pointer dereference in xfrm6_get_saddr

CVE-2024-40959 · Severity: medium · CVSS 5.5 · Published 2024-07-12

Technologies: Linux Kernel. Vendors: Linux.

Executive brief

A vulnerability was identified in the Linux kernel's networking component that handles secure IPv6 traffic. Under specific conditions, the system may attempt to access memory that does not exist, leading to a system crash or 'kernel panic.' This issue primarily impacts the availability of the system, potentially allowing a local user to cause a denial-of-service.

Technical details

A NULL pointer dereference vulnerability exists in the Linux kernel's IPv6 XFRM (IPsec) policy implementation. The function `xfrm6_get_saddr()` fails to validate the return value of `ip6_dst_idev()`, which can return NULL in certain network configurations or error states. When this occurs, the kernel attempts to dereference the NULL pointer to access the associated network device, resulting in a general protection fault and kernel oops. This was specifically observed during WireGuard handshake operations. The fix introduces a check to ensure `idev` is valid before use, returning `-EHOSTUNREACH` if it is NULL. Patches have been backported to multiple stable kernel versions.

Affected products

  • Linux Linux Kernel Fixed in 6.10-rc2 and backported to various stable branches

Timeline

  • 2024-06-15: patched: Initial fix authored by Eric Dumazet
  • 2024-07-12: advisory: CVE-2024-40959 published

References

Related threats