CVE-2025-21678: gtp: Destroy device along with udp socket's netns dismantle.

Published Jan 31, 2025
·
Updated

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

gtp: Destroy device along with udp socket's netns dismantle.

gtpnewlink() links the device to a list in devnet(dev) instead of srcnet, where a udp tunnel socket is created.

Even when srcnet is removed, the device stays alive on devnet(dev). Then, removing srcnet triggers the splat below. [0]

In this example, gtp0 is created in ns2, and the udp socket is created in ns1.

ip netns add ns1 ip netns add ns2 ip -n ns1 link add netns ns2 name gtp0 type gtp role sgsn ip netns del ns1

Let's link the device to the socket's netns instead.

Now, gtpnetexitbatchrtnl() needs another netdev iteration to remove all gtp devices in the netns.

[0]: reftracker: net notrefcnt@000000003d6e7d05 has 1/2 users at skalloc (./include/net/netnamespace.h:345 net/core/sock.c:2236) inetcreate (net/ipv4/afinet.c:326 net/ipv4/afinet.c:252) sockcreate (net/socket.c:1558) udpsockcreate4 (net/ipv4/udptunnelcore.c:18) gtpcreatesock (./include/net/udptunnel.h:59 drivers/net/gtp.c:1423) gtpcreatesockets (drivers/net/gtp.c:1447) gtpnewlink (drivers/net/gtp.c:1507) rtnlnewlink (net/core/rtnetlink.c:3786 net/core/rtnetlink.c:3897 net/core/rtnetlink.c:4012) rtnetlinkrcvmsg (net/core/rtnetlink.c:6922) netlinkrcvskb (net/netlink/afnetlink.c:2542) netlinkunicast (net/netlink/afnetlink.c:1321 net/netlink/afnetlink.c:1347) netlinksendmsg (net/netlink/afnetlink.c:1891) syssendmsg (net/socket.c:711 net/socket.c:726 net/socket.c:2583) syssendmsg (net/socket.c:2639) syssendmsg (net/socket.c:2669) dosyscall64 (arch/x86/entry/common.c:52 arch/x86/entry/common.c:83)

WARNING: CPU: 1 PID: 60 at lib/reftracker.c:179 reftrackerdirexit (lib/reftracker.c:179) Modules linked in: CPU: 1 UID: 0 PID: 60 Comm: kworker/u16:2 Not tainted 6.13.0-rc5-00147-g4c1224501e9d #5 Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS rel-1.16.0-0-gd239552ce722-prebuilt.qemu.org 04/01/2014 Workqueue: netns cleanupnet RIP: 0010:reftrackerdirexit (lib/reftracker.c:179) Code: 00 00 00 fc ff df 4d 8b 26 49 bd 00 01 00 00 00 00 ad de 4c 39 f5 0f 85 df 00 00 00 48 8b 74 24 08 48 89 df e8 a5 cc 12 02 90 <0f> 0b 90 48 8d 6b 44 be 04 00 00 00 48 89 ef e8 80 de 67 ff 48 89 RSP: 0018:ff11000009a07b60 EFLAGS: 00010286 RAX: 0000000000002bd3 RBX: ff1100000f4e1aa0 RCX: 1ffffffff0e40ac6 RDX: 0000000000000000 RSI: 0000000000000000 RDI: ffffffff8423ee3c RBP: ff1100000f4e1af0 R08: 0000000000000001 R09: fffffbfff0e395ae R10: 0000000000000001 R11: 0000000000036001 R12: ff1100000f4e1af0 R13: dead000000000100 R14: ff1100000f4e1af0 R15: dffffc0000000000 FS: 0000000000000000(0000) GS:ff1100006ce80000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 00007f9b2464bd98 CR3: 0000000005286005 CR4: 0000000000771ef0 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 DR3: 0000000000000000 DR6: 00000000fffe07f0 DR7: 0000000000000400 PKRU: 55555554 Call Trace: <TASK> ? warn (kernel/panic.c:748) ? reftrackerdirexit (lib/reftracker.c:179) ? reportbug (lib/bug.c:201 lib/bug.c:219) ? handlebug (arch/x86/kernel/traps.c:285) ? excinvalidop (arch/x86/kernel/traps.c:309 (discriminator 1)) ? asmexcinvalidop (./arch/x86/include/asm/idtentry.h:621) ? rawspinunlockirqrestore (./arch/x86/include/asm/irqflags.h:42 ./arch/x86/include/asm/irqflags.h:97 ./arch/x86/include/asm/irqflags.h:155 ./include/linux/spinlockapismp.h:151 kernel/locking/spinlock.c:194) ? reftrackerdirexit (lib/reftracker.c:179) ? pfxreftrackerdirexit (lib/reftracker.c:158) ? kfree (mm/slub.c:4613 mm/slub.c:4761) netfree (net/core/netnamespace.c:476 net/core/netnamespace.c:467) cleanupnet (net/core/netnamespace.c:664 (discriminator 3)) processonework (kernel/workqueue.c:3229) workerthread (kernel/workqueue.c:3304 kernel/workqueue.c:3391 ---truncated---

