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 7D96D483807 for ; Fri, 25 Sep 2026 10:42:02 +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=1790332924; cv=none; b=rS3HVK3nBc4pz+OmxbZ6jif76vvYAdEGPVqjuZkUPekPdXFkJfxSdyyElhk9BrmS975ELsgExwPNqkqIMWksG/OI7/LO5NXu/tWXQdaQ8rJpJPmYqJSGlEciueaoTEKkK9lnbJvfBBvFyShWtwofN+x1Rw//noQh/f/h0dr5sE0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1790332924; c=relaxed/simple; bh=JOdu+EJYT041dZTYrYRbrdpRHtqnvN0CTnkLf+p9Aqo=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=YmdCxpDfN1qrv/2Xz+Ru+5q3EQ5HSqIa5neTtqb/6EMUXWSndmtyzIViqQcnDM9OuvdnbZSkbYau/4I1OctygOq6JVG9pEJYEVNzH2YeX58Ql8Ay6RpMYZhmjPeYcwNdwBwNMsM/rBCaJe24SZlFhOsdP8jeh2cFStXuSgVCpSU= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=tLEpOH1g; 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="tLEpOH1g" Received: by smtp.kernel.org (Postfix) with ESMTPSA id C42071F000FF; Fri, 25 Sep 2026 10:42:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1790332921; bh=0kXSnt1wOUkKfqyYBhpbUuDzPS8GsIYQtJvTlM9LMfM=; h=From:To:Cc:Subject:Date:Reply-To; b=tLEpOH1gQ13a42dgqzSN7jEyUZjovpHd2jAVu+4gpZwmIlRZ6sAZ6SOonCbvktiu4 MWyioLhSsQTPtZuY2FPUCPpta4odnd48sFFrREB0hZFxFgzYkJu4LfxMnozPz3r8j2 2b03GcUYlc49xzwljhWCunlLSsewdLpKw0UEKOuc= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2026-98151: bpf: Fix REG INVARIANTS VIOLATION on speculative pointer arithmetic Date: Fri, 25 Sep 2026 12:39:58 +0200 Message-ID: <2026092519-CVE-2026-98151-0351@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=4460; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=hTN7dqU9ms9+p31gDoOA7teYP+K7oVp8/2MbgQQXaJY=; b=owGbwMvMwCRo6H6F97bub03G02pJDFnb/MPVKrIPyh3OPvtm/7pOzgPrw75/9ezS4+5/uVogy nHvLqHgjlgWBkEmBlkxRZYv23iO7q84pOhlaHsaZg4rE8gQBi5OAZjIfyWG+ZUi53f+eWG3uHCD j5DZG5bvr3/6PmZYMMnYY+OlV8J/m1LnCj1Syu/5aZnsCAA= 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: Fix REG INVARIANTS VIOLATION on speculative pointer arithmetic Take the following unprivileged program as an example: r0 = bpf_map_lookup_elem(...) /* PTR_TO_MAP_VALUE, offset 0 */ ... 14: r0 += r1 /* r1 is a bounded scalar */ 15: r9 = r0 Loading it triggers a verifier warning from reg_bounds_sanity_check(): verifier bug: REG INVARIANTS VIOLATION (alu): const subreg tnum out of sync with range bounds r64={.base=0x0, .size=0x0} r32={.base=0x0, .size=0xffffffff} var_off=(0x0, 0x0) What happens: 1. Processing insn 14 (r0 += r1) in adjust_ptr_min_max_vals(), the new offset is computed into dst_reg's var_off and 32/64-bit ranges. 2. Because pointer registers do not track 32-bit subregister bounds, __mark_reg32_unbounded() first sets r32 to the full range; r32 is re-derived from the offset at the end of the function by reg_bounds_sync(). 3. On the unprivileged path, sanitize_ptr_alu() is called and, via sanitize_speculative_path() -> push_stack(), snapshots the current register state and schedules the next instruction (insn 15) to be verified directly as a speculative path. 4. That snapshot is taken between step 2 and the final reg_bounds_sync(): at this point dst_reg's var_off still holds the (const) original offset while r32 has just been blanked to the full range, i.e. the two are out of sync. When the speculative path later verifies insn 15 (r9 = r0), the inconsistent state reaches reg_bounds_sanity_check() and trips the warning. var_off and the 32-bit range must always be consistent. There are two ways to keep the snapshot consistent: 1. sync var_off and r32 before the snapshot so they match, or 2. leave r32 at its original (already consistent) value and blank it only after the snapshot. The whole point of sanitize_ptr_alu() is to insert a harmless masking sequence that keeps the access in bounds under speculation, so the state it snapshots should faithfully represent that. Take approach 2: move __mark_reg32_unbounded() to after sanitize_ptr_alu(), so the speculative snapshot keeps the pointer's original, consistent r32. The non-speculative path is unchanged: r32 is still blanked before the offset is applied and re-derived by reg_bounds_sync(). The Linux kernel CVE team has assigned CVE-2026-98151 to this issue. Affected and fixed versions =========================== Issue introduced in 6.8 with commit 5f99f312bd3bedb3b266b0d26376a8c500cdc97f and fixed in 6.12.111 with commit 21a681526c715aebb4f918b8c131583442d1b3d8 Issue introduced in 6.8 with commit 5f99f312bd3bedb3b266b0d26376a8c500cdc97f and fixed in 6.18.53 with commit d623a4a58bb238443505d5c2949d1182dcfc26b6 Issue introduced in 6.8 with commit 5f99f312bd3bedb3b266b0d26376a8c500cdc97f and fixed in 7.2.7 with commit 9f9477ae73de9c5a28e8ab7000d8097b078faee4 Issue introduced in 6.8 with commit 5f99f312bd3bedb3b266b0d26376a8c500cdc97f and fixed in 7.3-rc2 with commit 150aeba624e8b7cac51c39440d7e8e1fd11de9a0 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-98151 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/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/21a681526c715aebb4f918b8c131583442d1b3d8 https://git.kernel.org/stable/c/d623a4a58bb238443505d5c2949d1182dcfc26b6 https://git.kernel.org/stable/c/9f9477ae73de9c5a28e8ab7000d8097b078faee4 https://git.kernel.org/stable/c/150aeba624e8b7cac51c39440d7e8e1fd11de9a0