Skip to contentSkip to conversation

CVE-2026-31664: xfrm: clear trailing padding in build_polexpire()

DISCUSSION Greg Kroah-Hartman 1 participant 1 message Apr 24

lore
Share & tools
lore
#0 lore raw

From: Greg Kroah-Hartman <[email protected]>

Description
===========

In the Linux kernel, the following vulnerability has been resolved:

xfrm: clear trailing padding in build_polexpire()

build_expire() clears the trailing padding bytes of struct xfrm_user_expire after setting the hard field via memset_after(), but the analogous function build_polexpire() does not do this for struct xfrm_user_polexpire.

The padding bytes after the __u8 hard field are left uninitialized from the heap allocation, and are then sent to userspace via netlink multicast to XFRMNLGRP_EXPIRE listeners, leaking kernel heap memory contents.

Add the missing memset_after() call, matching build_expire().

The Linux kernel CVE team has assigned CVE-2026-31664 to this issue.

Affected and fixed versions
===========================

	Issue introduced in 2.6.12 with commit 1da177e4c3f41524e886b7f1b8a0c1fc7321cac2 and fixed in 6.1.169 with commit ac6985903db047eaff54db929e4bf6b06782788e
	Issue introduced in 2.6.12 with commit 1da177e4c3f41524e886b7f1b8a0c1fc7321cac2 and fixed in 6.6.135 with commit c221ed63a2769a0af8bd849dfe25740048f34ef4
	Issue introduced in 2.6.12 with commit 1da177e4c3f41524e886b7f1b8a0c1fc7321cac2 and fixed in 6.12.82 with commit eda30846ea54f8ed218468e5480c8305ca645e37
	Issue introduced in 2.6.12 with commit 1da177e4c3f41524e886b7f1b8a0c1fc7321cac2 and fixed in 6.18.23 with commit b1dfd6b27df35ef4f87825aa5f607378d23ff0f2
	Issue introduced in 2.6.12 with commit 1da177e4c3f41524e886b7f1b8a0c1fc7321cac2 and fixed in 6.19.13 with commit e1af65c669ebb1666c54576614c01a7f9ffcfff6
	Issue introduced in 2.6.12 with commit 1da177e4c3f41524e886b7f1b8a0c1fc7321cac2 and fixed in 7.0 with commit 71a98248c63c535eaa4d4c22f099b68d902006d0

Please see https://www.kernel.org for a full list of currently supported kernel versions by the kernel community.

Unaffected versions might change over time as fixes are backported to older supported kernel versions. The official CVE entry at

	https://cve.org/CVERecord/?id=CVE-2026-31664

will be updated if fixes are backported, please check that for the most up to date information about this issue.

Affected files
==============

The file(s) affected by this issue are:
net/xfrm/xfrm_user.c

Mitigation
==========

The Linux kernel CVE team recommends that you update to the latest stable kernel version for this, and many other bugfixes. Individual changes are never tested alone, but rather are part of a larger kernel release. Cherry-picking individual commits is not recommended or supported by the Linux kernel community at all. If however, updating to the latest release is impossible, the individual changes to resolve this issue can be found at these commits:

	https://git.kernel.org/stable/c/ac6985903db047eaff54db929e4bf6b06782788e
	https://git.kernel.org/stable/c/c221ed63a2769a0af8bd849dfe25740048f34ef4
	https://git.kernel.org/stable/c/eda30846ea54f8ed218468e5480c8305ca645e37
	https://git.kernel.org/stable/c/b1dfd6b27df35ef4f87825aa5f607378d23ff0f2
	https://git.kernel.org/stable/c/e1af65c669ebb1666c54576614c01a7f9ffcfff6
	https://git.kernel.org/stable/c/71a98248c63c535eaa4d4c22f099b68d902006d0