Affected Software

16 affected componentsFixes available
Linux Kernel
debian/linux<=5.10.223-1
5.10.234-16.1.129-16.1.135-16.12.25-16.12.27-1
debian/linux-6.1
6.1.129-1~deb11u1
Linux Linux kernel>=4.7<5.4.290
Linux Linux kernel>=5.5<5.10.234
Linux Linux kernel>=5.11<5.15.177
Linux Linux kernel>=5.16<6.1.127
Linux Linux kernel>=6.2<6.6.74
Linux Linux kernel>=6.7<6.12.11
Linux Linux kernel=6.13-rc1
Linux Linux kernel=6.13-rc2
Linux Linux kernel=6.13-rc3
Linux Linux kernel=6.13-rc4
Linux Linux kernel=6.13-rc5
Linux Linux kernel=6.13-rc6
Linux Linux kernel=6.13-rc7

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. Upgrade

    Upgrade debian/linux to a version that resolves this vulnerability.

    Fixed in 5.10.234-1Fixed in 6.1.129-1Fixed in 6.1.135-1Fixed in 6.12.25-1Fixed in 6.12.27-1
  2. Upgrade

    Upgrade debian/linux-6.1 to a version that resolves this vulnerability.

    Fixed in 6.1.129-1~deb11u1

Event History

Jan 31, 2025
CVE Published
via MITRE·11:25 AM
Data Sourced
via MITRE·11:25 AM
DescriptionSeverity
Data Sourced
via NVD·12:15 PM
Description
Data Sourced
via NVD·12:15 PM
RemedySeverityAffected Software
May 2, 2025
Data Sourced
via Ubuntu·11:49 PM
RemedyDescriptionSeverityAffected Software
Free Weekly Intel

Don't miss critical vulnerabilities

Join thousands of security professionals who receive our weekly digest of trending CVEs, zero-days, and exploited vulnerabilities.

No spam. Unsubscribe anytime.

Frequently Asked Questions

1

What is the severity of CVE-2025-21678?

CVE-2025-21678 is classified as a medium severity vulnerability in the Linux kernel.

2

How do I fix CVE-2025-21678?

To mitigate CVE-2025-21678, it is recommended to update the Linux kernel to the latest stable version that addresses this vulnerability.

3

What type of software is affected by CVE-2025-21678?

CVE-2025-21678 affects the Linux kernel, specifically related to device and UDP socket handling.

4

What are the consequences of exploiting CVE-2025-21678?

Exploitation of CVE-2025-21678 could lead to improper device management and potential denial of service.

5

When was CVE-2025-21678 discovered?

CVE-2025-21678 was identified in 2025 as part of ongoing kernel security assessments.

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