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 408681F462D for ; Wed, 16 Apr 2025 14:16:46 +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=1744813007; cv=none; b=UW0QXO8IBwa46hZzwyS6GOsxBFPQhj3ZhNKeWGrFV+bufJir0dS2ziEdUfPumaWxbl/TLv4X0mf8ORlLt2vAjXFVsvRvRIg5xQiGYy1soppo8aY5HluXRxZvIFApLQHil6a9evhFHB6JSOBV2Jur132G13fM2QNYDsdsn+1Xn2U= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1744813007; c=relaxed/simple; bh=s4Xudjt7lIsxV0KEZMUTefX71LYgkyS3E3z6kTnDc+o=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=ko51ZDCwm1TMkNujyyU9ofB65n1EzyNMx578vR1Ubte0B/EUQh2C9N8ESLVeE8mIPCyakhJgSoaaEOZOO47owo1NbMp96jWjAYbWC7sYEwQiiZTRozMtcYmh8l5SJx8TP31oZ41ricJBkGNksLEDU7ACUH3xJtRHWfAvLTg6LZQ= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=b6z0+/2l; 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="b6z0+/2l" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 4B63FC4CEE2; Wed, 16 Apr 2025 14:16:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1744813006; bh=s4Xudjt7lIsxV0KEZMUTefX71LYgkyS3E3z6kTnDc+o=; h=From:To:Cc:Subject:Date:Reply-to:From; b=b6z0+/2lGCnN70ul4mEfWro/oxe8qvMuUTOBBCStVkYY1cJqBUB93h3te8ADUkmWq EW7VhbcjKtINTf7rd9ynH13Na0HkQ5jZtsLjNJk1pz2+V5uab4VORlRO1iVrRP6AXA uWiOmJmUCnSA6JDq6AZfYSjBMFC//vGiF8UQFm3I= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2025-22087: bpf: Fix array bounds error with may_goto Date: Wed, 16 Apr 2025 16:12:58 +0200 Message-ID: <2025041616-CVE-2025-22087-d711@gregkh> X-Mailer: git-send-email 2.49.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=2799; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=s4Xudjt7lIsxV0KEZMUTefX71LYgkyS3E3z6kTnDc+o=; b=owGbwMvMwCRo6H6F97bub03G02pJDOn/dx2oCvqfuG/H2/ZPfhN2+Vi6MvxR/Oss1GWXtstVa luYZOKWjlgWBkEmBlkxRZYv23iO7q84pOhlaHsaZg4rE8gQBi5OAZjIol8M87OvGVjtTLpkPk/z 7SwB0/1fJdedu8CwYJedlmnF8ijHB8v49vb7r3SYeGXGWQA= 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: Fix array bounds error with may_goto may_goto uses an additional 8 bytes on the stack, which causes the interpreters[] array to go out of bounds when calculating index by stack_size. 1. If a BPF program is rewritten, re-evaluate the stack size. For non-JIT cases, reject loading directly. 2. For non-JIT cases, calculating interpreters[idx] may still cause out-of-bounds array access, and just warn about it. 3. For jit_requested cases, the execution of bpf_func also needs to be warned. So move the definition of function __bpf_prog_ret0_warn out of the macro definition CONFIG_BPF_JIT_ALWAYS_ON. The Linux kernel CVE team has assigned CVE-2025-22087 to this issue. Affected and fixed versions =========================== Issue introduced in 6.9 with commit 011832b97b311bb9e3c27945bc0d1089a14209c9 and fixed in 6.12.23 with commit 19e6817f84000d0b06f09fd69ebd56217842c122 Issue introduced in 6.9 with commit 011832b97b311bb9e3c27945bc0d1089a14209c9 and fixed in 6.13.11 with commit 4524b7febdd55fb99ae2e1f48db64019fa69e643 Issue introduced in 6.9 with commit 011832b97b311bb9e3c27945bc0d1089a14209c9 and fixed in 6.14.2 with commit 1a86ae57b2600e5749f5f674e9d4296ac00c69a8 Issue introduced in 6.9 with commit 011832b97b311bb9e3c27945bc0d1089a14209c9 and fixed in 6.15-rc1 with commit 6ebc5030e0c5a698f1dd9a6684cddf6ccaed64a0 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-2025-22087 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/core.c 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/19e6817f84000d0b06f09fd69ebd56217842c122 https://git.kernel.org/stable/c/4524b7febdd55fb99ae2e1f48db64019fa69e643 https://git.kernel.org/stable/c/1a86ae57b2600e5749f5f674e9d4296ac00c69a8 https://git.kernel.org/stable/c/6ebc5030e0c5a698f1dd9a6684cddf6ccaed64a0