# CVE-2023-54142: gtp: Fix use-after-free in \_\_gtp\_encap\_destroy().

> 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.24% (percentile 9, 2026-11-28)
- **Published:** 2025-12-24T13:06:56.204Z
- **Modified:** 2026-08-05T09:17:36.638Z

## Who should check

- Anyone running Linux \>= 01f3c64e405ab3d25887d080a103ad76f30661d2, \< d38039697184aacff1cf576e14ef583112fdefef; \>= e117a04133c673cc54292e12086a8177cd9bd4a4, \< e5aa6d829831a55a693dbaeb58f8d22ba7f2b3e6; \>= e198987e7dd7d3645a53875151cd6f8fc425b706, \< 9c9662e2512b5e4ee7b03108802c5222e0fa77a4; \>= e198987e7dd7d3645a53875151cd6f8fc425b706, \< bccc7ace12e69dee4684a3bb4b69737972e570d6; \>= e198987e7dd7d3645a53875151cd6f8fc425b706, \< ebd6d2077a083329110695a996c00e8ca94bc640; \>= e198987e7dd7d3645a53875151cd6f8fc425b706, \< 17d6b6354f0025b7c10a56da783fd0cbb3819c5d; \>= e198987e7dd7d3645a53875151cd6f8fc425b706, \< dae6095bdb24f537b4798ffd9201515b97bac94e; \>= e198987e7dd7d3645a53875151cd6f8fc425b706, \< 58fa341327fdb4bdf92597fd8796a9abc8d20ea3; \>= e198987e7dd7d3645a53875151cd6f8fc425b706, \< ce3aee7114c575fab32a5e9e939d4bbb3dcca79f; bf75202df8e473d4ee914894542f213158066d8b; …
- Anyone running Linux 5.3

## Description

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

gtp: Fix use-after-free in \_\_gtp\_encap\_destroy().

syzkaller reported use-after-free in \_\_gtp\_encap\_destroy(). \[0\]

It shows the same process freed sk and touched it illegally.

Commit e198987e7dd7 ("gtp: fix suspicious RCU usage") added lock\_sock()
and release\_sock() in \_\_gtp\_encap\_destroy() to protect sk-\>sk\_user\_data,
but release\_sock() is called after sock\_put() releases the last refcnt.

\[0\]:
BUG: KASAN: slab-use-after-free in instrument\_atomic\_read\_write include/linux/instrumented.h:96 \[inline\]
BUG: KASAN: slab-use-after-free in atomic\_try\_cmpxchg\_acquire include/linux/atomic/atomic-instrumented.h:541 \[inline\]
BUG: KASAN: slab-use-after-free in queued\_spin\_lock include/asm-generic/qspinlock.h:111 \[inline\]
BUG: KASAN: slab-use-after-free in do\_raw\_spin\_lock include/linux/spinlock.h:186 \[inline\]
BUG: KASAN: slab-use-after-free in \_\_raw\_spin\_lock\_bh include/linux/spinlock\_api\_smp.h:127 \[inline\]
BUG: KASAN: slab-use-after-free in \_raw\_spin\_lock\_bh+0x75/0xe0 kernel/locking/spinlock.c:178
Write of size 4 at addr ffff88800dbef398 by task syz-executor.2/2401

