# CVE-2025-21674: net/mlx5e: Fix inversion dependency warning while enabling IPsec tunnel

> Archived entry. Full-text search covers entries since 2026-11-10; exact IDs work for all years.

- **Severity:** MEDIUM 5.5
- **CVSS:** 5.5 (v3.1, CNA) `CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H`
- **CVSS metrics:** Attack vector: Local; Attack complexity: Low; Privileges required: Low; User interaction: None; Scope: Unchanged; Confidentiality impact: None; Integrity impact: None; Availability impact: High
- **Exploited in the wild:** Not in CISA KEV
- **Public exploit / PoC:** None known
- **Remote exploitation:** Not remotely exploitable (local or adjacent access needed)
- **EPSS:** 0.22% (percentile 8, 2026-11-26)
- **CWE:** CWE-667
- **Published:** 2025-01-31T11:25:36.661Z
- **Modified:** 2026-06-17T08:43:59.427Z

## Who should check

- Anyone running Linux \>= 4c24272b4e2befca6ad1409c3c9aaa16c24b1099, \< 87c4417a902151cfe4363166245a3671a08c256c; \>= 4c24272b4e2befca6ad1409c3c9aaa16c24b1099, \< 6d3d69c070d920fbb146d73dd3899a50f25d0901; \>= 4c24272b4e2befca6ad1409c3c9aaa16c24b1099, \< 2c3688090f8a1f085230aa839cc63e4a7b977df0
- Anyone running Linux 6.4

## Description

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

net/mlx5e: Fix inversion dependency warning while enabling IPsec tunnel

