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 68EE510A1F for ; Wed, 26 Feb 2025 02:27:29 +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=1740536849; cv=none; b=E3m9K/1q4aJ5U7OAfH8uG/lIgZswZA58eDQJdJnqDONyN8s7RkR52uPUqOQeiXyRdoPocOmrfutu3n67M4MTxRsEdrR2zKEmypNo5IQq0Y439GBZSPNCxYf8h0zjMFXyJ8QEhYuXsfL7P7kHFcRzTDanVnSl1BBHdDHNkzhn1So= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1740536849; c=relaxed/simple; bh=JS8IHzSSaLwTVH7mcljt+lHhqhyj3oBGo/RZ8NaEgIg=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=UN5nXuTCDG/9n31CKmxYkBIEXNQyzT+m8vQdsaphrTfGFthxHNcSrpQQM3V1X5bBofkk1uKpXVVwVnVXyhOfCXty3dVf0D5gKX8iy7SHBk/0+ybF70t8tbRMuEQFyzLFqSbu9Js0wm3hb84AovJezPAsiXu/ltnpoBP44NehPF0= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=FVXjbX0Q; 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="FVXjbX0Q" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 3EA83C4CEDD; Wed, 26 Feb 2025 02:27:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1740536849; bh=JS8IHzSSaLwTVH7mcljt+lHhqhyj3oBGo/RZ8NaEgIg=; h=From:To:Cc:Subject:Date:Reply-to:From; b=FVXjbX0QaITOwnOx16iWY1cxPWvyglb70iQTLjulazHpxphMo6UQ8Mc0EHxV9sbod vZA9D4dFGwIR7/tMJr3lLf/zPK1+T+MKTdNVa0wHhnetKPeWWn4veSMDwy6+xDZWNO Oyqp8RFkb3ckeEst/lkweV1TlBx1Ez3FfxIe/yMs= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2022-49690: net/tls: fix tls_sk_proto_close executed repeatedly Date: Wed, 26 Feb 2025 03:24:13 +0100 Message-ID: <2025022627-CVE-2022-49690-2222@gregkh> X-Mailer: git-send-email 2.48.1 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=3416; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=JS8IHzSSaLwTVH7mcljt+lHhqhyj3oBGo/RZ8NaEgIg=; b=owGbwMvMwCRo6H6F97bub03G02pJDOn7qh7vmbJNLjqP023pmsAp70WO+f+/d8LyVMyDvXvZn 7v9YXP80BHLwiDIxCArpsjyZRvP0f0VhxS9DG1Pw8xhZQIZwsDFKQAT0ZBnmKc/N+F68n+h+Xuz OtvenmaxslhqXcwwVyyh72v33y8zrRi7S7ueXhVas+D5PwA= 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: net/tls: fix tls_sk_proto_close executed repeatedly After setting the sock ktls, update ctx->sk_proto to sock->sk_prot by tls_update(), so now ctx->sk_proto->close is tls_sk_proto_close(). When close the sock, tls_sk_proto_close() is called for sock->sk_prot->close is tls_sk_proto_close(). But ctx->sk_proto->close() will be executed later in tls_sk_proto_close(). Thus tls_sk_proto_close() executed repeatedly occurred. That will trigger the following bug. ================================================================= KASAN: null-ptr-deref in range [0x0000000000000010-0x0000000000000017] RIP: 0010:tls_sk_proto_close+0xd8/0xaf0 net/tls/tls_main.c:306 Call Trace: tls_sk_proto_close+0x356/0xaf0 net/tls/tls_main.c:329 inet_release+0x12e/0x280 net/ipv4/af_inet.c:428 __sock_release+0xcd/0x280 net/socket.c:650 sock_close+0x18/0x20 net/socket.c:1365 Updating a proto which is same with sock->sk_prot is incorrect. Add proto and sock->sk_prot equality check at the head of tls_update() to fix it. The Linux kernel CVE team has assigned CVE-2022-49690 to this issue. Affected and fixed versions =========================== Issue introduced in 5.3 with commit 95fa145479fbc0a0c1fd3274ceb42ec03c042a4a and fixed in 5.4.202 with commit 05c6c36c79311d9a00a79f88647f83a7cf009624 Issue introduced in 5.3 with commit 95fa145479fbc0a0c1fd3274ceb42ec03c042a4a and fixed in 5.10.127 with commit e82376b632473790781a182b10823a4b5dbf6606 Issue introduced in 5.3 with commit 95fa145479fbc0a0c1fd3274ceb42ec03c042a4a and fixed in 5.15.51 with commit be64f54a0db2dbf399f3bca45458d06c833641f0 Issue introduced in 5.3 with commit 95fa145479fbc0a0c1fd3274ceb42ec03c042a4a and fixed in 5.18.8 with commit 9b95ee8990d9b4b6086c309632b9d0d576833abe Issue introduced in 5.3 with commit 95fa145479fbc0a0c1fd3274ceb42ec03c042a4a and fixed in 5.19 with commit 69135c572d1f84261a6de2a1268513a7e71753e2 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-2022-49690 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/tls/tls_main.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/05c6c36c79311d9a00a79f88647f83a7cf009624 https://git.kernel.org/stable/c/e82376b632473790781a182b10823a4b5dbf6606 https://git.kernel.org/stable/c/be64f54a0db2dbf399f3bca45458d06c833641f0 https://git.kernel.org/stable/c/9b95ee8990d9b4b6086c309632b9d0d576833abe https://git.kernel.org/stable/c/69135c572d1f84261a6de2a1268513a7e71753e2