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 3B5A32F85B for ; Tue, 9 Dec 2025 01:32:22 +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=1765243942; cv=none; b=u2vcOZ5Fuldhg5j1iXdrwDpnSBXLbJMCDx7NE1n6Cztlnwl9JTStFUYGiN53a34kk83n0wXQq8L0cQfmXuxCDyd3URy+ayBdKRLR574TNoyuxs0OpQX6L9NfWvLeJG16cQYBZfP/QBGuIwSx+4JR4XYs9rT3IYC44yLBHv90nsg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1765243942; c=relaxed/simple; bh=+yNP9LNBa7v0TDMwjvZiteN/2emp/JBtPtijIpmhvcM=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=CrUqmhH844EMhsprSOjRfmKXaDojeXGZOCzc8Fnd2uhv9+gWImvU42BGF/oyp9gq6wlHpZzqcmpG8oBa4wBVNC5SVF9mtggpatmNOnTDgw4OuHHGuXmIt34oPvuvN/6ESd7qOKMQrE54jdM7uYFiIMSUWKTuoDXqxSIvEi4rAEg= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=XLv/WjbB; 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="XLv/WjbB" Received: by smtp.kernel.org (Postfix) with ESMTPSA id C5256C4CEF1; Tue, 9 Dec 2025 01:32:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1765243942; bh=+yNP9LNBa7v0TDMwjvZiteN/2emp/JBtPtijIpmhvcM=; h=From:To:Cc:Subject:Date:Reply-To:From; b=XLv/WjbBcmqFNbY+gMLn2bODR1HWat6cjh0NF7giEE1Vg1MpfLU/pEMsOGZ3UbBE2 L5pbGASdws/xaa6iasnuBxobmODwNOJlHR9+p/iMDOAT1SKlemdoNzwViUhu+fDqlK nADMgBDUXTsvcU4kSkWlFosIqihCHqnQY/kq7iq4= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2023-53825: kcm: Fix error handling for SOCK_DGRAM in kcm_sendmsg(). Date: Tue, 9 Dec 2025 10:31:09 +0900 Message-ID: <2025120951-CVE-2023-53825-1018@gregkh> X-Mailer: git-send-email 2.52.0 Reply-To: , Precedence: bulk X-Mailing-List: linux-cve-announce@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=3936; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=of/vqG2xhz/PEyORAvpLt62CrnaXUY8EkdVeGKjwMPE=; b=owGbwMvMwCRo6H6F97bub03G02pJDJnm1ad1qm5IrCtZPO+LlEHx6cYT2XZz+W6vmSx457uET fuj3H0LO2JZGASZGGTFFFm+bOM5ur/ikKKXoe1pmDmsTCBDGLg4BWAiuicY5krPa+BYmLDGxcAh q9tSSpV1W4H0V4b5/hf0Zu4we3BdJittT07A24fct44eBQA= X-Developer-Key: i=gregkh@linuxfoundation.org; a=openpgp; fpr=F4B60CC5BF78C2214A313DCB3147D40DDB2DFB29 Content-Transfer-Encoding: 8bit From: Greg Kroah-Hartman Description =========== In the Linux kernel, the following vulnerability has been resolved: kcm: Fix error handling for SOCK_DGRAM in kcm_sendmsg(). syzkaller found a memory leak in kcm_sendmsg(), and commit c821a88bd720 ("kcm: Fix memory leak in error path of kcm_sendmsg()") suppressed it by updating kcm_tx_msg(head)->last_skb if partial data is copied so that the following sendmsg() will resume from the skb. However, we cannot know how many bytes were copied when we get the error. Thus, we could mess up the MSG_MORE queue. When kcm_sendmsg() fails for SOCK_DGRAM, we should purge the queue as we do so for UDP by udp_flush_pending_frames(). Even without this change, when the error occurred, the following sendmsg() resumed from a wrong skb and the queue was messed up. However, we have yet to get such a report, and only syzkaller stumbled on it. So, this can be changed safely. Note this does not change SOCK_SEQPACKET behaviour. The Linux kernel CVE team has assigned CVE-2023-53825 to this issue. Affected and fixed versions =========================== Issue introduced in 4.6 with commit ab7ac4eb9832e32a09f4e8042705484d2fb0aad3 and fixed in 4.14.326 with commit 21b467735b0888a8daa048f83d3b9b50fdab71ce Issue introduced in 4.6 with commit ab7ac4eb9832e32a09f4e8042705484d2fb0aad3 and fixed in 4.19.295 with commit d4b8f380b0a041ee6a84fdac14127d8fe1dcad7b Issue introduced in 4.6 with commit ab7ac4eb9832e32a09f4e8042705484d2fb0aad3 and fixed in 5.4.257 with commit 1ce8362b4ac6b8e65fd04a22ea37ec776ee1ec5b Issue introduced in 4.6 with commit ab7ac4eb9832e32a09f4e8042705484d2fb0aad3 and fixed in 5.10.195 with commit 2e18493c421428a936946c452461b8e979088f17 Issue introduced in 4.6 with commit ab7ac4eb9832e32a09f4e8042705484d2fb0aad3 and fixed in 5.15.132 with commit 55d2e7c1ab8eaa7b62575b8a4194132795d1f9fc Issue introduced in 4.6 with commit ab7ac4eb9832e32a09f4e8042705484d2fb0aad3 and fixed in 6.1.54 with commit e5b28ce127a690f3acc49a6a342e6c9442c9edd6 Issue introduced in 4.6 with commit ab7ac4eb9832e32a09f4e8042705484d2fb0aad3 and fixed in 6.5.4 with commit 992b2ac783aad360b98ed9d4686e86176a20f6f1 Issue introduced in 4.6 with commit ab7ac4eb9832e32a09f4e8042705484d2fb0aad3 and fixed in 6.6 with commit a22730b1b4bf437c6bbfdeff5feddf54be4aeada 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-53825 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/kcm/kcmsock.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/21b467735b0888a8daa048f83d3b9b50fdab71ce https://git.kernel.org/stable/c/d4b8f380b0a041ee6a84fdac14127d8fe1dcad7b https://git.kernel.org/stable/c/1ce8362b4ac6b8e65fd04a22ea37ec776ee1ec5b https://git.kernel.org/stable/c/2e18493c421428a936946c452461b8e979088f17 https://git.kernel.org/stable/c/55d2e7c1ab8eaa7b62575b8a4194132795d1f9fc https://git.kernel.org/stable/c/e5b28ce127a690f3acc49a6a342e6c9442c9edd6 https://git.kernel.org/stable/c/992b2ac783aad360b98ed9d4686e86176a20f6f1 https://git.kernel.org/stable/c/a22730b1b4bf437c6bbfdeff5feddf54be4aeada