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 D4BA114A4D1 for ; Sat, 9 Nov 2024 10:17:38 +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=1731147458; cv=none; b=J3LYTZt6FiLRZFb6AzVlLve8k5rnsmt9ethauUFcLc8TzE0WZ8jKjZMROe4S2KgGRrxjkMzJqYSjtcU3Djl/UWDlofNOe3SzqkkAPp8azccgGU4rPAXAWfrCg4RRResnsZbRbyzRZLGa7ZSMP8c7DC3ogmNVi1vQs4mWTzw+DPk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1731147458; c=relaxed/simple; bh=hwh8QUBSH2/yU9Q5CDJENkxf6xvAeCYvH2cWLsGhLmI=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=gBn/NpFktt86CeaNtRWWbjVhFxgjvEHEh11hr5UfoNWXYTPvOU4Ck0anoeELWpoBrG1z5gicjv0MqYO9rq0LIMiS3NV0lHaXioArm8czGjJVWTaSx4E9499MY3LmHgRZEeHi9MnM7iajijVR56FG+6vZktUc7ppmtTH2WEKxhvk= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=Lp9M3X8k; 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="Lp9M3X8k" Received: by smtp.kernel.org (Postfix) with ESMTPSA id DBAD0C4CECE; Sat, 9 Nov 2024 10:17:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1731147458; bh=hwh8QUBSH2/yU9Q5CDJENkxf6xvAeCYvH2cWLsGhLmI=; h=From:To:Cc:Subject:Date:Reply-to:From; b=Lp9M3X8k4V4+eEgl6rb0tYXmcnMcnFSjSj9z+k/7JDB5dv7mgdZ8EKkx8S5hSoIfe GG+9z+qhaNacAlKid2kIuGSyHRTw9fx+mKu/VDyKZ6+J47PNxQXDfoH+t7L/8+vulK k6IfSJm/TBMZKWqlMmLIiUxbpjp3IG1+ZDBIhiuk= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2024-50253: bpf: Check the validity of nr_words in bpf_iter_bits_new() Date: Sat, 9 Nov 2024 11:16:01 +0100 Message-ID: <2024110937-CVE-2024-50253-7a6b@gregkh> X-Mailer: git-send-email 2.47.0 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=2309; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=hwh8QUBSH2/yU9Q5CDJENkxf6xvAeCYvH2cWLsGhLmI=; b=owGbwMvMwCRo6H6F97bub03G02pJDOn6Zp5FJcf28W1NWq/z4pAmm8HHh8mS3+cqbl+/6uFaJ sdHMrXrOmJZGASZGGTFFFm+bOM5ur/ikKKXoe1pmDmsTCBDGLg4BWAi+UsZ5nBzCjd8UhXcuPCm zyPBTmmfsvlKOQwLzjWtX/KCbcXqy+n7tXb3mM4JOn7oBwA= 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: bpf: Check the validity of nr_words in bpf_iter_bits_new() Check the validity of nr_words in bpf_iter_bits_new(). Without this check, when multiplication overflow occurs for nr_bits (e.g., when nr_words = 0x0400-0001, nr_bits becomes 64), stack corruption may occur due to bpf_probe_read_kernel_common(..., nr_bytes = 0x2000-0008). Fix it by limiting the maximum value of nr_words to 511. The value is derived from the current implementation of BPF memory allocator. To ensure compatibility if the BPF memory allocator's size limitation changes in the future, use the helper bpf_mem_alloc_check_size() to check whether nr_bytes is too larger. And return -E2BIG instead of -ENOMEM for oversized nr_bytes. The Linux kernel CVE team has assigned CVE-2024-50253 to this issue. Affected and fixed versions =========================== Issue introduced in 6.11 with commit 4665415975b0 and fixed in 6.11.7 with commit c9539e09c678 Issue introduced in 6.11 with commit 4665415975b0 and fixed in 6.12-rc6 with commit 393397fbdcad 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-50253 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: kernel/bpf/helpers.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/c9539e09c67880ecd88b51188c346a2cc078b06c https://git.kernel.org/stable/c/393397fbdcad7396639d7077c33f86169184ba99