CVE-2025-21720: xfrm: delete intermediate secpath entry in packet offload mode

Published Feb 27, 2025
·
Updated

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

xfrm: delete intermediate secpath entry in packet offload mode

Packets handled by hardware have added secpath as a way to inform XFRM core code that this path was already handled. That secpath is not needed at all after policy is checked and it is removed later in the stack.

However, in the case of IP forwarding is enabled (/proc/sys/net/ipv4/ipforward), that secpath is not removed and packets which already were handled are reentered to the driver TX path with xfrmoffload set.

The following kernel panic is observed in mlx5 in such case:

mlx5core 0000:04:00.0 enp4s0f0np0: Link up mlx5core 0000:04:00.1 enp4s0f1np1: Link up Initializing XFRM netlink socket IPsec XFRM device driver BUG: kernel NULL pointer dereference, address: 0000000000000000 #PF: supervisor instruction fetch in kernel mode #PF: errorcode(0x0010) - not-present page PGD 0 P4D 0 Oops: Oops: 0010 [#1] PREEMPT SMP CPU: 0 UID: 0 PID: 0 Comm: swapper/0 Not tainted 6.13.0-rc1-alex #3 Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.13.0-1ubuntu1.1 04/01/2014 RIP: 0010:0x0 Code: Unable to access opcode bytes at 0xffffffffffffffd6. RSP: 0018:ffffb87380003800 EFLAGS: 00010206 RAX: ffff8df004e02600 RBX: ffffb873800038d8 RCX: 00000000ffff98cf RDX: ffff8df00733e108 RSI: ffff8df00521fb80 RDI: ffff8df001661f00 RBP: ffffb87380003850 R08: ffff8df013980000 R09: 0000000000000010 R10: 0000000000000002 R11: 0000000000000002 R12: ffff8df001661f00 R13: ffff8df00521fb80 R14: ffff8df00733e108 R15: ffff8df011faf04e FS: 0000000000000000(0000) GS:ffff8df46b800000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: ffffffffffffffd6 CR3: 0000000106384000 CR4: 0000000000350ef0 Call Trace: <IRQ> ? showregs+0x63/0x70 ? diebody+0x20/0x60 ? die+0x2b/0x40 ? pagefaultoops+0x15c/0x550 ? douseraddrfault+0x3ed/0x870 ? excpagefault+0x7f/0x190 ? asmexcpagefault+0x27/0x30 mlx5eipsechandletxskb+0xe7/0x2f0 [mlx5core] mlx5exmit+0x58e/0x1980 [mlx5core] ? fiblookup+0x6a/0xb0 devhardstartxmit+0x82/0x1d0 schdirectxmit+0xfe/0x390 devqueuexmit+0x6d8/0xee0 ? fiblookup+0x6a/0xb0 ? internaladdtimer+0x48/0x70 ? modtimer+0xe2/0x2b0 neighresolveoutput+0x115/0x1b0 neighupdate+0x26a/0xc50 neighupdate+0x14/0x20 arpprocess+0x2cb/0x8e0 ? napibuildskb+0x5e/0x70 arprcv+0x11e/0x1c0 ? devgroreceive+0x574/0x820 netifreceiveskblistcore+0x1cf/0x1f0 netifreceiveskblistinternal+0x183/0x2a0 napicompletedone+0x76/0x1c0 mlx5enapipoll+0x234/0x7a0 [mlx5core] napipoll+0x2d/0x1f0 netrxaction+0x1a6/0x370 ? atomicnotifiercallchain+0x3b/0x50 ? irqinthandler+0x15/0x20 [mlx5core] handlesoftirqs+0xb9/0x2f0 ? handleirqevent+0x44/0x60 irqexitrcu+0xdb/0x100 commoninterrupt+0x98/0xc0 </IRQ> <TASK> asmcommoninterrupt+0x27/0x40 RIP: 0010:pvnativesafehalt+0xb/0x10 Code: 09 c3 66 66 2e 0f 1f 84 00 00 00 00 00 66 90 0f 22 0f 1f 84 00 00 00 00 00 90 eb 07 0f 00 2d 7f e9 36 00 fb 40 00 83 ff 07 77 21 89 ff ff 24 fd 88 3d a1 bd 0f 21 f8 RSP: 0018:ffffffffbe603de8 EFLAGS: 00000202 RAX: 0000000000000000 RBX: 0000000000000000 RCX: 0000000f92f46680 RDX: 0000000000000037 RSI: 00000000ffffffff RDI: 00000000000518d4 RBP: ffffffffbe603df0 R08: 000000cd42e4dffb R09: ffffffffbe603d70 R10: 0000004d80d62680 R11: 0000000000000001 R12: ffffffffbe60bf40 R13: 0000000000000000 R14: 0000000000000000 R15: ffffffffbe60aff8 ? defaultidle+0x9/0x20 archcpuidle+0x9/0x10 defaultidlecall+0x29/0xf0 doidle+0x1f2/0x240 cpustartupentry+0x2c/0x30 restinit+0xe7/0x100 startkernel+0x76b/0xb90 x8664startreservations+0x18/0x30 x8664startkernel+0xc0/0x110 ? setupghcb+0xe/0x130 commonstartup64+0x13e/0x141 </TASK> Modules linked in: esp4offload esp4 xfrminterface xfrm6tunnel tunnel4 tunnel6 xfrmuser xfrmalgo binf ---truncated---

Affected Software

4 affected components
Linux Kernel
Linux Linux kernel>=6.2<6.6.76
Linux Linux kernel>=6.7<6.12.13
Linux Linux kernel>=6.13<6.13.2

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. Configuration

    Apply the kernel vulnerability fix described as “Initializing XFRM netlink socket” and ensure that in xfrm packet offload mode you delete intermediate secpath entries after policy is checked (so secpath is not left on packets that “already were handled” and are not later reentered into the driver TX path with xfrm_offload set).

    Linux kernel (XFRM/IPsec offload netlink/socket) secpath handling in packet offload mode = Remove/defer secpath after policy check (do not keep secpath that is “not needed” and ensure it is deleted so packets already handled are not reentered into mlx5 TX path)
  2. Compensating control

    If IPsec offload is involved (XFRM with xfrm_offload and mlx5_core), temporarily avoid enabling IP forwarding /proc/sys/net/ipv4/ip_forward while applying the kernel fix, since the issue is discussed in the context where IP forwarding is enabled and the XFRM device driver path is exercised.

Event History

Feb 27, 2025
CVE Published
via MITRE·02:07 AM
Data Sourced
via MITRE·02:07 AM
DescriptionSeverity
Data Sourced
via NVD·02:15 AM
RemedyDescriptionSeverityWeaknessAffected Software

Frequently Asked Questions

1

What is the severity of CVE-2025-21720?

CVE-2025-21720 is categorized as a medium severity vulnerability in the Linux kernel.

2

How do I fix CVE-2025-21720?

To fix CVE-2025-21720, update your Linux kernel to version 6.6.76 or higher, or from 6.7 to 6.12.13, or 6.13.2.

3

What software versions are affected by CVE-2025-21720?

CVE-2025-21720 affects Linux kernel versions between 6.2 and 6.6.76, between 6.7 and 6.12.13, and between 6.13 and 6.13.2.

4

What does CVE-2025-21720 impact?

CVE-2025-21720 impacts packet handling in the Linux kernel's XFRM core, specifically in hardware offload mode.

5

Is there a workaround for CVE-2025-21720?

No specific workaround is recommended for CVE-2025-21720, and users should apply the security updates as soon as possible.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203