CVE-2025-39984

Source
https://nvd.nist.gov/vuln/detail/CVE-2025-39984
Import Source
https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2025-39984.json
JSON Data
https://api.osv.dev/v1/vulns/CVE-2025-39984
Downstream
Related
Published
2025-10-15T07:56:03Z
Modified
2025-10-22T17:07:36.059616Z
Summary
net: tun: Update napi->skb after XDP process
Details

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

net: tun: Update napi->skb after XDP process

The syzbot report a UAF issue:

BUG: KASAN: slab-use-after-free in skbresetmacheader include/linux/skbuff.h:3150 [inline] BUG: KASAN: slab-use-after-free in napifragsskb net/core/gro.c:723 [inline] BUG: KASAN: slab-use-after-free in napigrofrags+0x6e/0x1030 net/core/gro.c:758 Read of size 8 at addr ffff88802ef22c18 by task syz.0.17/6079 CPU: 0 UID: 0 PID: 6079 Comm: syz.0.17 Not tainted syzkaller #0 PREEMPT(full) Call Trace: <TASK> dumpstacklvl+0x189/0x250 lib/dumpstack.c:120 printaddressdescription mm/kasan/report.c:378 [inline] printreport+0xca/0x240 mm/kasan/report.c:482 kasanreport+0x118/0x150 mm/kasan/report.c:595 skbresetmacheader include/linux/skbuff.h:3150 [inline] napifragsskb net/core/gro.c:723 [inline] napigrofrags+0x6e/0x1030 net/core/gro.c:758 tungetuser+0x28cb/0x3e20 drivers/net/tun.c:1920 tunchrwriteiter+0x113/0x200 drivers/net/tun.c:1996 newsyncwrite fs/readwrite.c:593 [inline] vfswrite+0x5c9/0xb30 fs/readwrite.c:686 ksyswrite+0x145/0x250 fs/readwrite.c:738 dosyscallx64 arch/x86/entry/syscall64.c:63 [inline] dosyscall64+0xfa/0x3b0 arch/x86/entry/syscall64.c:94 entrySYSCALL64after_hwframe+0x77/0x7f </TASK>

Allocated by task 6079: kasansavestack mm/kasan/common.c:47 [inline] kasansavetrack+0x3e/0x80 mm/kasan/common.c:68 unpoisonslabobject mm/kasan/common.c:330 [inline] _kasanmempoolunpoisonobject+0xa0/0x170 mm/kasan/common.c:558 kasanmempoolunpoisonobject include/linux/kasan.h:388 [inline] napiskbcacheget+0x37b/0x6d0 net/core/skbuff.c:295 _allocskb+0x11e/0x2d0 net/core/skbuff.c:657 napiallocskb+0x84/0x7d0 net/core/skbuff.c:811 napigetfrags+0x69/0x140 net/core/gro.c:673 tunnapiallocfrags drivers/net/tun.c:1404 [inline] tungetuser+0x77c/0x3e20 drivers/net/tun.c:1784 tunchrwriteiter+0x113/0x200 drivers/net/tun.c:1996 newsyncwrite fs/readwrite.c:593 [inline] vfswrite+0x5c9/0xb30 fs/readwrite.c:686 ksyswrite+0x145/0x250 fs/readwrite.c:738 dosyscallx64 arch/x86/entry/syscall64.c:63 [inline] dosyscall64+0xfa/0x3b0 arch/x86/entry/syscall64.c:94 entrySYSCALL64after_hwframe+0x77/0x7f

Freed by task 6079: kasansavestack mm/kasan/common.c:47 [inline] kasansavetrack+0x3e/0x80 mm/kasan/common.c:68 kasansavefreeinfo+0x46/0x50 mm/kasan/generic.c:576 poisonslabobject mm/kasan/common.c:243 [inline] _kasanslabfree+0x5b/0x80 mm/kasan/common.c:275 kasanslabfree include/linux/kasan.h:233 [inline] slabfreehook mm/slub.c:2422 [inline] slabfree mm/slub.c:4695 [inline] kmemcachefree+0x18f/0x400 mm/slub.c:4797 skbppcowdata+0xdd8/0x13e0 net/core/skbuff.c:969 netifskbcheckforxdp net/core/dev.c:5390 [inline] netifreceivegenericxdp net/core/dev.c:5431 [inline] doxdpgeneric+0x699/0x11a0 net/core/dev.c:5499 tungetuser+0x2523/0x3e20 drivers/net/tun.c:1872 tunchrwriteiter+0x113/0x200 drivers/net/tun.c:1996 newsyncwrite fs/readwrite.c:593 [inline] vfswrite+0x5c9/0xb30 fs/readwrite.c:686 ksyswrite+0x145/0x250 fs/readwrite.c:738 dosyscallx64 arch/x86/entry/syscall64.c:63 [inline] dosyscall64+0xfa/0x3b0 arch/x86/entry/syscall64.c:94 entrySYSCALL64after_hwframe+0x77/0x7f

