Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1793026356; b=uM7+gGngTCgT2RPHATwZQY7iFIwYD01OhsVi3p99yGf5T/F7sNDX7327V28X/L57bQJ9 FR780tQdaq7seevvZT8Hro6TvhOqaw2RcRn3kKBIH8cz900MKKo+8Ka8YL21kDobHN021 ktXRcTd9bdxdZ6HqbC72WvJazIWp8WtBbacyKlvAKOBc1if3VQo/XL7IDpqNr0Rrl/6Px CNuMn0r3vTMCqlO6gDDp9pP0J5Nlvhvj+t/r24lG/ZQn4JHu0iIis9UtPo6C7GvvfBTBK sgG9xpUflGN11n1wNjSJVu+yUnA9OExD+K9Q+6rggAm3jdmIdePqYyDTn6GaZ3vOThg== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1793026356; h=Received:DKIM-Signature:From:To:Cc:Subject:Date:Message-ID:X-Mailer: Reply-To:MIME-Version:Lines:X-Developer-Signature:X-Developer-Key: Content-Transfer-Encoding; bh=qaNzYi+BrFAbDVlNaRV0bIzHX2crtAnLF5TvdLhmNFM=; b=MasYSrPwyve0HqqXnhbXesvrk2oriy164XmKlYvK9y9EFMBk7fB8+7B7N7C7jCDQbPgY Dsq6DoGDn/yGNXIpOfqgHWsL7/IeVplLsrXWgqCHc5Za3nee+aSQ5C93QQs8oTJUZcD+6 DBt1uOWW67nhsCUuGB7DKStaTI2k/hb18OafQ38K+x68vPd8mscfnDukwAQXIKuTDMJqN Ay7/7CLSSN2NLUkroQw61lDUMZmgI5UmgYci1z2TwPxUFAsinC/X6Y2WhtI51vQNo6Fyb R2dxSxrD3N2STRWHW5vzco67IQZ+fc2zuBOO4LD5HnaSpJklPHoxDn02qT9RbF/aIsw== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=linuxfoundation.org header.i=@linuxfoundation.org header.a=rsa-sha256 header.s=korg header.b=VOJhjgOy; arc=none smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 82A94606A322 for ; Mon, 26 Oct 2026 14:52:35 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key, unprotected) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.a=rsa-sha256 header.s=korg header.b=VOJhjgOy Received: by smtp.kernel.org (Postfix) with ESMTPSA id D41A41F031E5; Mon, 26 Oct 2026 14:52:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1793026355; bh=qaNzYi+BrFAbDVlNaRV0bIzHX2crtAnLF5TvdLhmNFM=; h=From:To:Cc:Subject:Date:Reply-To; b=VOJhjgOyIBInKWfriM9iyXfqSBNcJB2mYt4pkGp1r6vprB+tUSv0zlStRZxYmEaQb TKnVnt3aSgdohv2yjlqipQbTeRtdAHnGdTSAMbDIaoQW4+oojjlNbmhZbNoAGphs3b dq6RbqnXf4PjByIa44hTeoPWpShF7NBLnDp+mE/I= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2026-99092: riscv: patch: fix handling of bpf-jit execmem addresses Date: Mon, 26 Oct 2026 15:52:14 +0100 Message-ID: <2026102612-CVE-2026-99092-7b2e@gregkh> X-Mailer: git-send-email 2.56.0 Reply-To: , X-Mailing-List: linux-cve-announce@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=4455; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=FmpAKQgdj53I3P+HUKW71JiRjv6YmyfTDrzc4G6yKPE=; b=owGbwMvMwCRo6H6F97bub03G02pJDFn3M2VmbNsptjxRz+bpN5Zjjpt+scuv7s9bs1/WdeulN 1ohzY2/O2JZGASZGGTFFFm+bOM5ur/ikKKXoe1pmDmsTCBDGLg4BWAiPzYwzOEUCclVm+X2IL/v oXPhhSNvuJ783MwwP49X38xTPU3/GKP7ylCrwFrB83/vAwA= X-Developer-Key: i=gregkh@linuxfoundation.org; a=openpgp; fpr=F4B60CC5BF78C2214A313DCB3147D40DDB2DFB29 Content-Transfer-Encoding: 8bit From: Greg Kroah-Hartman Description =========== In the Linux kernel, the following vulnerability has been resolved: riscv: patch: fix handling of bpf-jit execmem addresses Commit 8718e5a3090b ("riscv: patch: skip fixmap mapping when kernel text is already writable") gated the core_kernel_text() branch of patch_map() on CONFIG_STRICT_KERNEL_RWX, and explicitly left the vmalloc branch unchanged. That branch has a separate problem. That branch only creates a temporary writable fixmap alias when CONFIG_STRICT_MODULE_RWX is enabled, and otherwise assumes the target is directly writable and returns the address unchanged. That assumption no longer holds: bpf_prog_pack_alloc calls set_memory_rox() on every pack unconditionally in alloc_new_pack(), independently of any CONFIG_STRICT_*_RWX option, so BPF text in the vmalloc area is read-only regardless of what CONFIG_STRICT_MODULE_RWX says. With CONFIG_STRICT_MODULE_RWX=n, patch_map() returns the read-only address directly, the subsequent copy_to_kernel_nofault() takes a page fault and returns -EFAULT. bpf_arch_text_copy() turns that into -EINVAL, which propagates through bpf_jit_binary_pack_finalize() to the WARN_ON() in bpf_int_jit_compile() and leaves the program un-JITed. Note that BPF cannot be fixed the way kprobes was in commit bdc46e507b59 ("riscv: mm: make EXECMEM_KPROBES writable without CONFIG_STRICT_MODULE_RWX"). EXECMEM_BPF is already PAGE_KERNEL, i.e. writable at allocation time; the read-only mapping is established afterwards by generic code in alloc_new_pack(), which arch code cannot influence. The only place this can be handled is patch_map(). This is the same problem that was fixed on arm64 by commit b1480ed230ac ("arm64: patching: fix handling of execmem addresses"), and the fix is the same: CONFIG_EXECMEM is what actually tracks whether the vmalloc area can hold executable memory that needs a temporary alias to be written. CONFIG_BPF_JIT, CONFIG_KPROBES and CONFIG_MODULES all select it. Note that this is not limited to CONFIG_MODULES=n. Unlike arm64, riscv selects CONFIG_ARCH_OPTIONAL_KERNEL_RWX, so CONFIG_STRICT_MODULE_RWX can be disabled with CONFIG_MODULES=y as well, and the bug is reachable in that configuration too. The !CONFIG_MMU build is unaffected: it has its own __patch_insn_set() and __patch_insn_write() implementations and never calls patch_map(). The Linux kernel CVE team has assigned CVE-2026-99092 to this issue. Affected and fixed versions =========================== Issue introduced in 6.10 with commit 2c9e5d4a008293407836d29d35dfd4353615bd2f and fixed in 6.12.114 with commit 562a35b9e0b3d9483d9472995219cadb3592db3d Issue introduced in 6.10 with commit 2c9e5d4a008293407836d29d35dfd4353615bd2f and fixed in 6.18.58 with commit 9e8fc7972b398e9dc2415ece283d8f64edac3858 Issue introduced in 6.10 with commit 2c9e5d4a008293407836d29d35dfd4353615bd2f and fixed in 7.2.11 with commit f71d6ea3843c8038c431c2699482f246aea37ca0 Issue introduced in 6.10 with commit 2c9e5d4a008293407836d29d35dfd4353615bd2f and fixed in 7.3 with commit a510e1ae8c9030750c2edf7b0bc9b186cd8c7a06 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-2026-99092 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/kernel/patch.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/562a35b9e0b3d9483d9472995219cadb3592db3d https://git.kernel.org/stable/c/9e8fc7972b398e9dc2415ece283d8f64edac3858 https://git.kernel.org/stable/c/f71d6ea3843c8038c431c2699482f246aea37ca0 https://git.kernel.org/stable/c/a510e1ae8c9030750c2edf7b0bc9b186cd8c7a06