{"id":"DEBIAN-CVE-2023-53685","details":"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-\u003esk.sk_write_queue after the queue is detached.  We should prevent it by checking tfile-\u003edetached before queuing skb.  Note this must be done under tfile-\u003esk.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-\u003edetached)             |- tun_disable_queue      |  `-\u003e false                        |  `- tfile-\u003edetached = tun      |                                   `- tun_queue_purge      |- spin_lock_bh(&queue-\u003elock)      `- __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:     [\u003c000000008c16ea3d\u003e] __do_kmalloc_node mm/slab_common.c:965 [inline]     [\u003c000000008c16ea3d\u003e] __kmalloc+0x4a/0x130 mm/slab_common.c:979     [\u003c000000003addde56\u003e] kmalloc include/linux/slab.h:563 [inline]     [\u003c000000003addde56\u003e] sk_prot_alloc+0xef/0x1b0 net/core/sock.c:2035     [\u003c000000003e20621f\u003e] sk_alloc+0x36/0x2f0 net/core/sock.c:2088     [\u003c0000000028e43843\u003e] tun_chr_open+0x3d/0x190 drivers/net/tun.c:3438     [\u003c000000001b0f1f28\u003e] misc_open+0x1a6/0x1f0 drivers/char/misc.c:165     [\u003c000000004376f706\u003e] chrdev_open+0x111/0x300 fs/char_dev.c:414     [\u003c00000000614d379f\u003e] do_dentry_open+0x2f9/0x750 fs/open.c:920     [\u003c000000008eb24774\u003e] do_open fs/namei.c:3636 [inline]     [\u003c000000008eb24774\u003e] path_openat+0x143f/0x1a30 fs/namei.c:3791     [\u003c00000000955077b5\u003e] do_filp_open+0xce/0x1c0 fs/namei.c:3818     [\u003c00000000b78973b0\u003e] do_sys_openat2+0xf0/0x260 fs/open.c:1356     [\u003c00000000057be699\u003e] do_sys_open fs/open.c:1372 [inline]     [\u003c00000000057be699\u003e] __do_sys_openat fs/open.c:1388 [inline]     [\u003c00000000057be699\u003e] __se_sys_openat fs/open.c:1383 [inline]     [\u003c00000000057be699\u003e] __x64_sys_openat+0x83/0xf0 fs/open.c:1383     [\u003c00000000a7d2182d\u003e] do_syscall_x64 arch/x86/entry/common.c:50 [inline]     [\u003c00000000a7d2182d\u003e] do_syscall_64+0x3c/0x90 arch/x86/entry/common.c:80     [\u003c000000004cc4e8c4\u003e] 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:     [\u003c00000000e9d9fdb6\u003e] __alloc_skb+0x223/0x250 net/core/skbuff.c:644     [\u003c000000002c3e4e0b\u003e] alloc_skb include/linux/skbuff.h:1288 [inline]     [\u003c000000002c3e4e0b\u003e] alloc_skb_with_frags+0x6f/0x350 net/core/skbuff.c:6378     [\u003c00000000825f98d7\u003e] sock_alloc_send_pskb+0x3ac/0x3e0 net/core/sock.c:2729     [\u003c00000000e9eb3df3\u003e] tun_alloc_skb drivers/net/tun.c:1529 [inline]     [\u003c ---truncated---","modified":"2026-09-15T09:02:52.035250185Z","published":"2025-10-07T16:15:52.777Z","upstream":["CVE-2023-53685"],"references":[{"type":"ADVISORY","url":"https://security-tracker.debian.org/tracker/CVE-2023-53685"}],"affected":[{"package":{"name":"linux","ecosystem":"Debian:12","purl":"pkg:deb/debian/linux?arch=source&distro=bookworm"},"ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"6.1.37-1"}]}],"versions":["6.1.27-1"],"ecosystem_specific":{"urgency":"not yet assigned"},"database_specific":{"source":"https://storage.googleapis.com/osv-test-debian-osv/debian-cve-osv/DEBIAN-CVE-2023-53685.json"}},{"package":{"name":"linux","ecosystem":"Debian:13","purl":"pkg:deb/debian/linux?arch=source&distro=trixie"},"ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"6.3.7-1"}]}],"ecosystem_specific":{"urgency":"not yet assigned"},"database_specific":{"source":"https://storage.googleapis.com/osv-test-debian-osv/debian-cve-osv/DEBIAN-CVE-2023-53685.json"}},{"package":{"name":"linux","ecosystem":"Debian:14","purl":"pkg:deb/debian/linux?arch=source&distro=forky"},"ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"6.3.7-1"}]}],"ecosystem_specific":{"urgency":"not yet assigned"},"database_specific":{"source":"https://storage.googleapis.com/osv-test-debian-osv/debian-cve-osv/DEBIAN-CVE-2023-53685.json"}}],"schema_version":"1.9.0","severity":[{"type":"CVSS_V3","score":"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H"}]}