After commit e6d5dbdd20aa ("xdp: add multi-buff support for xdp running in generic mode"), the original skb may be freed in skbppcowdata() when XDP program was attached, which was allocated in tunnapiallocfrags(). However, the napi->skb still point to the original skb, update it after XDP process.

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
e6d5dbdd20aa6a86974af51deb9414cd2e7794cb
Fixed
953200d56fc23eebf80a5ad9eed6e2e8a3065093
Type
GIT
Repo
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
Events
Introduced
e6d5dbdd20aa6a86974af51deb9414cd2e7794cb
Fixed
1697577e1669b0321d02cd848384a5d33e284296
Type
GIT
Repo
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
Events
Introduced
e6d5dbdd20aa6a86974af51deb9414cd2e7794cb
Fixed
1091860a16a86ccdd77c09f2b21a5f634f5ab9ec

Affected versions

v6.*

v6.10
v6.10-rc1
v6.10-rc2
v6.10-rc3
v6.10-rc4
v6.10-rc5
v6.10-rc6
v6.10-rc7
v6.11
v6.11-rc1
v6.11-rc2
v6.11-rc3
v6.11-rc4
v6.11-rc5
v6.11-rc6
v6.11-rc7
v6.12
v6.12-rc1
v6.12-rc2
v6.12-rc3
v6.12-rc4
v6.12-rc5
v6.12-rc6
v6.12-rc7
v6.12.1
v6.12.10
v6.12.11
v6.12.12
v6.12.13
v6.12.14
v6.12.15
v6.12.16
v6.12.17
v6.12.18
v6.12.19
v6.12.2
v6.12.20
v6.12.21
v6.12.22
v6.12.23
v6.12.24
v6.12.25
v6.12.26
v6.12.27
v6.12.28
v6.12.29
v6.12.3
v6.12.30
v6.12.31
v6.12.32
v6.12.33
v6.12.34
v6.12.35
v6.12.36
v6.12.37
v6.12.38
v6.12.39
v6.12.4
v6.12.40
v6.12.41
v6.12.42
v6.12.43
v6.12.44
v6.12.45
v6.12.46
v6.12.47
v6.12.48
v6.12.49
v6.12.5
v6.12.6
v6.12.7
v6.12.8
v6.12.9
v6.13
v6.13-rc1
v6.13-rc2
v6.13-rc3
v6.13-rc4
v6.13-rc5
v6.13-rc6
v6.13-rc7
v6.14
v6.14-rc1
v6.14-rc2
v6.14-rc3
v6.14-rc4
v6.14-rc5
v6.14-rc6
v6.14-rc7
v6.15
v6.15-rc1
v6.15-rc2
v6.15-rc3
v6.15-rc4
v6.15-rc5
v6.15-rc6
v6.15-rc7
v6.16
v6.16-rc1
v6.16-rc2
v6.16-rc3
v6.16-rc4
v6.16-rc5
v6.16-rc6
v6.16-rc7
v6.16.1
v6.16.2
v6.16.3
v6.16.4
v6.16.5
v6.16.6
v6.16.7
v6.16.8
v6.16.9
v6.17-rc1
v6.17-rc2
v6.17-rc3
v6.17-rc4
v6.17-rc5
v6.17-rc6
v6.8
v6.8-rc4
v6.8-rc5
v6.8-rc6
v6.8-rc7
v6.9
v6.9-rc1
v6.9-rc2
v6.9-rc3
v6.9-rc4
v6.9-rc5
v6.9-rc6
v6.9-rc7

Linux / Kernel

Package

Name
Kernel

Affected ranges

Type
ECOSYSTEM
Events
Introduced
6.9.0
Fixed
6.12.50
Type
ECOSYSTEM
Events
Introduced
6.13.0
Fixed
6.16.10