Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 825573E024E for ; Wed, 22 Apr 2026 13:58:06 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1776866286; cv=none; b=Qr6vmC3nZNvKRsk47pmhqIUJUui/FL9WUngOzVVWHI0/2cyPT524KTlrkqC1bSkugLcAQvgYUfgdoEZ4nEIHXLyDX6hSjNC9WoJyPnqeOQuwcFB5IRgj4GtEUlp/G6h3jBaf/RKK3jr8JKHM83aLCLbmV7S31B9UDAj1+vvmAds= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1776866286; c=relaxed/simple; bh=FZbwGOM7C/UyqcCnBgr/wt15os6H9l+M6MG45W1C7D4=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=ey0ce5UflNaq4lu6YVl/ClP1OJVTLqpHtp67OEBSGANBEXLrLTDew2LK/jw/Z6hXpZG57WNWmrD2P/Wx5sKfjLONGGB/0mA34WdPLlVlpBCdxfGWqoHScCFBONKUgCxSqM77/tC7aWgwTve5fc07AGChldmuzPy+3Wc9UKdlYMU= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=yoLazN7H; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="yoLazN7H" Received: by smtp.kernel.org (Postfix) with ESMTPSA id F32E7C2BCAF; Wed, 22 Apr 2026 13:58:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1776866286; bh=FZbwGOM7C/UyqcCnBgr/wt15os6H9l+M6MG45W1C7D4=; h=From:To:Cc:Subject:Date:Reply-To:From; b=yoLazN7HQM4HVDGcobQCzs84BAV4NcBGWzdwUt1PMjRh5nJD6JmrM10J58j7FpkzG dMW7AUiuzApTuq8bAApOTMAUn6daZ0aPCn+EraobrzjqSjNvwGaDAN6dtfUXLdTflH fnhdBLJuXJ+vzoCJ75kmsMnfu2pYw0BZ6egB6z4g= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2026-31526: bpf: Fix exception exit lock checking for subprogs Date: Wed, 22 Apr 2026 15:55:12 +0200 Message-ID: <2026042213-CVE-2026-31526-9771@gregkh> X-Mailer: git-send-email 2.54.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=3347; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=5xCGw2va8Erz86HO1XvXn9vLLE0awXm+Q2DNREQTn+8=; b=owGbwMvMwCRo6H6F97bub03G02pJDJkvLrNpZHJpf0p5EB0s8+1de52YxeXfhptaKxaINfzJq pvuc+pMRywLgyATg6yYIsuXbTxH91ccUvQytD0NM4eVCWQIAxenAExkUzfDgrZ3c1b9/LEwKH9B l+s9+R1Ta43Eehjm+4o3vo9by6W1POVudswF5x6l7pgbAA== 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 exception exit lock checking for subprogs process_bpf_exit_full() passes check_lock = !curframe to check_resource_leak(), which is false in cases when bpf_throw() is called from a static subprog. This makes check_resource_leak() to skip validation of active_rcu_locks, active_preempt_locks, and active_irq_id on exception exits from subprogs. At runtime bpf_throw() unwinds the stack via ORC without releasing any user-acquired locks, which may cause various issues as the result. Fix by setting check_lock = true for exception exits regardless of curframe, since exceptions bypass all intermediate frame cleanup. Update the error message prefix to "bpf_throw" for exception exits to distinguish them from normal BPF_EXIT. Fix reject_subprog_with_rcu_read_lock test which was previously passing for the wrong reason. Test program returned directly from the subprog call without closing the RCU section, so the error was triggered by the unclosed RCU lock on normal exit, not by bpf_throw. Update __msg annotations for affected tests to match the new "bpf_throw" error prefix. The spin_lock case is not affected because they are already checked [1] at the call site in do_check_insn() before bpf_throw can run. [1] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/kernel/bpf/verifier.c?h=v7.0-rc4#n21098 The Linux kernel CVE team has assigned CVE-2026-31526 to this issue. Affected and fixed versions =========================== Issue introduced in 6.7 with commit f18b03fabaa9b7c80e80b72a621f481f0d706ae0 and fixed in 6.18.21 with commit c0281da1f2aa5c2fca3a05f79b86bea96591c358 Issue introduced in 6.7 with commit f18b03fabaa9b7c80e80b72a621f481f0d706ae0 and fixed in 6.19.11 with commit 5a399f3117642494e35545f6ca397d3e177c1f9b Issue introduced in 6.7 with commit f18b03fabaa9b7c80e80b72a621f481f0d706ae0 and fixed in 7.0 with commit 6c2128505f61b504c79a20b89596feba61388112 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-31526 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 tools/testing/selftests/bpf/progs/exceptions_fail.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/c0281da1f2aa5c2fca3a05f79b86bea96591c358 https://git.kernel.org/stable/c/5a399f3117642494e35545f6ca397d3e177c1f9b https://git.kernel.org/stable/c/6c2128505f61b504c79a20b89596feba61388112