CVE-2025-21865

Source
https://nvd.nist.gov/vuln/detail/CVE-2025-21865
Import Source
https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2025-21865.json
JSON Data
https://api.osv.dev/v1/vulns/CVE-2025-21865
Downstream
Related
Published
2025-03-12T09:42:21Z
Modified
2025-10-22T11:16:51.534916Z
Severity
  • 5.5 (Medium) CVSS_V3 - CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H CVSS Calculator
Summary
gtp: Suppress list corruption splat in gtp_net_exit_batch_rtnl().
Details

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

gtp: Suppress list corruption splat in gtpnetexitbatchrtnl().

Brad Spengler reported the listdel() corruption splat in gtpnetexitbatch_rtnl(). [0]

Commit eb28fd76c0a0 ("gtp: Destroy device along with udp socket's netns dismantle.") added the foreachnetdev() loop in gtpnetexitbatchrtnl() to destroy devices in each netns as done in geneve and ip tunnels.

However, this could trigger ->dellink() twice for the same device during ->exitbatchrtnl().

Say we have two netns A & B and gtp device B that resides in netns B but whose UDP socket is in netns A.

  1. cleanup_net() processes netns A and then B.

  2. gtpnetexitbatchrtnl() finds the device B while iterating netns A's gn->gtpdevlist and calls ->dellink().

    [ device B is not yet unlinked from netns B as unregisternetdevicemany() has not been called. ]

  3. gtpnetexitbatchrtnl() finds the device B while iterating netns B's foreachnetdev() and calls ->dellink().

gtpdellink() cleans up the device's hash table, unlinks the dev from gn->gtpdevlist, and calls unregisternetdevice_queue().

Basically, calling gtpdellink() multiple times is fine unless CONFIGDEBUG_LIST is enabled.

Let's remove foreachnetdev() in gtpnetexitbatchrtnl() and delegate the destruction to defaultdeviceexit_batch() as done in bareudp.

