From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (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 155D856510A for ; Fri, 11 Sep 2026 19:57:17 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789156667; cv=none; b=c6+5+rSrAcaoP1zWUQmVW5NZz1oGv0/SokJB/cOJ/sz+OmIv1pGjwx9kdZ4myykBT3YYJGQnWhO0WEskk3sShcjhoCToR7aUSmBOjaTESdRK17bKLOaJmelbDVjQ76nGEQxvlu9Kz2dTd23uBWx1XAld1nDcs1/Eda6ZO4KHo2Q= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789156667; c=relaxed/simple; bh=UeHN10VIwz8w+5e5QYmKTXZNXjbqJJrNCH1DFr5tufs=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=Zly3UjbDoVEnd11NVT6I7Ntb4ZTij/WIniaebuhlqy4W61DLTvI2saLHmARWdnshI3s+btN40zU5eG/PQrzo1Q7Tw/6CE6PY8ZdHiD3+vOHy6rPqIGmSt7+X9gGGqLpmEELnsggSNk0hX36JTBFU0Wq5CVtmMNrn9ZqhcgMJ/N4= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=iBg0ooHF; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="iBg0ooHF" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 44ABA1F0089A; Fri, 11 Sep 2026 19:57:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1789156633; bh=ICNZP+F+cfLuEHfUSkl6BCDuuFTovcbtKamAuIUyaw0=; h=From:To:Cc:Subject:Date:Reply-To; b=iBg0ooHFX27jbDEY7r1ZNU14efcz47Z7PPeRvlCffllruWu7B5cpJrslbLVM3LTG8 VD46MYNuxtI+XjpF0I1pH8Tayo/UmBFT4LYwgpoBsSnPvaiuBZTZvGeT4qZ9hFian9 H+WKaQv4CqSUwosi8afN/n8yK/M3DQmWjZFq7aAI= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2026-89581: bpf, x86: Fix per-CPU address resolution into an extended register Date: Fri, 11 Sep 2026 21:44:30 +0200 Message-ID: <2026091128-CVE-2026-89581-d5f5@gregkh> X-Mailer: git-send-email 2.55.0 Reply-To: , Precedence: bulk X-Mailing-List: linux-cve-announce@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=4176; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=LII/qWU1NRfqdoR0RhxP0eZUIcSua5inzpyFpLsfPPY=; b=owGbwMvMwCRo6H6F97bub03G02pJDFlLIjNK31aJbjxolHy87LTeo12H11UePem1rqXltqvOt HPxMQFKHbEsDIJMDLJiiixftvEc3V9xSNHL0PY0zBxWJpAhDFycAjCRD80MCxZ3uPTLr5U9G/eV veWjwbqOo0Vdkxnm1x6xWnHMNmL7u6CfZz9kznkZsOXyHQA= 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: bpf, x86: Fix per-CPU address resolution into an extended register The destination of the per-CPU address MOV is encoded in ModRM.reg, which is extended by REX.R, but the REX prefix is built with add_1mod(), which sets REX.B. REX.B extends ModRM.rm and SIB.base, and this instruction addresses memory as disp32 with no base, so the bit has no effect at all and the high register bit is simply lost. Every is_ereg() destination therefore resolves to the wrong register, picking whichever one shares the low three bits: R5 -> RAX R7 -> RBP R8 -> RSI R9 -> RDI With BPF_REG_5, whose reg2hex is 0, the emitted 65 49 03 04 25 add %gs:,%rax adds the per-CPU offset to RAX rather than R8. The destination keeps the unadjusted address and RAX is clobbered, so the program goes on to dereference a pointer that was never made per-CPU: BUG: unable to handle page fault for address: 0000607e386a8894 RIP: bpf_prog_707837aafd2aa9ae_update_percpu_data+0x93/0xc9 Call Trace: __bpf_prog_test_run_raw_tp+0x2dc/0x7d0 __flush_smp_call_function_queue+0x1e9/0xc80 Kernel panic - not syncing: Fatal exception in interrupt R5 is the mildest of the four, aliasing a scratch register and faulting at the store. R7 aliases RBP and would corrupt the frame pointer, R8 and R9 alias the argument registers. Use add_2mod() so the register goes through REX.R, matching how add_2reg() places it in ModRM.reg and how emit_priv_frame_ptr() hardcodes 0x4c for the same instruction with R9. Encodings for the non-extended registers are unchanged. Problem showed up when trying to resurrect BPF_GCC CI (selftests built with BPF_GCC). This has gone unnoticed because clang reloads the address into R1 before each per-CPU access, so the destination is never an extended register. GCC keeps several per-CPU addresses live at once, and test_progs-bpf_gcc panics the kernel in global_percpu_data/init, where the address of a .percpu variable ends up in R5. The Linux kernel CVE team has assigned CVE-2026-89581 to this issue. Affected and fixed versions =========================== Issue introduced in 6.10 with commit 7bdbf7446305cb65c510c16d57cde82bc76b234a and fixed in 6.12.109 with commit 638bc3aada8ecdece184d5c15b100d489c9cccd7 Issue introduced in 6.10 with commit 7bdbf7446305cb65c510c16d57cde82bc76b234a and fixed in 6.18.50 with commit 6886642414f59f928728802dc2c972a9859e6310 Issue introduced in 6.10 with commit 7bdbf7446305cb65c510c16d57cde82bc76b234a and fixed in 7.2.4 with commit 6a19b18d458881bf3269a357cc6dc6db5eef4369 Issue introduced in 6.10 with commit 7bdbf7446305cb65c510c16d57cde82bc76b234a and fixed in 7.3-rc1 with commit 5bbbce02e500d47d8e259a45be5a7be9741d0533 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-89581 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/x86/net/bpf_jit_comp.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/638bc3aada8ecdece184d5c15b100d489c9cccd7 https://git.kernel.org/stable/c/6886642414f59f928728802dc2c972a9859e6310 https://git.kernel.org/stable/c/6a19b18d458881bf3269a357cc6dc6db5eef4369 https://git.kernel.org/stable/c/5bbbce02e500d47d8e259a45be5a7be9741d0533