CPU: 1 PID: 2401 Comm: syz-executor.2 Not tainted 6.4.0-rc5-01219-gfa0e21fa4443 \#2
Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS rel-1.16.0-0-gd239552ce722-prebuilt.qemu.org 04/01/2014
Call Trace:
 \<TASK\>
 \_\_dump\_stack lib/dump\_stack.c:88 \[inline\]
 dump\_stack\_lvl+0x72/0xa0 lib/dump\_stack.c:106
 print\_address\_description mm/kasan/report.c:351 \[inline\]
 print\_report+0xcc/0x620 mm/kasan/report.c:462
 kasan\_report+0xb2/0xe0 mm/kasan/report.c:572
 check\_region\_inline mm/kasan/generic.c:181 \[inline\]
 kasan\_check\_range+0x39/0x1c0 mm/kasan/generic.c:187
 instrument\_atomic\_read\_write include/linux/instrumented.h:96 \[inline\]
 atomic\_try\_cmpxchg\_acquire include/linux/atomic/atomic-instrumented.h:541 \[inline\]
 queued\_spin\_lock include/asm-generic/qspinlock.h:111 \[inline\]
 do\_raw\_spin\_lock include/linux/spinlock.h:186 \[inline\]
 \_\_raw\_spin\_lock\_bh include/linux/spinlock\_api\_smp.h:127 \[inline\]
 \_raw\_spin\_lock\_bh+0x75/0xe0 kernel/locking/spinlock.c:178
 spin\_lock\_bh include/linux/spinlock.h:355 \[inline\]
 release\_sock+0x1f/0x1a0 net/core/sock.c:3526
 gtp\_encap\_disable\_sock drivers/net/gtp.c:651 \[inline\]
 gtp\_encap\_disable+0xb9/0x220 drivers/net/gtp.c:664
 gtp\_dev\_uninit+0x19/0x50 drivers/net/gtp.c:728
 unregister\_netdevice\_many\_notify+0x97e/0x1520 net/core/dev.c:10841
 rtnl\_delete\_link net/core/rtnetlink.c:3216 \[inline\]
 rtnl\_dellink+0x3c0/0xb30 net/core/rtnetlink.c:3268
 rtnetlink\_rcv\_msg+0x450/0xb10 net/core/rtnetlink.c:6423
 netlink\_rcv\_skb+0x15d/0x450 net/netlink/af\_netlink.c:2548
 netlink\_unicast\_kernel net/netlink/af\_netlink.c:1339 \[inline\]
 netlink\_unicast+0x700/0x930 net/netlink/af\_netlink.c:1365
 netlink\_sendmsg+0x91c/0xe30 net/netlink/af\_netlink.c:1913
 sock\_sendmsg\_nosec net/socket.c:724 \[inline\]
 sock\_sendmsg+0x1b7/0x200 net/socket.c:747
 \_\_\_\_sys\_sendmsg+0x75a/0x990 net/socket.c:2493
 \_\_\_sys\_sendmsg+0x11d/0x1c0 net/socket.c:2547
 \_\_sys\_sendmsg+0xfe/0x1d0 net/socket.c:2576
 do\_syscall\_x64 arch/x86/entry/common.c:50 \[inline\]
 do\_syscall\_64+0x3f/0x90 arch/x86/entry/common.c:80
 entry\_SYSCALL\_64\_after\_hwframe+0x72/0xdc
RIP: 0033:0x7f1168b1fe5d
Code: ff c3 66 2e 0f 1f 84 00 00 00 00 00 90 f3 0f 1e fa 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 \<48\> 3d 01 f0 ff ff 73 01 c3 48 8b 0d 73 9f 1b 00 f7 d8 64 89 01 48
RSP: 002b:00007f1167edccc8 EFLAGS: 00000246 ORIG\_RAX: 000000000000002e
RAX: ffffffffffffffda RBX: 00000000004bbf80 RCX: 00007f1168b1fe5d
RDX: 0000000000000000 RSI: 00000000200002c0 RDI: 0000000000000003
RBP: 00000000004bbf80 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
R13: 000000000000000b R14: 00007f1168b80530 R15: 0000000000000000
 \</TASK\>

Allocated by task 1483:
 kasan\_save\_stack+0x22/0x50 mm/kasan/common.c:45
 kasan\_set\_track+0x25/0x30 mm/kasan/common.c:52
 \_\_kasan\_slab\_alloc+0x
---truncated---

## Affected and fixed versions

