# CVE-2025-21652: ipvlan: Fix use-after-free in ipvlan\_get\_iflink().

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

- **Severity:** HIGH 7.8
- **CVSS:** 7.8 (v3.1, CNA) `CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H`
- **CVSS metrics:** Attack vector: Local; Attack complexity: Low; Privileges required: Low; User interaction: None; Scope: Unchanged; Confidentiality impact: High; Integrity impact: High; 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.31% (percentile 16, 2026-11-26)
- **CWE:** CWE-416
- **Published:** 2025-01-19T10:18:09.570Z
- **Modified:** 2026-08-05T11:53:23.653Z

## Who should check

- Anyone running Linux \>= 8c55facecd7ade835287298ce325f930d888d8ec, \< ba9f7c16ec879c83bb4f80406773a911aace8267; \>= 8c55facecd7ade835287298ce325f930d888d8ec, \< 52a24538d569f48e79d1a169a5d359d384152950; \>= 8c55facecd7ade835287298ce325f930d888d8ec, \< cb358ff94154774d031159b018adf45e17673941
- Anyone running Linux 6.2

## Description

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

ipvlan: Fix use-after-free in ipvlan\_get\_iflink().

syzbot presented an use-after-free report \[0\] regarding ipvlan and
linkwatch.

ipvlan does not hold a refcnt of the lower device unlike vlan and
macvlan.

If the linkwatch work is triggered for the ipvlan dev, the lower dev
might have already been freed, resulting in UAF of ipvlan-\>phy\_dev in
ipvlan\_get\_iflink().

We can delay the lower dev unregistration like vlan and macvlan by
holding the lower dev's refcnt in dev-\>netdev\_ops-\>ndo\_init() and
releasing it in dev-\>priv\_destructor().

