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 3931A4C14EC for ; Sun, 18 Oct 2026 16:16:31 +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=1792340193; cv=none; b=rkvgLb+xjQK1K04Eh+P1vE7rm32VTdXSc6ezlV4PhRwSw+WKAYOWH2Nwa4b0wCUhaql+ge2cRkWcInCvStARuhCy1Mljb/rvIYRZ5MyKHEHUhX0b28BWbE5qCOhUUVhmMJWwy7kgraNpY/cXKpJpdjyLrzaiHdYzMP74tdZXAlc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1792340193; c=relaxed/simple; bh=QfaP+uUL7iqbHCTd/xmzKbrZXly2KaDfuKz8e9KgVBM=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=BUxHB67dqXfjMi7CdGOXR/YGDWOF+HAnT/OdMmXLHgzevqwEkIJrUQ3uABVlGaeaWcVbBq8+cyEIZnodP0OaCqyWgpwLaYglcbjXOcYvnqKy88BTwCoJeu3UBDwTOm9CpvSteo5d1m4ZQe1uW2TwP2HXffX6uyTNofdypI6GMo0= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=ljXls/mj; 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="ljXls/mj" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 244131F000C4; Sun, 18 Oct 2026 16:16:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1792340191; bh=Cx9ULA9+Tuu0hTXAXBCB6fAFLVzQOv8TCrLgo+2S9MI=; h=From:To:Cc:Subject:Date:Reply-To; b=ljXls/mjoxohublKpFq8k7qYQWEsdpyO8438wfI1ZkGsXYR8fnJ3Z9EGmnK06DZhE u0WBThKhpTh3dhWnXAOm8ZJVYkYpHbKaJosIYgA+mAarvG5tcidXIhscNzrXaB83dL 6lmbbQaVQ33f37ChGz7I+QBApEtLAMLHB8WMsgUI= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2026-98789: bpf: Fix objects stuck in free_by_rcu_ttrace Date: Sun, 18 Oct 2026 17:46:04 +0200 Message-ID: <2026101822-CVE-2026-98789-95f4@gregkh> X-Mailer: git-send-email 2.56.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=3076; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=TfRTJmda1NwMgRLjuAVg0UvqLz10CDzW+u1bYV70ftk=; b=owGbwMvMwCRo6H6F97bub03G02pJDFlXXoa5ZJ4tWjSRo1m77fgNUZ/ZDg06r94EnhG372jed j10BufPjlgWBkEmBlkxRZYv23iO7q84pOhlaHsaZg4rE8gQBi5OAZiIoS/DXDmPG+07aq6tK1y0 QmTBB0G3Fd+POjDMsz6yh7trodP5AAPdWD+ncGkGuRUBAA== 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 objects stuck in free_by_rcu_ttrace do_call_rcu_ttrace() returns early when call_rcu_ttrace_in_progress is set and leaves the objects in free_by_rcu_ttrace. __free_rcu() frees waiting_for_gp_ttrace only and clears the flag. Hence the objects that free_bulk() or __free_by_rcu() added while RCU tasks trace GP was in flight stay in free_by_rcu_ttrace until free_bulk() or alloc_bulk() is called for the same bpf_mem_cache again, which may never happen. The number of such objects is not bounded. Turn call_rcu_ttrace_in_progress into three states: 0 - idle 1 - __free_rcu() is queued 2 - __free_rcu() is queued and free_by_rcu_ttrace got more objects since do_call_rcu_ttrace() sets 2. __free_rcu() does cmpxchg(1 -> 0) and starts the next GP when it fails. It cannot clear the flag first and check free_by_rcu_ttrace later, since bpf_mem_alloc_destroy() frees bpf_mem_cache without waiting for RCU callbacks when the flag is zero. Now __free_rcu() queues itself, so the one that didn't see 'draining' may do call_rcu_tasks_trace() after rcu_barrier_tasks_trace() in free_mem_alloc(). Queue it under rcu_read_lock() and do synchronize_rcu() before the barriers. Calling rcu_barrier_tasks_trace() twice works too, but creating and destroying hash maps in a loop on many cpus slows down to one free_mem_alloc() per GP and kworkers pile up. The Linux kernel CVE team has assigned CVE-2026-98789 to this issue. Affected and fixed versions =========================== Issue introduced in 6.1 with commit 8d5a8011b35d387c490a5c977b1d9eb4798aa071 and fixed in 7.2.10 with commit 33d0a5d2fee06a51f2f056dd901296515912e954 Issue introduced in 6.1 with commit 8d5a8011b35d387c490a5c977b1d9eb4798aa071 and fixed in 7.3-rc6 with commit fbd97dd1d3ce32d32fb7be86acc3fdb7c04fa043 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-98789 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/memalloc.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/33d0a5d2fee06a51f2f056dd901296515912e954 https://git.kernel.org/stable/c/fbd97dd1d3ce32d32fb7be86acc3fdb7c04fa043