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 66F0D3A1AB for ; Fri, 17 May 2024 13:41:57 +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=1715953317; cv=none; b=dCovvDtx/cGq4MJCJmhtixyDNQAYqTDzTLKNk+uWTazA7ZCIR0pMpfGPbT6HRVXzCLQZvLs+w65i/2fXI4jjF7U8A7t/H2oH6R5x2YhnuO8GHQYSAUvG74o0zCCz6TadyxhVW1+TgBVAZvrg02gCheY+e8Djg2TV0Bzib5PbCWs= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715953317; c=relaxed/simple; bh=olj5j0nT1tRCR42RXdSpluxqtDfOE3htsfs9I6R6oy4=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=e9pqDYWPA0D7NoSz1rZLqMTGYfqRWc49vSUUvHrL3SGchNgaGO+XdY4G1Ry9kbxT1er6yFa1XzfDA5mud7kcMuqUXjmtXrV+emr9C1+LUkxyk0cd8MIfnzCHer6KFE2N2gGl0+4ypIv9OFp8NLuI60vTzMSoiKYjvP4HXWRO/gg= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=Lw+1DwQz; 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="Lw+1DwQz" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 9449EC2BD10; Fri, 17 May 2024 13:41:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1715953317; bh=olj5j0nT1tRCR42RXdSpluxqtDfOE3htsfs9I6R6oy4=; h=From:To:Cc:Subject:Date:Reply-to:From; b=Lw+1DwQzOHM3LRWimR0B7f1dLxPGFyzfoQcUFOHgwjOW2/Wqlmb/X7mL++sgXO6f6 4EucYi/RlcEyS1oHdmOEN+Bbs+Kta4Wwq6dchvCaK0CwcRsoWN7srHT5NA8nNa6Sk2 M/441UmV/5T9gqSJS0autH4aTZQw+YChpYcF6cuE= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2024-35827: io_uring/net: fix overflow check in io_recvmsg_mshot_prep() Date: Fri, 17 May 2024 15:41:42 +0200 Message-ID: <2024051741-CVE-2024-35827-822c@gregkh> X-Mailer: git-send-email 2.45.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=2802; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=olj5j0nT1tRCR42RXdSpluxqtDfOE3htsfs9I6R6oy4=; b=owGbwMvMwCRo6H6F97bub03G02pJDGnucVPLfJ+fm2nNePTjbYmCd1orHbxvTrwxh4VR+lG2t 6Nnbbp5RywLgyATg6yYIsuXbTxH91ccUvQytD0NM4eVCWQIAxenAEzEdwLDggVLEny9tAIsl9vO EsxfH+RhUJHbxzA/ODxlrul5Zonr3/8fUvWS830o8k0KAA== 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: io_uring/net: fix overflow check in io_recvmsg_mshot_prep() The "controllen" variable is type size_t (unsigned long). Casting it to int could lead to an integer underflow. The check_add_overflow() function considers the type of the destination which is type int. If we add two positive values and the result cannot fit in an integer then that's counted as an overflow. However, if we cast "controllen" to an int and it turns negative, then negative values *can* fit into an int type so there is no overflow. Good: 100 + (unsigned long)-4 = 96 <-- overflow Bad: 100 + (int)-4 = 96 <-- no overflow I deleted the cast of the sizeof() as well. That's not a bug but the cast is unnecessary. The Linux kernel CVE team has assigned CVE-2024-35827 to this issue. Affected and fixed versions =========================== Issue introduced in 6.0 with commit 9b0fc3c054ff and fixed in 6.1.83 with commit 868ec8686164 Issue introduced in 6.0 with commit 9b0fc3c054ff and fixed in 6.6.23 with commit 59a534690ecc Issue introduced in 6.0 with commit 9b0fc3c054ff and fixed in 6.7.11 with commit 0c8c74bb59e7 Issue introduced in 6.0 with commit 9b0fc3c054ff and fixed in 6.8.2 with commit b6563ad0d599 Issue introduced in 6.0 with commit 9b0fc3c054ff and fixed in 6.9 with commit 8ede3db5061b 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-2024-35827 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: io_uring/net.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/868ec868616438df487b9e2baa5a99f8662cc47c https://git.kernel.org/stable/c/59a534690ecc3af72c6ab121aeac1237a4adae66 https://git.kernel.org/stable/c/0c8c74bb59e7d77554016efc34c2d10376985e5e https://git.kernel.org/stable/c/b6563ad0d599110bd5cf8f56c47d279c3ed796fe https://git.kernel.org/stable/c/8ede3db5061bb1fe28e2c9683329aafa89d2b1b4