CVE-2024-57791
Published: 11 January 2025
Description
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.
Security Summary
CVE-2024-57791 is a denial-of-service vulnerability in the Linux kernel's net/smc (Shared Memory Communications) component. When processing CLC (Common Link Control) messages received over the network, the kernel uses an untrusted length field from the smc_clc_msg_hdr structure to determine the amount of data to drain. If this length exceeds the available buffer length (buflen) in the smc_clc_wait_msg function, the draining process can enter an infinite loop, or "deadloop," because the return value of sock_recvmsg is not checked.
The vulnerability has a CVSS v3.1 base score of 7.5 (AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H), indicating it is exploitable remotely over the network with low complexity, no privileges or user interaction required. An unauthenticated attacker can send a specially crafted CLC message to a system with SMC enabled, triggering the deadloop during data draining and causing high availability impact, such as kernel hangs or system crashes.
Mitigation is provided through upstream patches in Linux kernel stable trees, as detailed in the referenced commits (e.g., 6b80924af6216277892d5f091f5bfc7d1265fa28, 7a6927814b4256d603e202ae7c5e38db3b338896). These patches add checks for the return value of sock_recvmsg during the draining of excess CLC data, preventing the infinite loop. Security practitioners should apply the relevant stable kernel updates to affected versions.
Details
- CWE(s)