CVE-2023-53685
tun: Fix memory leak for detached NAPI queue.
Description
In the Linux kernel, the following vulnerability has been resolved: tun: Fix memory leak for detached NAPI queue. syzkaller reported [0] memory leaks of sk and skb related to the TUN device with no repro, but we can reproduce it easily with: struct ifreq ifr = {} int fd_tun, fd_tmp; char buf[4] = {}; fd_tun = openat(AT_FDCWD, "/dev/net/tun", O_WRONLY, 0); ifr.ifr_flags = IFF_TUN | IFF_NAPI | IFF_MULTI_QUEUE; ioctl(fd_tun, TUNSETIFF, &ifr); ifr.ifr_flags = IFF_DETACH_QUEUE; ioctl(fd_tun, TUNSETQUEUE, &ifr); fd_tmp = socket(AF_PACKET, SOCK_PACKET, 0); ifr.ifr_flags = IFF_UP; ioctl(fd_tmp, SIOCSIFFLAGS, &ifr); write(fd_tun, buf, sizeof(buf)); close(fd_tun); If we enable NAPI and multi-queue on a TUN device, we can put skb into tfile->sk.sk_write_queue after the queue is detached. We should prevent it by checking tfile->detached before queuing skb. Note this must be done under tfile->sk.sk_write_queue.lock because write() and ioctl(IFF_DETACH_QUEUE) can run concurrently. Otherwise, there would be a small race window: write() ioctl(IFF_DETACH_QUEUE) `- tun_get_user `- __tun_detach |- if (tfile->detached) |- tun_disable_queue | `-> false | `- tfile->detached = tun | `- tun_queue_purge |- spin_lock_bh(&queue->lock) `- __skb_queue_tail(queue, skb) Another solution is to call tun_queue_purge() when closing and reattaching the detached queue, but it could paper over another problems. Also, we do the same kind of test for IFF_NAPI_FRAGS. [0]: unreferenced object 0xffff88801edbc800 (size 2048): comm "syz-executor.1", pid 33269, jiffies 4295743834 (age 18.756s) hex dump (first 32 bytes): 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ 00 00 07 40 00 00 00 00 00 00 00 00 00 00 00 00 ...@............ backtrace: [<000000008c16ea3d>] __do_kmalloc_node mm/slab_common.c:965 [inline] [<000000008c16ea3d>] __kmalloc+0x4a/0x130 mm/slab_common.c:979 [<000000003addde56>] kmalloc include/linux/slab.h:563 [inline] [<000000003addde56>] sk_prot_alloc+0xef/0x1b0 net/core/sock.c:2035 [<000000003e20621f>] sk_alloc+0x36/0x2f0 net/core/sock.c:2088 [<0000000028e43843>] tun_chr_open+0x3d/0x190 drivers/net/tun.c:3438 [<000000001b0f1f28>] misc_open+0x1a6/0x1f0 drivers/char/misc.c:165 [<000000004376f706>] chrdev_open+0x111/0x300 fs/char_dev.c:414 [<00000000614d379f>] do_dentry_open+0x2f9/0x750 fs/open.c:920 [<000000008eb24774>] do_open fs/namei.c:3636 [inline] [<000000008eb24774>] path_openat+0x143f/0x1a30 fs/namei.c:3791 [<00000000955077b5>] do_filp_open+0xce/0x1c0 fs/namei.c:3818 [<00000000b78973b0>] do_sys_openat2+0xf0/0x260 fs/open.c:1356 [<00000000057be699>] do_sys_open fs/open.c:1372 [inline] [<00000000057be699>] __do_sys_openat fs/open.c:1388 [inline] [<00000000057be699>] __se_sys_openat fs/open.c:1383 [inline] [<00000000057be699>] __x64_sys_openat+0x83/0xf0 fs/open.c:1383 [<00000000a7d2182d>] do_syscall_x64 arch/x86/entry/common.c:50 [inline] [<00000000a7d2182d>] do_syscall_64+0x3c/0x90 arch/x86/entry/common.c:80 [<000000004cc4e8c4>] entry_SYSCALL_64_after_hwframe+0x72/0xdc unreferenced object 0xffff88802f671700 (size 240): comm "syz-executor.1", pid 33269, jiffies 4295743854 (age 18.736s) hex dump (first 32 bytes): 68 c9 db 1e 80 88 ff ff 68 c9 db 1e 80 88 ff ff h.......h....... 00 c0 7b 2f 80 88 ff ff 00 c8 db 1e 80 88 ff ff ..{/............ backtrace: [<00000000e9d9fdb6>] __alloc_skb+0x223/0x250 net/core/skbuff.c:644 [<000000002c3e4e0b>] alloc_skb include/linux/skbuff.h:1288 [inline] [<000000002c3e4e0b>] alloc_skb_with_frags+0x6f/0x350 net/core/skbuff.c:6378 [<00000000825f98d7>] sock_alloc_send_pskb+0x3ac/0x3e0 net/core/sock.c:2729 [<00000000e9eb3df3>] tun_alloc_skb drivers/net/tun.c:1529 [inline] [< ---truncated---
INFO
Published Date :
Oct. 7, 2025, 4:15 p.m.
Last Modified :
Nov. 5, 2026, 9:17 p.m.
Remotely Exploit :
No
Source :
416baaa9-dc9f-4396-8d5f-8c081fb06d67
CVSS Scores
| Score | Version | Severity | Vector | Exploitability Score | Impact Score | Source |
|---|---|---|---|---|---|---|
| CVSS | 134c704f-9b21-4f2e-91b3-4a467353bcc0 | |||||
| CVSS 3.1 | MEDIUM | [email protected] |
Solution
- Check tfile->detached before queuing skb.
- Acquire lock for write() and ioctl() concurrency.
- Apply patch to the Linux kernel.
- Update the Linux kernel.
References to Advisories, Solutions, and Tools
Here, you will find a curated list of external links that provide in-depth
information, practical solutions, and valuable tools related to
CVE-2023-53685.
CWE - Common Weakness Enumeration
While CVE identifies
specific instances of vulnerabilities, CWE categorizes the common flaws or
weaknesses that can lead to vulnerabilities. CVE-2023-53685 is
associated with the following CWEs:
Common Attack Pattern Enumeration and Classification (CAPEC)
Common Attack Pattern Enumeration and Classification
(CAPEC)
stores attack patterns, which are descriptions of the common attributes and
approaches employed by adversaries to exploit the CVE-2023-53685
weaknesses.
We scan GitHub repositories to detect new proof-of-concept exploits. Following list is a collection of public exploits and proof-of-concepts, which have been published on GitHub (sorted by the most recently updated).
Results are limited to the first 15 repositories due to potential performance issues.
The following list is the news that have been mention
CVE-2023-53685 vulnerability anywhere in the article.
The following table lists the changes that have been made to the
CVE-2023-53685 vulnerability over time.
Vulnerability history details can be useful for understanding the evolution of a vulnerability, and for identifying the most recent changes that may impact the vulnerability's severity, exploitability, or other characteristics.
-
CVE Modified by 134c704f-9b21-4f2e-91b3-4a467353bcc0
Nov. 05, 2026
Action Type Old Value New Value Added SSVC {'id': 'CVE-2023-53685', 'role': 'CISA Coordinator', 'options': [{'exploitation': 'none'}, {'automatable': 'no'}, {'technicalImpact': 'partial'}], 'version': '2.0.3', 'timestamp': '2026-11-05T20:27:17.759363Z'} -
CVE Modified by 416baaa9-dc9f-4396-8d5f-8c081fb06d67
Nov. 05, 2026
Action Type Old Value New Value Added Reference https://git.kernel.org/stable/c/0d20210a190f76db9ec35ee4e0fc77e6c7a148f5 Added Reference https://git.kernel.org/stable/c/82b2bc279467c875ec36f8ef820f00997c2a4e8e Added Reference https://git.kernel.org/stable/c/9cae243b9ae25adfe468cd47ceca591f6725b79c Removed Reference https://git.kernel.org/stable/c/0d20210a190f76db9ec35ee4e0fc77e6c7a148f5 Removed Reference https://git.kernel.org/stable/c/82b2bc279467c875ec36f8ef820f00997c2a4e8e Removed Reference https://git.kernel.org/stable/c/9cae243b9ae25adfe468cd47ceca591f6725b79c Removed Reference Type https://git.kernel.org/stable/c/0d20210a190f76db9ec35ee4e0fc77e6c7a148f5 Types: Patch Removed Reference Type https://git.kernel.org/stable/c/82b2bc279467c875ec36f8ef820f00997c2a4e8e Types: Patch Removed Reference Type https://git.kernel.org/stable/c/9cae243b9ae25adfe468cd47ceca591f6725b79c Types: Patch -
CVE Translated by [email protected]
Oct. 28, 2026
Action Type Old Value New Value Added Translation Title: Linux Kernel, Description: En el kernel de Linux, la siguiente vulnerabilidad ha sido resuelta: tun: Corrección de fuga de memoria para cola NAPI desvinculada. syzkaller informó [0] fugas de memoria de sk y skb relacionadas con el dispositivo TUN sin reproducción, pero podemos reproducirlo fácilmente con: struct ifreq ifr = {} int fd_tun, fd_tmp; char buf[4] = {}; fd_tun = openat(AT_FDCWD, “/dev/net/tun”, O_WRONLY, 0); ifr.ifr_flags = IFF_TUN | IFF_NAPI | IFF_MULTI_QUEUE; ioctl(fd_tun, TUNSETIFF, &ifr); ifr.ifr_flags = IFF_DETACH_QUEUE; ioctl(fd_tun, TUNSETQUEUE, &ifr); fd_tmp = socket(AF_PACKET, SOCK_PACKET, 0); ifr.ifr_flags = IFF_UP; ioctl(fd_tmp, SIOCSIFFLAGS, &ifr); write(fd_tun, buf, sizeof(buf)); close(fd_tun); Si habilitamos NAPI y multi-cola en un dispositivo TUN, podemos colocar skb en tfile -> sk.sk_write_queue después de que la cola se desvincule. Deberíamos evitarlo comprobando tfile -> detached antes de encolar skb. Tenga en cuenta que esto debe hacerse bajo tfile -> sk.sk_write_queue.lock porque write() e ioctl(IFF_DETACH_QUEUE) pueden ejecutarse concurrentemente. De lo contrario, habría una pequeña ventana de carrera: write() ioctl(IFF_DETACH_QUEUE) “- tun_get_user ”- __tun_detach |- if (tfile -> detached) |- tun_disable_queue | “ -> false | ”- tfile -> detached = tun | “- tun_queue_purge |- spin_lock_bh(&queue -> lock) ”- __skb_queue_tail(queue, skb) Otra solución es llamar a tun_queue_purge() al cerrar y volver a adjuntar la cola desvinculada, pero podría encubrir otros problemas. Además, hacemos el mismo tipo de prueba para IFF_NAPI_FRAGS. [0]: objeto sin referencia 0xffff88801edbc800 (tamaño 2048): comm ’syz-executor.1’, pid 33269, jiffies 4295743834 (antigüedad 18.756s) volcado hexadecimal (primeros 32 bytes): 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ 00 00 07 40 00 00 00 00 00 00 00 00 00 00 00 00 ...@............ rastreo de pila: [[000000008c16ea3d]] __do_kmalloc_node mm/slab_common.c:965 [inline] [[000000008c16ea3d]] __kmalloc+0x4a/0x130 mm/slab_common.c:979 [[000000003addde56]] kmalloc include/linux/slab.h:563 [inline] [[000000003addde56]] sk_prot_alloc+0xef/0x1b0 net/core/sock.c:2035 [[000000003e20621f]] sk_alloc+0x36/0x2f0 net/core/sock.c:2088 [[0000000028e43843]] tun_chr_open+0x3d/0x190 drivers/net/tun.c:3438 [[000000001b0f1f28]] misc_open+0x1a6/0x1f0 drivers/char/misc.c:165 [[000000004376f706]] chrdev_open+0x111/0x300 fs/char_dev.c:414 [[00000000614d379f]] do_dentry_open+0x2f9/0x750 fs/open.c:920 [[000000008eb24774]] do_open fs/namei.c:3636 [inline] [[000000008eb24774]] path_openat+0x143f/0x1a30 fs/namei.c:3791 [[00000000955077b5]] do_filp_open+0xce/0x1c0 fs/namei.c:3818 [[00000000b78973b0]] do_sys_openat2+0xf0/0x260 fs/open.c:1356 [[00000000057be699]] do_sys_open fs/open.c:1372 [inline] [[00000000057be699]] __do_sys_openat fs/open.c:1388 [inline] [[00000000057be699]] __se_sys_openat fs/open.c:1383 [inline] [[00000000057be699]] __x64_sys_openat+0x83/0xf0 fs/open.c:1383 [[00000000a7d2182d]] do_syscall_x64 arch/x86/entry/common.c:50 [inline] [[00000000a7d2182d]] do_syscall_64+0x3c/0x90 arch/x86/entry/common.c:80 [[000000004cc4e8c4]] entry_SYSCALL_64_after_hwframe+0x72/0xdc objeto sin referencia 0xffff88802f671700 (tamaño 240): comm ’syz-executor.1’, pid 33269, jiffies 4295743854 (antigüedad 18.736s) volcado hexadecimal (primeros 32 bytes): 68 c9 db 1e 80 88 ff ff 68 c9 db 1e 80 88 ff ff h.......h....... 00 c0 7b 2f 80 88 ff ff 00 c8 db 1e 80 88 ff ff ..{/............ rastreo de pila: [[00000000e9d9fdb6]] __alloc_skb+0x223/0x250 net/core/skbuff.c:644 [[000000002c3e4e0b]] alloc_skb include/linux/skbuff.h:1288 [inline] [[000000002c3e4e0b]] alloc_skb_with_frags+0x6f/0x350 net/core/skbuff.c:6378 [[00000000825f98d7]] sock_alloc_send_pskb+0x3ac/0x3e0 --TRUNCADO-- -
CVE Modified by 416baaa9-dc9f-4396-8d5f-8c081fb06d67
Jun. 17, 2026
Action Type Old Value New Value Added Affected [{'repo': 'https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git', 'vendor': 'Linux', 'product': 'Linux', 'versions': [{'status': 'affected', 'version': 'cde8b15f1aabe327038ee4e0e11dd6b798572f69', 'lessThan': '9cae243b9ae25adfe468cd47ceca591f6725b79c', 'versionType': 'git'}, {'status': 'affected', 'version': 'cde8b15f1aabe327038ee4e0e11dd6b798572f69', 'lessThan': '0d20210a190f76db9ec35ee4e0fc77e6c7a148f5', 'versionType': 'git'}, {'status': 'affected', 'version': 'cde8b15f1aabe327038ee4e0e11dd6b798572f69', 'lessThan': '82b2bc279467c875ec36f8ef820f00997c2a4e8e', 'versionType': 'git'}], 'programFiles': ['drivers/net/tun.c'], 'defaultStatus': 'unaffected'}, {'repo': 'https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git', 'vendor': 'Linux', 'product': 'Linux', 'versions': [{'status': 'affected', 'version': '3.8'}, {'status': 'unaffected', 'version': '0', 'lessThan': '3.8', 'versionType': 'semver'}, {'status': 'unaffected', 'version': '6.1.30', 'versionType': 'semver', 'lessThanOrEqual': '6.1.*'}, {'status': 'unaffected', 'version': '6.3.4', 'versionType': 'semver', 'lessThanOrEqual': '6.3.*'}, {'status': 'unaffected', 'version': '6.4', 'versionType': 'original_commit_for_fix', 'lessThanOrEqual': '*'}], 'programFiles': ['drivers/net/tun.c'], 'defaultStatus': 'affected'}] -
Reanalysis by [email protected]
Feb. 26, 2026
Action Type Old Value New Value -
Initial Analysis by [email protected]
Feb. 03, 2026
Action Type Old Value New Value Added CVSS V3.1 AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H Added CWE CWE-401 Added CPE Configuration OR *cpe:2.3:o:linux:linux_kernel:6.4:rc1:*:*:*:*:*:* *cpe:2.3:o:linux:linux_kernel:6.4:rc2:*:*:*:*:*:* *cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:* versions from (including) 6.2 up to (excluding) 6.3.4 *cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:* versions from (including) 3.8 up to (excluding) 6.1.30 Added Reference Type kernel.org: https://git.kernel.org/stable/c/0d20210a190f76db9ec35ee4e0fc77e6c7a148f5 Types: Patch Added Reference Type kernel.org: https://git.kernel.org/stable/c/82b2bc279467c875ec36f8ef820f00997c2a4e8e Types: Patch Added Reference Type kernel.org: https://git.kernel.org/stable/c/9cae243b9ae25adfe468cd47ceca591f6725b79c Types: Patch -
New CVE Received by 416baaa9-dc9f-4396-8d5f-8c081fb06d67
Oct. 07, 2025
Action Type Old Value New Value Added Description In the Linux kernel, the following vulnerability has been resolved: tun: Fix memory leak for detached NAPI queue. syzkaller reported [0] memory leaks of sk and skb related to the TUN device with no repro, but we can reproduce it easily with: struct ifreq ifr = {} int fd_tun, fd_tmp; char buf[4] = {}; fd_tun = openat(AT_FDCWD, "/dev/net/tun", O_WRONLY, 0); ifr.ifr_flags = IFF_TUN | IFF_NAPI | IFF_MULTI_QUEUE; ioctl(fd_tun, TUNSETIFF, &ifr); ifr.ifr_flags = IFF_DETACH_QUEUE; ioctl(fd_tun, TUNSETQUEUE, &ifr); fd_tmp = socket(AF_PACKET, SOCK_PACKET, 0); ifr.ifr_flags = IFF_UP; ioctl(fd_tmp, SIOCSIFFLAGS, &ifr); write(fd_tun, buf, sizeof(buf)); close(fd_tun); If we enable NAPI and multi-queue on a TUN device, we can put skb into tfile->sk.sk_write_queue after the queue is detached. We should prevent it by checking tfile->detached before queuing skb. Note this must be done under tfile->sk.sk_write_queue.lock because write() and ioctl(IFF_DETACH_QUEUE) can run concurrently. Otherwise, there would be a small race window: write() ioctl(IFF_DETACH_QUEUE) `- tun_get_user `- __tun_detach |- if (tfile->detached) |- tun_disable_queue | `-> false | `- tfile->detached = tun | `- tun_queue_purge |- spin_lock_bh(&queue->lock) `- __skb_queue_tail(queue, skb) Another solution is to call tun_queue_purge() when closing and reattaching the detached queue, but it could paper over another problems. Also, we do the same kind of test for IFF_NAPI_FRAGS. [0]: unreferenced object 0xffff88801edbc800 (size 2048): comm "syz-executor.1", pid 33269, jiffies 4295743834 (age 18.756s) hex dump (first 32 bytes): 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ 00 00 07 40 00 00 00 00 00 00 00 00 00 00 00 00 ...@............ backtrace: [<000000008c16ea3d>] __do_kmalloc_node mm/slab_common.c:965 [inline] [<000000008c16ea3d>] __kmalloc+0x4a/0x130 mm/slab_common.c:979 [<000000003addde56>] kmalloc include/linux/slab.h:563 [inline] [<000000003addde56>] sk_prot_alloc+0xef/0x1b0 net/core/sock.c:2035 [<000000003e20621f>] sk_alloc+0x36/0x2f0 net/core/sock.c:2088 [<0000000028e43843>] tun_chr_open+0x3d/0x190 drivers/net/tun.c:3438 [<000000001b0f1f28>] misc_open+0x1a6/0x1f0 drivers/char/misc.c:165 [<000000004376f706>] chrdev_open+0x111/0x300 fs/char_dev.c:414 [<00000000614d379f>] do_dentry_open+0x2f9/0x750 fs/open.c:920 [<000000008eb24774>] do_open fs/namei.c:3636 [inline] [<000000008eb24774>] path_openat+0x143f/0x1a30 fs/namei.c:3791 [<00000000955077b5>] do_filp_open+0xce/0x1c0 fs/namei.c:3818 [<00000000b78973b0>] do_sys_openat2+0xf0/0x260 fs/open.c:1356 [<00000000057be699>] do_sys_open fs/open.c:1372 [inline] [<00000000057be699>] __do_sys_openat fs/open.c:1388 [inline] [<00000000057be699>] __se_sys_openat fs/open.c:1383 [inline] [<00000000057be699>] __x64_sys_openat+0x83/0xf0 fs/open.c:1383 [<00000000a7d2182d>] do_syscall_x64 arch/x86/entry/common.c:50 [inline] [<00000000a7d2182d>] do_syscall_64+0x3c/0x90 arch/x86/entry/common.c:80 [<000000004cc4e8c4>] entry_SYSCALL_64_after_hwframe+0x72/0xdc unreferenced object 0xffff88802f671700 (size 240): comm "syz-executor.1", pid 33269, jiffies 4295743854 (age 18.736s) hex dump (first 32 bytes): 68 c9 db 1e 80 88 ff ff 68 c9 db 1e 80 88 ff ff h.......h....... 00 c0 7b 2f 80 88 ff ff 00 c8 db 1e 80 88 ff ff ..{/............ backtrace: [<00000000e9d9fdb6>] __alloc_skb+0x223/0x250 net/core/skbuff.c:644 [<000000002c3e4e0b>] alloc_skb include/linux/skbuff.h:1288 [inline] [<000000002c3e4e0b>] alloc_skb_with_frags+0x6f/0x350 net/core/skbuff.c:6378 [<00000000825f98d7>] sock_alloc_send_pskb+0x3ac/0x3e0 net/core/sock.c:2729 [<00000000e9eb3df3>] tun_alloc_skb drivers/net/tun.c:1529 [inline] [< ---truncated--- Added Reference https://git.kernel.org/stable/c/0d20210a190f76db9ec35ee4e0fc77e6c7a148f5 Added Reference https://git.kernel.org/stable/c/82b2bc279467c875ec36f8ef820f00997c2a4e8e Added Reference https://git.kernel.org/stable/c/9cae243b9ae25adfe468cd47ceca591f6725b79c