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 BF3C0219F9 for ; Sun, 19 May 2024 10:11:39 +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=1716113499; cv=none; b=FMW0SlBgU4FBIntekag4RPPTwmmT3mJ9nAWeHeacF1H6l0pMBbXmrUEnolWgFGd22SsYhnn4ObhoC8dM0JL4b89YIzzE+aEhL7WaHwnXGeakuNKaXKYI0UIV+L+/rzpwLvOmTBDad508wF/LkVU1Oe7BctDEcCtLATtFW3Fgytw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716113499; c=relaxed/simple; bh=kS779CtYhRiyyvyOUcnHUiCXzXIHYNyCvYEZLXug0H4=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=qWCi4uRxzhnmYsF9sZDg6VlciaZqPNcxWTVtLZcpqdmbiCVoVx8vNB7JlF8RYz3z733ygPDNviZbDSKqaeOgS8eyH8Kfe6cJ06wpD9GSY5MXuBOvkH68irWZ0qB+phqvH5+H2AgDdhN4Z26j5R9xlnBG0+LaGK2RdA39bTvhDq4= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=ZaRgrgLV; 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="ZaRgrgLV" Received: by smtp.kernel.org (Postfix) with ESMTPSA id E6437C32781; Sun, 19 May 2024 10:11:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1716113499; bh=kS779CtYhRiyyvyOUcnHUiCXzXIHYNyCvYEZLXug0H4=; h=From:To:Cc:Subject:Date:Reply-to:From; b=ZaRgrgLVz3u4oLgG3xdw8336b2UleNRH2Qtg3gNdkYuEJ41u1FTmoxzGfMp7zq2ww 2SHafSo6LPsljMtNWEYPnW61M74yTrjMkafJ4B9EOYB+qVxyEmBg3fOT5hi8/8qSq7 IsJ1oSFCUO/CksnzsOuPEo5MP2AoDrjzSEqXapfk= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2024-35929: rcu/nocb: Fix WARN_ON_ONCE() in the rcu_nocb_bypass_lock() Date: Sun, 19 May 2024 12:11:23 +0200 Message-ID: <2024051916-CVE-2024-35929-6f74@gregkh> X-Mailer: git-send-email 2.45.1 Precedence: bulk X-Mailing-List: linux-cve-announce@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Reply-to: , X-Developer-Signature: v=1; a=openpgp-sha256; l=3502; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=kS779CtYhRiyyvyOUcnHUiCXzXIHYNyCvYEZLXug0H4=; b=owGbwMvMwCRo6H6F97bub03G02pJDGmeF1z2f1NYYzbRQCGsLPiVp+aj6Wt1/u2N2vOp+swnW 63YpTe2dsSyMAgyMciKKbJ82cZzdH/FIUUvQ9vTMHNYmUCGMHBxCsBEIo4yzK/Qi7Nb3eXbffGv SvjcN8sbSuqv6zIsWJNiva+O//LCd8dTpk75z3D+7KSslwA= X-Developer-Key: i=gregkh@linuxfoundation.org; a=openpgp; fpr=F4B60CC5BF78C2214A313DCB3147D40DDB2DFB29 Content-Transfer-Encoding: 8bit Description =========== In the Linux kernel, the following vulnerability has been resolved: rcu/nocb: Fix WARN_ON_ONCE() in the rcu_nocb_bypass_lock() For the kernels built with CONFIG_RCU_NOCB_CPU_DEFAULT_ALL=y and CONFIG_RCU_LAZY=y, the following scenarios will trigger WARN_ON_ONCE() in the rcu_nocb_bypass_lock() and rcu_nocb_wait_contended() functions: CPU2 CPU11 kthread rcu_nocb_cb_kthread ksys_write rcu_do_batch vfs_write rcu_torture_timer_cb proc_sys_write __kmem_cache_free proc_sys_call_handler kmemleak_free drop_caches_sysctl_handler delete_object_full drop_slab __delete_object shrink_slab put_object lazy_rcu_shrink_scan call_rcu rcu_nocb_flush_bypass __call_rcu_commn rcu_nocb_bypass_lock raw_spin_trylock(&rdp->nocb_bypass_lock) fail atomic_inc(&rdp->nocb_lock_contended); rcu_nocb_wait_contended WARN_ON_ONCE(smp_processor_id() != rdp->cpu); WARN_ON_ONCE(atomic_read(&rdp->nocb_lock_contended)) | |_ _ _ _ _ _ _ _ _ _same rdp and rdp->cpu != 11_ _ _ _ _ _ _ _ _ __| Reproduce this bug with "echo 3 > /proc/sys/vm/drop_caches". This commit therefore uses rcu_nocb_try_flush_bypass() instead of rcu_nocb_flush_bypass() in lazy_rcu_shrink_scan(). If the nocb_bypass queue is being flushed, then rcu_nocb_try_flush_bypass will return directly. The Linux kernel CVE team has assigned CVE-2024-35929 to this issue. Affected and fixed versions =========================== Fixed in 6.6.27 with commit 4d58c9fb45c7 Fixed in 6.8.6 with commit 927d1f4f77e4 Fixed in 6.9 with commit dda98810b552 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-2024-35929 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/rcu/tree_nocb.h 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/4d58c9fb45c70e62c19e8be3f3605889c47601bc https://git.kernel.org/stable/c/927d1f4f77e4784ab3944a9df86ab14d1cd3185a https://git.kernel.org/stable/c/dda98810b552fc6bf650f4270edeebdc2f28bd3f