From mboxrd@z Thu Jan 1 00:00:00 1970 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 893AB5E060 for ; Fri, 17 May 2024 14:27:39 +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=1715956059; cv=none; b=sz63dfy+5ukiOub75xHhgCYc+lrFGlEOasdVMXmKsQzTRuJXjSC1Jw3fLiviEr3QDOkpcDIY6jfvjjB/yB1xRGS0Dp90cbjQpqaBjw45xvsTeu05vEhcMViRXrS7Scm5RAUtOKasi1x0MHkJCm3p7ZfkgvmXY0jjNIYBGwA8KXM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715956059; c=relaxed/simple; bh=iw+sifzhsgH/kK4hmLfL/kJMmXJ8eT2BHFT9GFb6bV8=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=TsgAp2adKV9eIIdrPeNaEhLSr627HawWx286aS3KTdqe6vlO/8L4nTWwb8tSLmlLUB1oMFrmOlhCabk3USxMr9p+ZG8WOKPCbyhprjmtdGG9b960ndaQmKIBiHZ1oxPGSKDa5enAISjsKFpLwZB4vw0Xu7uCBiTwOTGeP6TrgR8= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=lWjd02Rh; 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="lWjd02Rh" Received: by smtp.kernel.org (Postfix) with ESMTPSA id B84DEC2BD11; Fri, 17 May 2024 14:27:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1715956059; bh=iw+sifzhsgH/kK4hmLfL/kJMmXJ8eT2BHFT9GFb6bV8=; h=From:To:Cc:Subject:Date:Reply-to:From; b=lWjd02Rhfiml1TKhbN337bygIlZlI3yzxJUJkptJIuCUk+zWJlroNL7M4RUQHP56Z n/gEatPZdAUBQikOR+tM5sE3biZX0CTQ6K4b8CP4NnBbkfbERLJRfoIHHawH4IqRxC Q0Pm4lbmVElvaD1MrvFNOv30+8vR81i8DGujPw1I= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2023-52676: bpf: Guard stack limits against 32bit overflow Date: Fri, 17 May 2024 16:26:49 +0200 Message-ID: <2024051749-CVE-2023-52676-e224@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=2624; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=iw+sifzhsgH/kK4hmLfL/kJMmXJ8eT2BHFT9GFb6bV8=; b=owGbwMvMwCRo6H6F97bub03G02pJDGnumZqpvpKJE+5tcFudm9+6IUTps79Uy/6n29d6rJnxV uy8caFqRywLgyATg6yYIsuXbTxH91ccUvQytD0NM4eVCWQIAxenAExEy4FhvoPjx87lDK3PO05u NmMImVtZftU/mmF+xPpvqezv2Fy2PPmlccUp++ctpZnHAQ== 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: Guard stack limits against 32bit overflow This patch promotes the arithmetic around checking stack bounds to be done in the 64-bit domain, instead of the current 32bit. The arithmetic implies adding together a 64-bit register with a int offset. The register was checked to be below 1<<29 when it was variable, but not when it was fixed. The offset either comes from an instruction (in which case it is 16 bit), from another register (in which case the caller checked it to be below 1<<29 [1]), or from the size of an argument to a kfunc (in which case it can be a u32 [2]). Between the register being inconsistently checked to be below 1<<29, and the offset being up to an u32, it appears that we were open to overflowing the `int`s which were currently used for arithmetic. [1] https://github.com/torvalds/linux/blob/815fb87b753055df2d9e50f6cd80eb10235fe3e9/kernel/bpf/verifier.c#L7494-L7498 [2] https://github.com/torvalds/linux/blob/815fb87b753055df2d9e50f6cd80eb10235fe3e9/kernel/bpf/verifier.c#L11904 The Linux kernel CVE team has assigned CVE-2023-52676 to this issue. Affected and fixed versions =========================== Fixed in 6.6.14 with commit ad140fc856f0 Fixed in 6.7.2 with commit e5ad9ecb8440 Fixed in 6.8 with commit 1d38a9ee8157 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-52676 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/verifier.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/ad140fc856f0b1d5e2215bcb6d0cc247a86805a2 https://git.kernel.org/stable/c/e5ad9ecb84405637df82732ee02ad741a5f782a6 https://git.kernel.org/stable/c/1d38a9ee81570c4bd61f557832dead4d6f816760