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 93D5448A2B1 for ; Fri, 25 Sep 2026 10:41:08 +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=1790332872; cv=none; b=fDrueGiVJc03rH+esSJsNx/DYx9Q25wvXbvjoyEaSz9vITxbsj+0MlXqh7rsBcGXVw4H2xxEgWHh5MMiaXTmPUEPtqmRT2Eacs0gAeFyD8xvF+PH4mwaGU+sZ3XF6htTALkLXJ9eoOF0fC6Tf5JqLnFbevm/5//ddh+D22vHhBU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1790332872; c=relaxed/simple; bh=W0tqK0M50g2rZKLTLvr6gAiNrsHdF/N77aHffsoENT8=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=ANsdhCKLy5c/c0C4mlct1e1ebKRT+b8DUlSItM4vgr9OuZD+/nCHLSYWAwpN+fS5rX+cuC3twTVdcXLRZ2MstQlkjmU62GzU/OZzsJMvVWKLWlHpXn0nV+dv3+ebNThVrIItdU9bFljSo4dSrjVyvP1+z7Lk+YeZ82of7I7c36k= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=J6C6Z1qI; 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="J6C6Z1qI" Received: by smtp.kernel.org (Postfix) with ESMTPSA id EBEC51F000FF; Fri, 25 Sep 2026 10:41:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1790332866; bh=FysIjiysiBa+LVfK1wF8tq96u5yYfrVX+yF7jxRHWEo=; h=From:To:Cc:Subject:Date:Reply-To; b=J6C6Z1qIt3W2v/gqFfHqF80Fj+DUJqvek2LKxkfIwaPzQyY8IKRXhIkkuBKjJMere D8o//NgiHWB3D3HrTqreBoLMVdPkZf7dpq6b/ILpV5tsB44erJfE++WvUeVvMnlPLK JsSm+R7viqff5qBV4GDnvL1QAMvy1h+SK+WG6Kg8= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2026-98134: bpf: check_cond_jmp_op(): properly infer if register is null Date: Fri, 25 Sep 2026 12:39:41 +0200 Message-ID: <2026092516-CVE-2026-98134-df66@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=3684; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=p4L+QT5H6cdhzpV4irKpR+IOcJ9tD9SH3JKPkMmvfOE=; b=owGbwMvMwCRo6H6F97bub03G02pJDFnb/ENu2e+fv158mX28QvqXr+1iJo9fl2aoT/7V/Of0Q l+mK/PCO2JZGASZGGTFFFm+bOM5ur/ikKKXoe1pmDmsTCBDGLg4BWAi+Z4MCzadO6AQ9rjtdY5C lnKW0s2ggFURXxgWdD9hSHOctSyM2e9ipE3eFINGDYGNAA== 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: check_cond_jmp_op(): properly infer if register is null Nicholas Carlini reported a bug when verifier can incorrectly infer that a pointer is non-null. The bug occurs when two pointers are compared and one of them has a type w/o PTR_MAYBE_NULL flag, but which allows a value to be NULL at runtime. Here is an example: // `a` is PTR_TO_MEM | MEM_RDONLY | PTR_UNTRUSTED // `a` is 0 at runtime. // `b` is PTR_TO_MAP_VALUE | PTR_MAYBE_NULL void *a = bpf_rdonly_cast(0, 0); int *b = bpf_map_lookup_elem(...); if (a == b) *b = 42; // verifier does not catch null pointer dereference This happens because of a special case in check_cond_jmp_op(), which attempts to strip PTR_MAYBE_NULL flags from pointer types, when processing comparisons like `rA == rB`, if either rA or rB can't be null. The non-null property is derived based on the absence of PTR_MAYBE_NULL flag on rA's or rB's type. But that is not sufficient for types like PTR_TO_MEM, as in the example. This patch replaces type_may_be_null() call with reg_not_null(), which contains an allowlist of types for which absence of PTR_MAYBE_NULL actually means that the value can't be NULL at runtime. At the moment, the list in the reg_not_null() omits two types for which PTR_MAYBE_NULL is applicable: PTR_TO_XDP_SOCK and PTR_TO_BUF. In order to remain backward compatible, and assuming that only comparison between pointers of the same type makes sense, this commit extends reg_not_null(). W/o such an extension e.g. verifier_jeq_infer_not_null/null_ptr_to_map_value fails. reg_not_null() can be extended further, but I deem that out of scope for the fix at hand. Explicit base_type(...) != PTR_TO_BTF_ID checks in the check_cond_jmp_op() can be removed with migration to reg_not_null(), but that is a behavioural change, as the special case would start matching for PTR_TO_BTF_ID that is also is_trusted_reg(). I omit the behavioural change from this commit. The Linux kernel CVE team has assigned CVE-2026-98134 to this issue. Affected and fixed versions =========================== Issue introduced in 6.2 with commit befae75856ab406a3f3fab2aa2118cf3b2dfe3e6 and fixed in 7.2.7 with commit b55c9f019e169ed0d01394f96e172286a8b21b99 Issue introduced in 6.2 with commit befae75856ab406a3f3fab2aa2118cf3b2dfe3e6 and fixed in 7.3-rc2 with commit d3ef6c097ba078e1f8c7239d76a0ce8b61e75095 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-98134 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/b55c9f019e169ed0d01394f96e172286a8b21b99 https://git.kernel.org/stable/c/d3ef6c097ba078e1f8c7239d76a0ce8b61e75095