Bug 2337105 (CVE-2024-57791)

Summary: CVE-2024-57791 kernel: net/smc: check return value of sock_recvmsg when draining clc data
Product: [Other] Security Response Reporter: OSIDB Bzimport <bzimport>
Component: vulnerabilityAssignee: Product Security DevOps Team <prodsec-dev>
Status: NEW --- QA Contact:
Severity: medium Docs Contact:
Priority: medium    
Version: unspecifiedCC: dfreiber, drow, jburrell, rhel-process-autobot, vkumar, watson-tool-maintainers
Target Milestone: ---Keywords: Security
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
A flaw was found in the Linux kernel's Shared Memory Communications (SMC) subsystem. When receiving Connection Layer Control (CLC) handshake messages, the kernel does not properly check return values when draining message data that exceeds the expected buffer length. A remote attacker or network peer can exploit this vulnerability by sending a malformed message, causing the kernel to enter an infinite loop and resulting in a Denial of Service (DoS).
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-01-11 13:02:00 UTC
In the Linux kernel, the following vulnerability has been resolved:

net/smc: check return value of sock_recvmsg when draining clc data

When receiving clc msg, the field length in smc_clc_msg_hdr indicates the
length of msg should be received from network and the value should not be
fully trusted as it is from the network. Once the value of length exceeds
the value of buflen in function smc_clc_wait_msg it may run into deadloop
when trying to drain the remaining data exceeding buflen.

This patch checks the return value of sock_recvmsg when draining data in
case of deadloop in draining.

Comment 1 Avinash Hanwate 2025-01-13 07:54:29 UTC
Upstream advisory:
https://lore.kernel.org/linux-cve-announce/2025011147-CVE-2024-57791-7bc8@gregkh/T