kernel BUG at lib/listdebug.c:58! Oops: invalid opcode: 0000 [#1] PREEMPT SMP KASAN CPU: 1 UID: 0 PID: 1804 Comm: kworker/u8:7 Tainted: G T 6.12.13-grsec-full-20250211091339 #1 Tainted: [T]=RANDSTRUCT Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.15.0-1 04/01/2014 Workqueue: netns cleanupnet RIP: 0010:[<ffffffff84947381>] _listdelentryvalidorreport+0x141/0x200 lib/listdebug.c:58 Code: c2 76 91 31 c0 e8 9f b1 f7 fc 0f 0b 4d 89 f0 48 c7 c1 02 ff ff ff 48 89 ea 48 89 ee 48 c7 c7 e0 c2 76 91 31 c0 e8 7f b1 f7 fc <0f> 0b 4d 89 e8 48 c7 c1 04 ff ff ff 48 89 ea 48 89 ee 48 c7 c7 60 RSP: 0018:fffffe8040b4fbd0 EFLAGS: 00010283 RAX: 00000000000000cc RBX: dffffc0000000000 RCX: ffffffff818c4054 RDX: ffffffff84947381 RSI: ffffffff818d1512 RDI: 0000000000000000 RBP: ffff8880aaa62c00 R08: 0000000000000001 R09: fffffbd008169f32 R10: fffffe8040b4f997 R11: 0000000000000001 R12: a1988d84f24943e4 R13: ffffffffffffff02 R14: ffffffffffffff04 R15: ffff8880aaa62c08 RBX: kasan shadow of 0x0 RCX: _wakeupklogd.part.0+0x74/0xe0 kernel/printk/printk.c:4554 RDX: _listdelentryvalidorreport+0x141/0x200 lib/listdebug.c:58 RSI: vprintk+0x72/0x100 kernel/printk/printksafe.c:71 RBP: autoslabsizeMdevPnetcoredev11127813288S4096A64n139+0xc00/0x1000 [slab object] RSP: process kstack fffffe8040b4fbd0+0x7bd0/0x8000 [kworker/u8:7+netns 1804 ] R09: kasan shadow of process kstack fffffe8040b4f990+0x7990/0x8000 [kworker/u8:7+netns 1804 ] R10: process kstack fffffe8040b4f997+0x7997/0x8000 [kworker/u8:7+netns 1804 ] R15: autoslabsizeMdevPnetcoredev11127813288S4096A64n139+0xc08/0x1000 [slab object] FS: 0000000000000000(0000) GS:ffff888116000000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 0000748f5372c000 CR3: 0000000015408000 CR4: 00000000003406f0 shadow CR4: 00000000003406f0 Stack: 0000000000000000 ffffffff8a0c35e7 ffffffff8a0c3603 ffff8880aaa62c00 ffff8880aaa62c00 0000000000000004 ffff88811145311c 0000000000000005 0000000000000001 ffff8880aaa62000 fffffe8040b4fd40 ffffffff8a0c360d Call Trace: <TASK> [<ffffffff8a0c360d>] _listdelentryvalid include/linux/list.h:131 [inline] fffffe8040b4fc28 [<ffffffff8a0c360d>] _listdelentry include/linux/list.h:248 [inline] fffffe8040b4fc28 [<ffffffff8a0c360d>] listdel include/linux/list.h:262 [inl ---truncated---

References

Affected packages

Git / git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git

Affected ranges

Type
GIT
Repo
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
Events
Introduced
c986380c1d5274c4d5e935addc807d6791cc23eb
Fixed
7f86fb07db65a470d0c11f79da551bd9466357dc
Type
GIT
Repo
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
Events
Introduced
5f1678346109ff3a6d229d33437fcba3cce9209d
Fixed
33eb925c0c26e86ca540a08254806512bf911f22
Type
GIT
Repo
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
Events
Introduced
036f8d814a2cd11ee8ef62b8f3e7ce5dec0ee4f3
Fixed
cb15bb1bde0ba97cbbed9508e45210dcafec3657
Type
GIT
Repo
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
Events
Introduced
efec287cbac92ac6ee8312a89221854760e13b34
Fixed
b70fa591b066d52b141fc430ffdee35b6cc87a66
Type
GIT
Repo
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
Events
Introduced
bb11f992f5a475bc68ef959f17a55306f0328495
Fixed
9d03e7e37187ae140e716377599493987fb20c5b
Type
GIT
Repo
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
Events
Introduced
86f73d4ab2f27deeff22ba9336ad103d94f12ac7
Fixed
ff81b14010362f6188ca26fec22ff05e4da45595
Type
GIT
Repo
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
Events
Introduced
eb28fd76c0a08a47b470677c6cef9dd1c60e92d1
Fixed
37e7644b961600ef0beb01d3970c3034a62913af
Type
GIT
Repo
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
Events
Introduced
eb28fd76c0a08a47b470677c6cef9dd1c60e92d1
Fixed
4ccacf86491d33d2486b62d4d44864d7101b299d

Affected versions

v5.*

v5.10.234
v5.15.177
v5.15.178
v5.4.290

v6.*

v6.1.127
v6.1.128
v6.1.129
v6.12.11
v6.12.12
v6.12.13
v6.12.14
v6.12.15
v6.12.16
v6.13
v6.13-rc7
v6.13.1
v6.13.2
v6.13.3
v6.13.4
v6.14-rc1
v6.14-rc2
v6.6.74
v6.6.75
v6.6.76
v6.6.77
v6.6.78
v6.6.79

Linux / Kernel

Package

Name
Kernel

Affected ranges

Type
ECOSYSTEM
Events
Introduced
0Unknown introduced version / All previous versions are affected
Fixed
5.4.291
Type
ECOSYSTEM
Events
Introduced
5.5.0
Fixed
5.10.235
Type
ECOSYSTEM
Events
Introduced
5.11.0
Fixed
5.15.179
Type
ECOSYSTEM
Events
Introduced
5.16.0
Fixed
6.1.130
Type
ECOSYSTEM
Events
Introduced
6.2.0
Fixed
6.6.80
Type
ECOSYSTEM
Events
Introduced
6.7.0
Fixed
6.12.17
Type
ECOSYSTEM
Events
Introduced
6.13.0
Fixed
6.13.5