- Linux: \>= 01f3c64e405ab3d25887d080a103ad76f30661d2, \< d38039697184aacff1cf576e14ef583112fdefef; \>= e117a04133c673cc54292e12086a8177cd9bd4a4, \< e5aa6d829831a55a693dbaeb58f8d22ba7f2b3e6; \>= e198987e7dd7d3645a53875151cd6f8fc425b706, \< 9c9662e2512b5e4ee7b03108802c5222e0fa77a4; \>= e198987e7dd7d3645a53875151cd6f8fc425b706, \< bccc7ace12e69dee4684a3bb4b69737972e570d6; \>= e198987e7dd7d3645a53875151cd6f8fc425b706, \< ebd6d2077a083329110695a996c00e8ca94bc640; \>= e198987e7dd7d3645a53875151cd6f8fc425b706, \< 17d6b6354f0025b7c10a56da783fd0cbb3819c5d; \>= e198987e7dd7d3645a53875151cd6f8fc425b706, \< dae6095bdb24f537b4798ffd9201515b97bac94e; \>= e198987e7dd7d3645a53875151cd6f8fc425b706, \< 58fa341327fdb4bdf92597fd8796a9abc8d20ea3; \>= e198987e7dd7d3645a53875151cd6f8fc425b706, \< ce3aee7114c575fab32a5e9e939d4bbb3dcca79f; bf75202df8e473d4ee914894542f213158066d8b; … (cvelist)
- Linux: 5.3 (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-2023-54142. Work read-only: do not install, upgrade, delete or change anything.

Details: https://flawdb.com/CVE-2023-54142.md
Affected: Linux >= 01f3c64e405ab3d25887d080a103ad76f30661d2, < d38039697184aacff1cf576e14ef583112fdefef; >= e117a04133c673cc54292e12086a8177cd9bd4a4, < e5aa6d829831a55a693dbaeb58f8d22ba7f2b3e6; >= e198987e7dd7d3645a53875151cd6f8fc425b706, < 9c9662e2512b5e4ee7b03108802c5222e0fa77a4; >= e198987e7dd7d3645a53875…
Fixed in: Linux 9c9662e2512b5e4ee7b03108802c5222e0fa77a4, Linux 17d6b6354f0025b7c10a56da783fd0cbb3819c5d, Linux 58fa341327fdb4bdf92597fd8796a9abc8d20ea3

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-2023-54142 being exploited?

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

### How serious is CVE-2023-54142?

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

### Which versions are affected by CVE-2023-54142?

Linux \>= 01f3c64e405ab3d25887d080a103ad76f30661d2, \< d38039697184aacff1cf576e14ef583112fdefef; \>= e117a04133c673cc54292e12086a8177cd9bd4a4, \< e5aa6d829831a55a693dbaeb58f8d22ba7f2b3e6; \>= e198987e7dd7d3645a53875151cd6f8fc425b706, \< 9c9662e2512b5e4ee7b03108802c5222e0fa77a4; \>= e198987e7dd7d3645a53875151cd6f8fc425b706, \< bccc7ace12e69dee4684a3bb4b69737972e570d6; \>= e198987e7dd7d3645a53875151cd6f8fc425b706, \< ebd6d2077a083329110695a996c00e8ca94bc640; \>= e198987e7dd7d3645a53875151cd6f8fc425b706, \< 17d6b6354f0025b7c10a56da783fd0cbb3819c5d; \>= e198987e7dd7d3645a53875151cd6f8fc425b706, \< dae6095bdb24f537b4798ffd9201515b97bac94e; \>= e198987e7dd7d3645a53875151cd6f8fc425b706, \< 58fa341327fdb4bdf92597fd8796a9abc8d20ea3; \>= e198987e7dd7d3645a53875151cd6f8fc425b706, \< ce3aee7114c575fab32a5e9e939d4bbb3dcca79f; bf75202df8e473d4ee914894542f213158066d8b; …; Linux 5.3.

### Is there a fix for CVE-2023-54142?

Yes. Fixed in Linux 9c9662e2512b5e4ee7b03108802c5222e0fa77a4, Linux 17d6b6354f0025b7c10a56da783fd0cbb3819c5d, Linux 58fa341327fdb4bdf92597fd8796a9abc8d20ea3. No fix listed yet: follow the vendor advisory.

### How do I check if I'm affected by CVE-2023-54142?

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

- other: <https://git.kernel.org/stable/c/d38039697184aacff1cf576e14ef583112fdefef>
- other: <https://git.kernel.org/stable/c/e5aa6d829831a55a693dbaeb58f8d22ba7f2b3e6>
- other: <https://git.kernel.org/stable/c/9c9662e2512b5e4ee7b03108802c5222e0fa77a4>
- other: <https://git.kernel.org/stable/c/bccc7ace12e69dee4684a3bb4b69737972e570d6>
- other: <https://git.kernel.org/stable/c/ebd6d2077a083329110695a996c00e8ca94bc640>
- other: <https://git.kernel.org/stable/c/17d6b6354f0025b7c10a56da783fd0cbb3819c5d>
- other: <https://git.kernel.org/stable/c/dae6095bdb24f537b4798ffd9201515b97bac94e>
- other: <https://git.kernel.org/stable/c/58fa341327fdb4bdf92597fd8796a9abc8d20ea3>
- other: <https://git.kernel.org/stable/c/ce3aee7114c575fab32a5e9e939d4bbb3dcca79f>

## 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-2023-54142>

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