Jakub pointed out calling .ndo\_XXX after unregister\_netdevice() has
returned is error prone and suggested \[1\] addressing this UAF in the
core by taking commit 750e51603395 ("net: avoid potential UAF in
default\_operstate()") further.

Let's assume unregistering devices DOWN and use RCU protection in
default\_operstate() not to race with the device unregistration.

\[0\]:
BUG: KASAN: slab-use-after-free in ipvlan\_get\_iflink+0x84/0x88 drivers/net/ipvlan/ipvlan\_main.c:353
Read of size 4 at addr ffff0000d768c0e0 by task kworker/u8:35/6944

CPU: 0 UID: 0 PID: 6944 Comm: kworker/u8:35 Not tainted 6.13.0-rc2-g9bc5c9515b48 \#12 4c3cb9e8b4565456f6a355f312ff91f4f29b3c47
Hardware name: linux,dummy-virt (DT)
Workqueue: events\_unbound linkwatch\_event
Call trace:
 show\_stack+0x38/0x50 arch/arm64/kernel/stacktrace.c:484 (C)
 \_\_dump\_stack lib/dump\_stack.c:94 \[inline\]
 dump\_stack\_lvl+0xbc/0x108 lib/dump\_stack.c:120
 print\_address\_description mm/kasan/report.c:378 \[inline\]
 print\_report+0x16c/0x6f0 mm/kasan/report.c:489
 kasan\_report+0xc0/0x120 mm/kasan/report.c:602
 \_\_asan\_report\_load4\_noabort+0x20/0x30 mm/kasan/report\_generic.c:380
 ipvlan\_get\_iflink+0x84/0x88 drivers/net/ipvlan/ipvlan\_main.c:353
 dev\_get\_iflink+0x7c/0xd8 net/core/dev.c:674
 default\_operstate net/core/link\_watch.c:45 \[inline\]
 rfc2863\_policy+0x144/0x360 net/core/link\_watch.c:72
 linkwatch\_do\_dev+0x60/0x228 net/core/link\_watch.c:175
 \_\_linkwatch\_run\_queue+0x2f4/0x5b8 net/core/link\_watch.c:239
 linkwatch\_event+0x64/0xa8 net/core/link\_watch.c:282
 process\_one\_work+0x700/0x1398 kernel/workqueue.c:3229
 process\_scheduled\_works kernel/workqueue.c:3310 \[inline\]
 worker\_thread+0x8c4/0xe10 kernel/workqueue.c:3391
 kthread+0x2b0/0x360 kernel/kthread.c:389
 ret\_from\_fork+0x10/0x20 arch/arm64/kernel/entry.S:862

Allocated by task 9303:
 kasan\_save\_stack mm/kasan/common.c:47 \[inline\]
 kasan\_save\_track+0x30/0x68 mm/kasan/common.c:68
 kasan\_save\_alloc\_info+0x44/0x58 mm/kasan/generic.c:568
 poison\_kmalloc\_redzone mm/kasan/common.c:377 \[inline\]
 \_\_kasan\_kmalloc+0x84/0xa0 mm/kasan/common.c:394
 kasan\_kmalloc include/linux/kasan.h:260 \[inline\]
 \_\_do\_kmalloc\_node mm/slub.c:4283 \[inline\]
 \_\_kmalloc\_node\_noprof+0x2a0/0x560 mm/slub.c:4289
 \_\_kvmalloc\_node\_noprof+0x9c/0x230 mm/util.c:650
 alloc\_netdev\_mqs+0xb4/0x1118 net/core/dev.c:11209
 rtnl\_create\_link+0x2b8/0xb60 net/core/rtnetlink.c:3595
 rtnl\_newlink\_create+0x19c/0x868 net/core/rtnetlink.c:3771
 \_\_rtnl\_newlink net/core/rtnetlink.c:3896 \[inline\]
 rtnl\_newlink+0x122c/0x15c0 net/core/rtnetlink.c:4011
 rtnetlink\_rcv\_msg+0x61c/0x918 net/core/rtnetlink.c:6901
 netlink\_rcv\_skb+0x1dc/0x398 net/netlink/af\_netlink.c:2542
 rtnetlink\_rcv+0x34/0x50 net/core/rtnetlink.c:6928
 netlink\_unicast\_kernel net/netlink/af\_netlink.c:1321 \[inline\]
 netlink\_unicast+0x618/0x838 net/netlink/af\_netlink.c:1347
 netlink\_sendmsg+0x5fc/0x8b0 net/netlink/af\_netlink.c:1891
 sock\_sendmsg\_nosec net/socket.c:711 \[inline\]
 \_\_sock\_sendmsg net/socket.c:726 \[inline\]
 \_\_sys\_sendto+0x2ec/0x438 net/socket.c:2197
 \_\_do\_sys\_sendto net/socket.c:2204 \[inline\]
 \_\_se\_sys\_sendto net/socket.c:2200 \[inline\]
 \_\_arm64\_sys\_sendto+0xe4/0x110 net/socket.c:2200
 \_\_invoke\_syscall arch/arm64/kernel/syscall.c:35 \[inline\]
 invoke\_syscall+0x90/0x278 arch/arm64/kernel/syscall.c:49
 el0\_svc\_common+0x13c/0x250 arch/arm64/kernel/syscall.c:132
 do\_el0\_svc+0x54/0x70 arch/arm64/kernel/syscall.c:151
 el
---truncated---

## Affected and fixed versions

- Linux: \>= 8c55facecd7ade835287298ce325f930d888d8ec, \< ba9f7c16ec879c83bb4f80406773a911aace8267; \>= 8c55facecd7ade835287298ce325f930d888d8ec, \< 52a24538d569f48e79d1a169a5d359d384152950; \>= 8c55facecd7ade835287298ce325f930d888d8ec, \< cb358ff94154774d031159b018adf45e17673941 (cvelist)
- Linux: 6.2 (cvelist)

## Mitigation

- No fix listed yet: follow the vendor advisory.

## Check your systems with an agent

Paste this into a coding agent:

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

Details: https://flawdb.com/CVE-2025-21652.md
Affected: Linux >= 8c55facecd7ade835287298ce325f930d888d8ec, < ba9f7c16ec879c83bb4f80406773a911aace8267; >= 8c55facecd7ade835287298ce325f930d888d8ec, < 52a24538d569f48e79d1a169a5d359d384152950; >= 8c55facecd7ade835287298ce325f930d888d8ec, < cb358ff94154774d031159b018adf45e17673941; Linux 6.2
Fixed in: Linux 52a24538d569f48e79d1a169a5d359d384152950

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-21652 being exploited?

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

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

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

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

Linux \>= 8c55facecd7ade835287298ce325f930d888d8ec, \< ba9f7c16ec879c83bb4f80406773a911aace8267; \>= 8c55facecd7ade835287298ce325f930d888d8ec, \< 52a24538d569f48e79d1a169a5d359d384152950; \>= 8c55facecd7ade835287298ce325f930d888d8ec, \< cb358ff94154774d031159b018adf45e17673941; Linux 6.2.

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

Yes. Fixed in Linux 52a24538d569f48e79d1a169a5d359d384152950. No fix listed yet: follow the vendor advisory.

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

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/ba9f7c16ec879c83bb4f80406773a911aace8267>
- patch: <https://git.kernel.org/stable/c/52a24538d569f48e79d1a169a5d359d384152950>
- patch: <https://git.kernel.org/stable/c/cb358ff94154774d031159b018adf45e17673941>

## 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-21652>

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