Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 0CE97BA3D for ; Tue, 9 Dec 2025 00:04:31 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1765238671; cv=none; b=KD7OjdPkiZglXYwWoZRu2jD4y9tMwxSiHLuK/n3Ch8YkhhgFGCRb47PexPPWJiOPUtZNB4GwLslwPm6rFjXml80DXeLQTG5CImQlwa3v5kTVuXrcw2RC1wfQtwHmtOocmZNwQiA0NpjPFBBJRaTbDrkN0YPdXIoYkmF5nuLXUCE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1765238671; c=relaxed/simple; bh=wqOcLvJz0oLxz0qiuDSJc/XHuxbcEoVJmyUINJU+UtQ=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=cOaMbR18/bJywf1bRm2pc+ijuUOZe0euBLngce0s8SAQ+RRp1KIqqox2kyMYOWkHS5cWb0HAkoW33TD7hSdfRoHjRimok3U29MZzPM0xIZ9kveA7jqlGPvIXsIgYO5AvbCxFubzEOTHy7EoCf24KC5rCTaMrOBdgtD5SlkG1Vm8= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=oEuUh6/t; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="oEuUh6/t" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 62853C19421; Tue, 9 Dec 2025 00:04:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1765238670; bh=wqOcLvJz0oLxz0qiuDSJc/XHuxbcEoVJmyUINJU+UtQ=; h=From:To:Cc:Subject:Date:Reply-To:From; b=oEuUh6/tLDtIzfV/TFQpiXDSg7dPgeiAGCU9yFIcru/ooyA5W1mB8KfcTwW+Dl0Md tdaoRG6UYCISNzS9z5v1djQm048CUJVQFooJcDd2kZS0oGv0lTE2Rc4BekHXar4HT8 RURmT/90xGyeq2o6Gd8WPleAs3i61orueWMPVZyY= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2023-53809: l2tp: Avoid possible recursive deadlock in l2tp_tunnel_register() Date: Tue, 9 Dec 2025 09:02:30 +0900 Message-ID: <2025120944-CVE-2023-53809-ca78@gregkh> X-Mailer: git-send-email 2.52.0 Reply-To: , Precedence: bulk X-Mailing-List: linux-cve-announce@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=5674; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=vpkYrp2IIHsOZPW/MgtbE8HG76n/iLaFfQovv4InLc4=; b=owGbwMvMwCRo6H6F97bub03G02pJDJnmaS+4QzW3tC09eFNwMsOnefp742/Nz7QV9Do37ZFn/ fqrHvW7OmJZGASZGGTFFFm+bOM5ur/ikKKXoe1pmDmsTCBDGLg4BWAi8VEM84vzwuRsmyM810zv V549Jfn9p/PqixkWrPAVtMrWttuXIrnjr++bBcu3WkQIAwA= X-Developer-Key: i=gregkh@linuxfoundation.org; a=openpgp; fpr=F4B60CC5BF78C2214A313DCB3147D40DDB2DFB29 Content-Transfer-Encoding: 8bit From: Greg Kroah-Hartman Description =========== In the Linux kernel, the following vulnerability has been resolved: l2tp: Avoid possible recursive deadlock in l2tp_tunnel_register() When a file descriptor of pppol2tp socket is passed as file descriptor of UDP socket, a recursive deadlock occurs in l2tp_tunnel_register(). This situation is reproduced by the following program: int main(void) { int sock; struct sockaddr_pppol2tp addr; sock = socket(AF_PPPOX, SOCK_DGRAM, PX_PROTO_OL2TP); if (sock < 0) { perror("socket"); return 1; } addr.sa_family = AF_PPPOX; addr.sa_protocol = PX_PROTO_OL2TP; addr.pppol2tp.pid = 0; addr.pppol2tp.fd = sock; addr.pppol2tp.addr.sin_family = PF_INET; addr.pppol2tp.addr.sin_port = htons(0); addr.pppol2tp.addr.sin_addr.s_addr = inet_addr("192.168.0.1"); addr.pppol2tp.s_tunnel = 1; addr.pppol2tp.s_session = 0; addr.pppol2tp.d_tunnel = 0; addr.pppol2tp.d_session = 0; if (connect(sock, (const struct sockaddr *)&addr, sizeof(addr)) < 0) { perror("connect"); return 1; } return 0; } This program causes the following lockdep warning: ============================================ WARNING: possible recursive locking detected 6.2.0-rc5-00205-gc96618275234 #56 Not tainted -------------------------------------------- repro/8607 is trying to acquire lock: ffff8880213c8130 (sk_lock-AF_PPPOX){+.+.}-{0:0}, at: l2tp_tunnel_register+0x2b7/0x11c0 but task is already holding lock: ffff8880213c8130 (sk_lock-AF_PPPOX){+.+.}-{0:0}, at: pppol2tp_connect+0xa82/0x1a30 other info that might help us debug this: Possible unsafe locking scenario: CPU0 ---- lock(sk_lock-AF_PPPOX); lock(sk_lock-AF_PPPOX); *** DEADLOCK *** May be due to missing lock nesting notation 1 lock held by repro/8607: #0: ffff8880213c8130 (sk_lock-AF_PPPOX){+.+.}-{0:0}, at: pppol2tp_connect+0xa82/0x1a30 stack backtrace: CPU: 0 PID: 8607 Comm: repro Not tainted 6.2.0-rc5-00205-gc96618275234 #56 Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.16.1-2.fc37 04/01/2014 Call Trace: dump_stack_lvl+0x100/0x178 __lock_acquire.cold+0x119/0x3b9 ? lockdep_hardirqs_on_prepare+0x410/0x410 lock_acquire+0x1e0/0x610 ? l2tp_tunnel_register+0x2b7/0x11c0 ? lock_downgrade+0x710/0x710 ? __fget_files+0x283/0x3e0 lock_sock_nested+0x3a/0xf0 ? l2tp_tunnel_register+0x2b7/0x11c0 l2tp_tunnel_register+0x2b7/0x11c0 ? sprintf+0xc4/0x100 ? l2tp_tunnel_del_work+0x6b0/0x6b0 ? debug_object_deactivate+0x320/0x320 ? lockdep_init_map_type+0x16d/0x7a0 ? lockdep_init_map_type+0x16d/0x7a0 ? l2tp_tunnel_create+0x2bf/0x4b0 ? l2tp_tunnel_create+0x3c6/0x4b0 pppol2tp_connect+0x14e1/0x1a30 ? pppol2tp_put_sk+0xd0/0xd0 ? aa_sk_perm+0x2b7/0xa80 ? aa_af_perm+0x260/0x260 ? bpf_lsm_socket_connect+0x9/0x10 ? pppol2tp_put_sk+0xd0/0xd0 __sys_connect_file+0x14f/0x190 __sys_connect+0x133/0x160 ? __sys_connect_file+0x190/0x190 ? lockdep_hardirqs_on+0x7d/0x100 ? ktime_get_coarse_real_ts64+0x1b7/0x200 ? ktime_get_coarse_real_ts64+0x147/0x200 ? __audit_syscall_entry+0x396/0x500 __x64_sys_connect+0x72/0xb0 do_syscall_64+0x38/0xb0 entry_SYSCALL_64_after_hwframe+0x63/0xcd This patch fixes the issue by getting/creating the tunnel before locking the pppol2tp socket. The Linux kernel CVE team has assigned CVE-2023-53809 to this issue. Affected and fixed versions =========================== Issue introduced in 5.10.166 with commit 2d77e5c0ad79004b5ef901895437e9cce6dfcc7e and fixed in 5.10.173 with commit 4a413d360959962995e16a899cf2b9ef53e9fcb9 Issue introduced in 5.15.91 with commit 77e8ed776cdb1a24b2aab8fe7c6f1f154235e1ce and fixed in 5.15.99 with commit f6df58aa15f7d469f69b1dd21b001ff483255244 Issue introduced in 6.1.9 with commit cef0845b6dcfa2f6c2c832e7f9622551456c741d and fixed in 6.1.16 with commit 4bb736b40475528ac1aa8c98b368563618488a70 Issue introduced in 6.2 with commit 0b2c59720e65885a394a017d0cf9cab118914682 and fixed in 6.2.3 with commit 5370647dd745bb3d8f37057006be207ddd8e9314 Issue introduced in 6.2 with commit 0b2c59720e65885a394a017d0cf9cab118914682 and fixed in 6.3 with commit 9ca5e7ecab064f1f47da07f7c1ddf40e4bc0e5ac Please see https://www.kernel.org for a full list of currently supported kernel versions by the kernel community. Unaffected versions might change over time as fixes are backported to older supported kernel versions. The official CVE entry at https://cve.org/CVERecord/?id=CVE-2023-53809 will be updated if fixes are backported, please check that for the most up to date information about this issue. Affected files ============== The file(s) affected by this issue are: net/l2tp/l2tp_ppp.c Mitigation ========== The Linux kernel CVE team recommends that you update to the latest stable kernel version for this, and many other bugfixes. Individual changes are never tested alone, but rather are part of a larger kernel release. Cherry-picking individual commits is not recommended or supported by the Linux kernel community at all. If however, updating to the latest release is impossible, the individual changes to resolve this issue can be found at these commits: https://git.kernel.org/stable/c/4a413d360959962995e16a899cf2b9ef53e9fcb9 https://git.kernel.org/stable/c/f6df58aa15f7d469f69b1dd21b001ff483255244 https://git.kernel.org/stable/c/4bb736b40475528ac1aa8c98b368563618488a70 https://git.kernel.org/stable/c/5370647dd745bb3d8f37057006be207ddd8e9314 https://git.kernel.org/stable/c/9ca5e7ecab064f1f47da07f7c1ddf40e4bc0e5ac