Attempt to enable IPsec packet offload in tunnel mode in debug kernel
generates the following kernel panic, which is happening due to two
issues:
1. In SA add section, the should be \_bh() variant when marking SA mode.
2. There is not needed flush\_workqueue in SA delete routine. It is not
needed as at this stage as it is removed from SADB and the running work
will be canceled later in SA free.

 =====================================================
 WARNING: SOFTIRQ-safe -\> SOFTIRQ-unsafe lock order detected
 6.12.0+ \#4 Not tainted
 -----------------------------------------------------
 charon/1337 \[HC0\[0\]:SC0\[4\]:HE1:SE0\] is trying to acquire:
 ffff88810f365020 (&xa-\>xa\_lock\#24){+.+.}-{3:3}, at: mlx5e\_xfrm\_del\_state+0xca/0x1e0 \[mlx5\_core\]

 and this task is already holding:
 ffff88813e0f0d48 (&x-\>lock){+.-.}-{3:3}, at: xfrm\_state\_delete+0x16/0x30
 which would create a new lock dependency:
  (&x-\>lock){+.-.}-{3:3} -\> (&xa-\>xa\_lock\#24){+.+.}-{3:3}

 but this new dependency connects a SOFTIRQ-irq-safe lock:
  (&x-\>lock){+.-.}-{3:3}

 ... which became SOFTIRQ-irq-safe at:
   lock\_acquire+0x1be/0x520
   \_raw\_spin\_lock\_bh+0x34/0x40
   xfrm\_timer\_handler+0x91/0xd70
   \_\_hrtimer\_run\_queues+0x1dd/0xa60
   hrtimer\_run\_softirq+0x146/0x2e0
   handle\_softirqs+0x266/0x860
   irq\_exit\_rcu+0x115/0x1a0
   sysvec\_apic\_timer\_interrupt+0x6e/0x90
   asm\_sysvec\_apic\_timer\_interrupt+0x16/0x20
   default\_idle+0x13/0x20
   default\_idle\_call+0x67/0xa0
   do\_idle+0x2da/0x320
   cpu\_startup\_entry+0x50/0x60
   start\_secondary+0x213/0x2a0
   common\_startup\_64+0x129/0x138

 to a SOFTIRQ-irq-unsafe lock:
  (&xa-\>xa\_lock\#24){+.+.}-{3:3}

 ... which became SOFTIRQ-irq-unsafe at:
 ...
   lock\_acquire+0x1be/0x520
   \_raw\_spin\_lock+0x2c/0x40
   xa\_set\_mark+0x70/0x110
   mlx5e\_xfrm\_add\_state+0xe48/0x2290 \[mlx5\_core\]
   xfrm\_dev\_state\_add+0x3bb/0xd70
   xfrm\_add\_sa+0x2451/0x4a90
   xfrm\_user\_rcv\_msg+0x493/0x880
   netlink\_rcv\_skb+0x12e/0x380
   xfrm\_netlink\_rcv+0x6d/0x90
   netlink\_unicast+0x42f/0x740
   netlink\_sendmsg+0x745/0xbe0
   \_\_sock\_sendmsg+0xc5/0x190
   \_\_sys\_sendto+0x1fe/0x2c0
   \_\_x64\_sys\_sendto+0xdc/0x1b0
   do\_syscall\_64+0x6d/0x140
   entry\_SYSCALL\_64\_after\_hwframe+0x4b/0x53

 other info that might help us debug this:

  Possible interrupt unsafe locking scenario:

        CPU0                    CPU1
        ----                    ----
   lock(&xa-\>xa\_lock\#24);
                                local\_irq\_disable();
                                lock(&x-\>lock);
                                lock(&xa-\>xa\_lock\#24);
   \<Interrupt\>
     lock(&x-\>lock);

  \*\*\* DEADLOCK \*\*\*

 2 locks held by charon/1337:
  \#0: ffffffff87f8f858 (&net-\>xfrm.xfrm\_cfg\_mutex){+.+.}-{4:4}, at: xfrm\_netlink\_rcv+0x5e/0x90
  \#1: ffff88813e0f0d48 (&x-\>lock){+.-.}-{3:3}, at: xfrm\_state\_delete+0x16/0x30

 the dependencies between SOFTIRQ-irq-safe lock and the holding lock:
 -\> (&x-\>lock){+.-.}-{3:3} ops: 29 {
    HARDIRQ-ON-W at:
                     lock\_acquire+0x1be/0x520
                     \_raw\_spin\_lock\_bh+0x34/0x40
                     xfrm\_alloc\_spi+0xc0/0xe60
                     xfrm\_alloc\_userspi+0x5f6/0xbc0
                     xfrm\_user\_rcv\_msg+0x493/0x880
                     netlink\_rcv\_skb+0x12e/0x380
                     xfrm\_netlink\_rcv+0x6d/0x90
                     netlink\_unicast+0x42f/0x740
                     netlink\_sendmsg+0x745/0xbe0
                     \_\_sock\_sendmsg+0xc5/0x190
                     \_\_sys\_sendto+0x1fe/0x2c0
                     \_\_x64\_sys\_sendto+0xdc/0x1b0
                     do\_syscall\_64+0x6d/0x140
                     entry\_SYSCALL\_64\_after\_hwframe+0x4b/0x53
    IN-SOFTIRQ-W at:
                     lock\_acquire+0x1be/0x520
                     \_raw\_spin\_lock\_bh+0x34/0x40
                     xfrm\_timer\_handler+0x91/0xd70
                     \_\_hrtimer\_run\_queues+0x1dd/0xa60
   
---truncated---

## Affected and fixed versions

- Linux: \>= 4c24272b4e2befca6ad1409c3c9aaa16c24b1099, \< 87c4417a902151cfe4363166245a3671a08c256c; \>= 4c24272b4e2befca6ad1409c3c9aaa16c24b1099, \< 6d3d69c070d920fbb146d73dd3899a50f25d0901; \>= 4c24272b4e2befca6ad1409c3c9aaa16c24b1099, \< 2c3688090f8a1f085230aa839cc63e4a7b977df0 (cvelist)
- Linux: 6.4 (cvelist)

## Mitigation

- Upgrade Linux to 2c3688090f8a1f085230aa839cc63e4a7b977df0 or later.

## Check your systems with an agent

Paste this into a coding agent:

```text
Check whether anything I run is affected by CVE-2025-21674. Work read-only: do not install, upgrade, delete or change anything.

Details: https://flawdb.com/CVE-2025-21674.md
Affected: Linux >= 4c24272b4e2befca6ad1409c3c9aaa16c24b1099, < 87c4417a902151cfe4363166245a3671a08c256c; >= 4c24272b4e2befca6ad1409c3c9aaa16c24b1099, < 6d3d69c070d920fbb146d73dd3899a50f25d0901; >= 4c24272b4e2befca6ad1409c3c9aaa16c24b1099, < 2c3688090f8a1f085230aa839cc63e4a7b977df0; Linux 6.4
Fixed in: Linux 87c4417a902151cfe4363166245a3671a08c256c, Linux 6d3d69c070d920fbb146d73dd3899a50f25d0901, Linux 2c3688090f8a1f085230aa839cc63e4a7b977df0

Steps:
1. Search this machine and project for Linux: dependency manifests and lockfiles, installed packages, container images and running services.
2. For each match, note the installed version and whether it is inside the affected range.
3. Report a table: location, installed version, affected (yes / no / unsure), evidence. If affected, say which fixed version or mitigation from the details link applies, but don't apply it.
```

## FAQ

### Is CVE-2025-21674 being exploited?

There is no confirmed exploitation: CVE-2025-21674 is not in the CISA Known Exploited Vulnerabilities catalog. No public exploit code is known. EPSS estimates a 0.22% chance of exploitation in the next 30 days (as of 2026-11-26).

### How serious is CVE-2025-21674?

Medium: CVSS 5.5 (v3.1, scored by CNA). Not remotely exploitable (local or adjacent access needed).

### Which versions are affected by CVE-2025-21674?

Linux \>= 4c24272b4e2befca6ad1409c3c9aaa16c24b1099, \< 87c4417a902151cfe4363166245a3671a08c256c; \>= 4c24272b4e2befca6ad1409c3c9aaa16c24b1099, \< 6d3d69c070d920fbb146d73dd3899a50f25d0901; \>= 4c24272b4e2befca6ad1409c3c9aaa16c24b1099, \< 2c3688090f8a1f085230aa839cc63e4a7b977df0; Linux 6.4.

### Is there a fix for CVE-2025-21674?

Yes. Fixed in Linux 87c4417a902151cfe4363166245a3671a08c256c, Linux 6d3d69c070d920fbb146d73dd3899a50f25d0901, Linux 2c3688090f8a1f085230aa839cc63e4a7b977df0. Upgrade Linux to 2c3688090f8a1f085230aa839cc63e4a7b977df0 or later.

### How do I check if I'm affected by CVE-2025-21674?

Find where you use the affected software (dependency lockfiles, installed packages, container images, servers) and compare the installed version with the affected range above. The agent prompt on this page does this read-only.

## References

- patch: <https://git.kernel.org/stable/c/87c4417a902151cfe4363166245a3671a08c256c>
- patch: <https://git.kernel.org/stable/c/6d3d69c070d920fbb146d73dd3899a50f25d0901>
- patch: <https://git.kernel.org/stable/c/2c3688090f8a1f085230aa839cc63e4a7b977df0>

## Attribution

- CVE Program: CVE® is a registered trademark of The MITRE Corporation. CVE records © 1999–2026 The MITRE Corporation. <https://www.cve.org/Legal/TermsOfUse>
- NVD: This product uses data from the NVD API but is not endorsed or certified by the NVD. <https://nvd.nist.gov/vuln/detail/CVE-2025-21674>

HTML: <https://flawdb.com/CVE-2025-21674> · JSON: <https://flawdb.com/api/v1/entries/CVE-2025-21674>
