From mboxrd@z Thu Jan 1 00:00:00 1970 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=1796047091; b=vwB6LA5GUOLV2agY3iewVUr6RQdGyQq9J1R1z9Fi6UOhjQaUpIrzCPiiWbp5ZKaF9ENk 5PmyOns6p2ccd/99u9A6+OmjpVowoX+z1Qqxfh+uLvBaQECaf/GoALAK/LP3Stu8MYmDG gjj3I38HT7MAHIRewsq/u1rBv8Hn4nE8xlXOhrLht+kv6DMxLjKXsxhtpKA5SSEnhee9c 7EeJgO3pj8DUUCixPmWgvuv2gQi6lXVFhOlERVbMHkklf+HFja2BRrch+1hV80EdZtKGx rBoa6gUSuGPtYazAMKS8Wf3GPTgQs6m2Ft6gvMyqkeyUm9r9LFYbp+dyp+UZt/jH7Ig== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796047091; 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=ILXd6MQw7lym89AFxU2JFv0lfdZM4bRuEsV594PFaNg=; b=eP6WAJWoFA+jSxjF8pKFDMwwFYDeTz0JxTuW901U9CApHskOpVG8KWBjgpgRdZz2Sfmv eTK+xcKu4aXr7+ReqVzyHrtYqwdhRy7iWBvkV+HySuxCw8vap8QDHMHqHlA0T5E7GxRHt yA3gxUOquQwe7ysE2m9+/3f5eH2zb65KrKhIGNn6vnQaPBn66vJ9ot5ZWIcymFKvgRcRv jPcD3NIR3yJE94jvslrAPYfm2ahm6/mnVybGr8pQn0D3Q8rk2/2TSfHpYVNiw+5FQUf3L WBu2Grh02L5vRwBJstxxJEzlP+9GxmKkglkJslDpObjmgrJbwlwcUn41kZ4BuKeupUg== 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=10MPjCDm; 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 7A169606A31C for ; Mon, 30 Nov 2026 13:58:11 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.a=rsa-sha256 header.s=korg header.b=10MPjCDm Received: by smtp.kernel.org (Postfix) with ESMTPSA id 30C361F00897; Mon, 30 Nov 2026 13:58:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1796047090; bh=ILXd6MQw7lym89AFxU2JFv0lfdZM4bRuEsV594PFaNg=; h=From:To:Cc:Subject:Date:Reply-To; b=10MPjCDm+EoKlz4pWMQ3zlU52HLZHKQgtAbf6LSW2tHFRrah2O3bjMcDB71KTRXi4 zfpmAmS7GmEvc053Ue1R7U2qiZsuum5wJ4uyTeSL5FCy4KuRaOEBt0TLlpx0GKqmgV CZtf8CWQy9rL9b39xVm5kjtpQbExyu5Pg9GkgI50= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2026-139163: bpf: Keep stack arguments in arch_bpf_timed_may_goto() Date: Mon, 30 Nov 2026 14:32:52 +0100 Message-ID: <2026113045-CVE-2026-139163-e554@gregkh> X-Mailer: git-send-email 2.56.1 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=3185; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=A442sGDsYNTZxCOLOCvGu8Q1a01o0RTpLAEu8s+ZWeI=; b=owGbwMvMwCRo6H6F97bub03G02pJDNm8VQfV4zi0lF5bKx77Hxp672UzgxO7neGFxHdLX0+bo fXGYfeKjlgWBkEmBlkxRZYv23iO7q84pOhlaHsaZg4rE8gQBi5OAZhI8neGeToiHv1Cmx2vtbfr L57kHLUyefLKkwwLLjkuYfKOPrh09jUjxSdaIk8uGhadBAA= 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: Keep stack arguments in arch_bpf_timed_may_goto() The JITs pass the first stack arguments of a call in registers: x86-64 r9 argument 6 arm64 x5-x7 arguments 6-8 riscv64 a5-a7 arguments 6-8 '*(u64 *)(r11 - 8) = rX' writes such a register in the caller. 'rX = *(u64 *)(r11 + 8)' reads it in the callee. A call changes these registers. Thus the verifier accepts no call between the write and the call of the callee, and no call in the callee before the read. may_goto is not a call for the verifier. But one time in 65535 iterations it calls arch_bpf_timed_may_goto(), and this function calls C code. It saves R0-R5 only. *(u64 *)(r11 - 8) = 0 ; the verifier: argument 6 is 0 call sub sub: 1: may_goto 2f ; C code changes r9 goto 1b 2: r2 = *(u64 *)(r11 + 8) ; r2 is a kernel address r1 = map_value r1 += r2 *(u64 *)(r1 + 0) = 0 On x86-64 the C code changes r9 when the time of may_goto is up. With the hpet clocksource a look at the clock changes r9 too. The prog above crashes the kernel. LLVM does not emit such code: it reads stack arguments at the entry of a function, and it writes them immediately before the call. Save and restore these registers too. The cost is 2 insns on x86-64, 4 on arm64 and 6 on riscv64, one time in 65535 iterations. The Linux kernel CVE team has assigned CVE-2026-139163 to this issue. Affected and fixed versions =========================== Issue introduced in 7.2 with commit 324c3ca6eed6fb7ec4e50f31d537953038b13c5f and fixed in 7.3.6 with commit 009c5c6acd08f93a9bbf55c0881ae06cc221247a Issue introduced in 7.2 with commit 324c3ca6eed6fb7ec4e50f31d537953038b13c5f and fixed in 7.4-rc1 with commit 4d0f560f4926417f010ce38f8628c41bcad29c9f 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-139163 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/arm64/net/bpf_timed_may_goto.S arch/riscv/net/bpf_timed_may_goto.S arch/x86/net/bpf_timed_may_goto.S 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/009c5c6acd08f93a9bbf55c0881ae06cc221247a https://git.kernel.org/stable/c/4d0f560f4926417f010ce38f8628c41bcad29c9f