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 BE0C9217666 for ; Thu, 27 Mar 2025 16:46:43 +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=1743094003; cv=none; b=ecfXMxWHt6Mjh/RX3Za9MyWMH9hSJZwxO82iXYThsLambHIGUBoeU6TehUuRMvmwVdFOrJ7ec6OdWeC8QMI9u2fr3Xgj1cN9htMJQHQFpdXotswVmbVc7NRyfWjBwy+tXCxwMo9JmCf2jc1Kazdvk1QpEdgYRTOwu4iH+gHpTkI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1743094003; c=relaxed/simple; bh=O0WYl0kDp4/LtqEEc0e5tB4TYP++stb7ImXU9kbfEmk=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=nBQpRJS9WeA9UvHIqAsY6ttXORbT3pzXioz1iyOJWTCZC1KNcKieJT86905fYRfqWQsSSsYpnubg3I7aW54A6WfrPM0/NrPtdkL0pMjZJMhuCKf7GaM7fXfmihvpHYycTntJQUSWo2uXOLScmzRSmJUYEXdFbhHw866ez5343FA= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=N5ARIJT0; 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="N5ARIJT0" Received: by smtp.kernel.org (Postfix) with ESMTPSA id BD095C4CEDD; Thu, 27 Mar 2025 16:46:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1743094003; bh=O0WYl0kDp4/LtqEEc0e5tB4TYP++stb7ImXU9kbfEmk=; h=From:To:Cc:Subject:Date:Reply-to:From; b=N5ARIJT0BOVS2h2KISi2Sg79cxeooa5Qai5hZbAtCOFJHRuvjqRn/p/GJmBINPoV7 eSmDldRYVsqVfaf6eK4m1b01B1eVaBazuucpupEBSUhYl/dE1CcNEpbm7KoPMq5z7T 5JFcij93Pot+HVqNBbArSv58xsxfM+HC9FOpMy/s= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2023-53020: l2tp: close all race conditions in l2tp_tunnel_register() Date: Thu, 27 Mar 2025 17:44:07 +0100 Message-ID: <2025032717-CVE-2023-53020-1042@gregkh> X-Mailer: git-send-email 2.49.0 Precedence: bulk X-Mailing-List: linux-cve-announce@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Reply-to: , X-Developer-Signature: v=1; a=openpgp-sha256; l=2718; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=O0WYl0kDp4/LtqEEc0e5tB4TYP++stb7ImXU9kbfEmk=; b=owGbwMvMwCRo6H6F97bub03G02pJDOlPG1SPyTA9PlhpbPGjQjnJuu6Ts5WrGVdPnJ37lCs/Z DNOXq3siGVhEGRikBVTZPmyjefo/opDil6Gtqdh5rAygQxh4OIUgInctmKYK/378kebKuv2j2fL ziavVNf8G5IfxLCg/9ruxKbOzI4C7oXXZ/Ld+xtv6/YdAA== X-Developer-Key: i=gregkh@linuxfoundation.org; a=openpgp; fpr=F4B60CC5BF78C2214A313DCB3147D40DDB2DFB29 Content-Transfer-Encoding: 8bit Description =========== In the Linux kernel, the following vulnerability has been resolved: l2tp: close all race conditions in l2tp_tunnel_register() The code in l2tp_tunnel_register() is racy in several ways: 1. It modifies the tunnel socket _after_ publishing it. 2. It calls setup_udp_tunnel_sock() on an existing socket without locking. 3. It changes sock lock class on fly, which triggers many syzbot reports. This patch amends all of them by moving socket initialization code before publishing and under sock lock. As suggested by Jakub, the l2tp lockdep class is not necessary as we can just switch to bh_lock_sock_nested(). The Linux kernel CVE team has assigned CVE-2023-53020 to this issue. Affected and fixed versions =========================== Issue introduced in 3.6 with commit 37159ef2c1ae1e696b24b260b241209a19f92c60 and fixed in 5.10.166 with commit 2d77e5c0ad79004b5ef901895437e9cce6dfcc7e Issue introduced in 3.6 with commit 37159ef2c1ae1e696b24b260b241209a19f92c60 and fixed in 5.15.91 with commit 77e8ed776cdb1a24b2aab8fe7c6f1f154235e1ce Issue introduced in 3.6 with commit 37159ef2c1ae1e696b24b260b241209a19f92c60 and fixed in 6.1.9 with commit cef0845b6dcfa2f6c2c832e7f9622551456c741d Issue introduced in 3.6 with commit 37159ef2c1ae1e696b24b260b241209a19f92c60 and fixed in 6.2 with commit 0b2c59720e65885a394a017d0cf9cab118914682 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-53020 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_core.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/2d77e5c0ad79004b5ef901895437e9cce6dfcc7e https://git.kernel.org/stable/c/77e8ed776cdb1a24b2aab8fe7c6f1f154235e1ce https://git.kernel.org/stable/c/cef0845b6dcfa2f6c2c832e7f9622551456c741d https://git.kernel.org/stable/c/0b2c59720e65885a394a017d0cf9cab118914682