CVE-2026-68420: xfrm: reject optional IPTFS templates in outbound policies
In the Linux kernel, the following vulnerability has been resolved:
xfrm: reject optional IPTFS templates in outbound policies
syzbot reported a stack-out-of-bounds read in xfrmstatefind() which flows from xfrmtmplresolveone().
Commit 3d776e31c841 ("xfrm: Reject optional tunnel/BEET mode templates in outbound policies") disallowed optional tunnel and BEET in outbound policies to prevent this. Later when IPTFS added, it was not covered by that fix and can still trigger the out-of-bounds read;
Extend the check to disallow optional IPTFS in outbound policies as well. IPTFS should be identical to tunnel mode. IN and FWD policies are not affected: xfrmtmplresolveone() is only reachable via the outbound path.
Reproducer, before:
ip link add dummy0 type dummy ip link set dummy0 up ip addr add 10.1.1.1/24 dev dummy0 ip xfrm policy add src 10.1.1.1/32 dst 10.1.1.2/32 dir out tmpl src fc00::dead:1 dst fc00::dead:2 proto esp reqid 1 mode iptfs level use tmpl src fc00::dead:1 dst fc00::dead:2 proto esp reqid 2 mode transport ping -W 1 -c 1 10.1.1.2 PING 10.1.1.2 (10.1.1.2) 56(84) bytes of data.
[ 64.168420] ================================================================== [ 64.169977] BUG: KASAN: stack-out-of-bounds in xfrm6addrhash+0x11e/0x170 [ 64.169977] Read of size 4 at addr ffff88800e1ffd20 by task ping/2844
[ 64.169977] CPU: 2 UID: 0 PID: 2844 Comm: ping Not tainted 7.1.0-rc7-00180-geb23b588430a #98 PREEMPT(full) [ 64.169977] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.16.3-debian-1.16.3-2 04/01/2014 [ 64.169977] Call Trace: [ 64.169977] <TASK> [ 64.169977] dumpstacklvl+0x47/0x70 [ 64.169977] ? xfrm6addrhash+0x11e/0x170 [ 64.169977] printreport+0x152/0x4b0 [ 64.169977] ? ksysmmappgoff+0x6d/0xa0 [ 64.169977] ? entrySYSCALL64afterhwframe+0x76/0x7e [ 64.169977] ? rcureadunlocksched+0xa/0x20 [ 64.169977] ? virtaddrvalid+0x21b/0x230 [ 64.169977] ? xfrm6addrhash+0x11e/0x170 [ 64.169977] kasanreport+0xa8/0xd0 [ 64.169977] ? xfrm6addrhash+0x11e/0x170 [ 64.169977] xfrm6addrhash+0x11e/0x170 [ 64.169977] xfrmdsthash+0x24/0xc0 [ 64.169977] xfrmstatefind+0xa2d/0x2f90 [ 64.169977] ? pfxxfrmstatefind+0x10/0x10 [ 64.169977] ? pfxftracegraphretaddr+0x10/0x10 [ 64.169977] ? pfxftracegraphretaddr+0x10/0x10 [ 64.169977] xfrmtmplresolveone+0x210/0x570 [ 64.169977] ? pfxxfrmtmplresolveone+0x10/0x10 [ 64.169977] ? pfxstacktraceconsumeentry+0x10/0x10 [ 64.169977] ? kerneltextaddress+0x5b/0x80 [ 64.169977] ? kerneltextaddress+0xe/0x30 [ 64.169977] ? unwindgetreturnaddress+0x5e/0x90 [ 64.169977] ? archstackwalk+0x8c/0xe0 [ 64.169977] xfrmtmplresolve+0x130/0x200 [ 64.169977] ? pfxxfrmtmplresolve+0x10/0x10 [ 64.169977] ? pfxxfrmpolicyinexactlookuprcu+0x10/0x10 [ 64.169977] ? refcountaddnotzero.constprop.0+0xb2/0x110 [ 64.169977] ? pfxrefcountaddnotzero.constprop.0+0x10/0x10 [ 64.169977] xfrmresolveandcreatebundle+0xd5/0x310 [ 64.169977] ? pfxxfrmresolveandcreatebundle+0x10/0x10 [ 64.169977] ? pfxxfrmpolicylookupbytype+0x10/0x10 [ 64.169977] ? pfxxfrmpolicylookupbytype+0x10/0x10 [ 64.169977] xfrmlookupwithifid+0x3d8/0xb80 [ 64.169977] ? pfxxfrmlookupwithifid+0x10/0x10 [ 64.169977] ? iprouteoutputkeyhash+0xc6/0x110 [ 64.169977] ? kasansavetrack+0x10/0x30 [ 64.169977] xfrmlookuproute+0x18/0xe0 [ 64.169977] ip4datagramreleasecb+0x4c9/0x530 [ 64.169977] ? pfxip4datagramreleasecb+0x10/0x10 [ 64.169977] ? dorawspinlock+0x71/0xc0 [ 64.169977] ? pfxdorawspinlock+0x10/0x10 [ 64.169977] releasesock+0xb0/0x170 [ 64.169977] udpconnect+0x43/0x50 [ 64.169977] sysconnect+0xa6/0x100 [ 64.169977] ? allocfd+0x2e9/0x300 [ 64.169977] ? pfxsysconnect+0x10/0x10 [ 64.169977] ? preemptlatency ---truncated---
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Configuration
Update the xfrm outbound policy behavior to reject optional IPTFS templates (commit 3d776e31c841: "xfrm: Reject optional tunnel/BEET mode" / "Extend the check to disallow optional IPTFS in outbound policies").
Linux kernel xfrm (IPTFS templates in outbound policies) outbound policy templates for optional IPTFS (IPTFS mode) = disallow optional IPTFS templates
Event History
Frequently Asked Questions
What is the severity of CVE-2026-68420?
The severity of CVE-2026-68420 is rated at 53.
How do I fix CVE-2026-68420?
To fix CVE-2026-68420, update the Linux kernel to the latest version that addresses this vulnerability.
What systems are affected by CVE-2026-68420?
CVE-2026-68420 affects the Linux kernel.
What kind of vulnerability is CVE-2026-68420?
CVE-2026-68420 is a stack-out-of-bounds read vulnerability in the xfrm subsystem.
Who reported the CVE-2026-68420 vulnerability?
The CVE-2026-68420 vulnerability was reported by syzbot.