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 A20BA145FE4 for ; Sat, 17 Aug 2024 09:23: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=1723886619; cv=none; b=fHBxCJSkpdv6uiQ9LXBZX2+/0/9SInBlaHIwjBMBWCcUNDbjXmE+w5iPmsICDqkJzE2zDIYYeDVX0YlGhigAVw12z5GyVA8H6OLEdkZN2KJYmapvYwaCHIPzjikDgdTQ5ID1K9UvGTpDVb2+/7toQsPamdiBeWsuL8lQMCF9tXw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1723886619; c=relaxed/simple; bh=wylnJVLBi7fJqtQDucRBZ1HCu1gkDoKYcAp+QxCM4ww=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=QDrypgZESIO7nONHRzXcyOb2OytqMW9fCfvJNInPCd8+kdnAxbtPkj8XHi8Oqx0C9mrknwQI4t8hsCaUbcG4wRrd2TI4KLTq26u5WSQ+nAcvKNSJ/GD66k+ySXKVYInVMlV9gWjkzOPFDepcbUQgkWyPuTEz9LErs2OOSIrA61s= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=hn7Yvgy1; 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="hn7Yvgy1" Received: by smtp.kernel.org (Postfix) with ESMTPSA id C9AF8C116B1; Sat, 17 Aug 2024 09:23:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1723886619; bh=wylnJVLBi7fJqtQDucRBZ1HCu1gkDoKYcAp+QxCM4ww=; h=From:To:Cc:Subject:Date:Reply-to:From; b=hn7Yvgy1T4CWB6Tt+3N4GmP4fVoBvedFnlDIrkYiaWH+16REPOB0S/bxR6njRGj8J DR2/T6de8yuVEvxP1Q25p5nMHP98Lt8B22cek+1t2kbKzbwW2EnbMA55oBEDK5KEl9 1EyBi6My8NBCxcPUyWrhU6tPc0JhiRAkbyg4tmI0= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2024-43843: riscv, bpf: Fix out-of-bounds issue when preparing trampoline image Date: Sat, 17 Aug 2024 11:22:47 +0200 Message-ID: <2024081731-CVE-2024-43843-e436@gregkh> X-Mailer: git-send-email 2.46.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=2272; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=wylnJVLBi7fJqtQDucRBZ1HCu1gkDoKYcAp+QxCM4ww=; b=owGbwMvMwCRo6H6F97bub03G02pJDGkHsq/P3WXmW3HjT5mY+KZ+9jX7Hrydn5C8dMuCo9vvZ CZu3nLjXUcsC4MgE4OsmCLLl208R/dXHFL0MrQ9DTOHlQlkCAMXpwBMxJCdYcGu03yaFRLfO+Lr WLq/Zj/VdW8IdWVY0PdiWa1M298vc8O+O/qWSB5XuVT+DwA= 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: riscv, bpf: Fix out-of-bounds issue when preparing trampoline image We get the size of the trampoline image during the dry run phase and allocate memory based on that size. The allocated image will then be populated with instructions during the real patch phase. But after commit 26ef208c209a ("bpf: Use arch_bpf_trampoline_size"), the `im` argument is inconsistent in the dry run and real patch phase. This may cause emit_imm in RV64 to generate a different number of instructions when generating the 'im' address, potentially causing out-of-bounds issues. Let's emit the maximum number of instructions for the "im" address during dry run to fix this problem. The Linux kernel CVE team has assigned CVE-2024-43843 to this issue. Affected and fixed versions =========================== Issue introduced in 6.8 with commit 26ef208c209a and fixed in 6.10.3 with commit 3e6a1b1b179a Issue introduced in 6.8 with commit 26ef208c209a and fixed in 6.11-rc1 with commit 9f1e16fb1fc9 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-43843 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: arch/riscv/net/bpf_jit_comp64.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/3e6a1b1b179abb643ec3560c02bc3082bc92285f https://git.kernel.org/stable/c/9f1e16fb1fc9826001c69e0551d51fbbcd2d74e9