Bug 2347907 (CVE-2022-49690)

Summary: CVE-2022-49690 kernel: net/tls: fix tls_sk_proto_close executed repeatedly
Product: [Other] Security Response Reporter: OSIDB Bzimport <bzimport>
Component: vulnerability-draftAssignee: Product Security DevOps Team <prodsec-dev>
Status: NEW --- QA Contact:
Severity: medium Docs Contact:
Priority: medium    
Version: unspecifiedCC: dfreiber, drow, jburrell, vkumar
Target Milestone: ---Keywords: Security
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
[REJECTED CVE] A vulnerability was identified in the net/tls module of the Linux kernel where the tls_sk_proto_close() function could be executed repeatedly during socket teardown due to improper protocol pointer handling in tls_update(). This recursive invocation could lead to a NULL pointer dereference and kernel panic. An attacker exploiting this flaw could potentially trigger a denial of service by forcing repeated close operations on a crafted TLS socket.
Story Points: ---
Clone Of: Environment:
Last Closed: Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description OSIDB Bzimport 2025-02-26 03:10:55 UTC
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:
 <TASK>
 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.

Comment 1 Avinash Hanwate 2025-02-26 13:48:40 UTC
Upstream advisory:
https://lore.kernel.org/linux-cve-announce/2025022627-CVE-2022-49690-2222@gregkh/T

Comment 4 Avinash Hanwate 2025-02-26 17:49:29 UTC
Upstream advisory:
https://lore.kernel.org/linux-cve-announce/2025022627-CVE-2022-49690-2222@gregkh/T

Comment 7 TEJ RATHI 2025-05-15 07:37:20 UTC
This CVE has been rejected upstream: https://lore.kernel.org/linux-cve-announce/2025022623-REJECTED-7011@gregkh/