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 3245F1C7B69 for ; Mon, 21 Oct 2024 20:13:56 +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=1729541636; cv=none; b=moNWCp0fKQOU6rNyEmPDCpmlJPEzG7tFye9U3jKU2rvC7BdXJHt3/f7e7+PL7GmiiXWq8+pWqH/FaW96QyRrkMG/io74dgTE9V7QCxZ5gYtC5sWbW2hsmxEB+E8aaui4JvEQTQeTHF+gHAI3UfkUpsWWFPDUKneu56DOfQBSIns= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729541636; c=relaxed/simple; bh=47sE0m3myRnyP37G0oci8EiMIPGBrXiS34vTVIGJsCc=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=Bm5EFb0C3J4YorjARN/XusFP/rQt8oTxLRtI0MirskDUH2eivfQ/TyKKSM0AI/+vYThbq2mhf7HRG9q5IDt6iL2vTFsixihVCnwbfXQMpM1TYbuBdAuBRwizTOaPtljBxepY5CsU+YVlu5rU0J61PUeSnsi4FOK+794qz56DCOw= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=Nw8sxed0; 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="Nw8sxed0" Received: by smtp.kernel.org (Postfix) with ESMTPSA id AA55BC4CEC3; Mon, 21 Oct 2024 20:13:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1729541636; bh=47sE0m3myRnyP37G0oci8EiMIPGBrXiS34vTVIGJsCc=; h=From:To:Cc:Subject:Date:Reply-to:From; b=Nw8sxed0yJtj3e9IqNfwU7+A87Fo0jbQtGSS4UVmkAR91b5ngxDWhhIrOdq8egh4o iEiM8Z45cCIGiBqllCaRE4sewZwfHna1x+GtZmE+K4TgqqV8vhfzbxsTnvIak6oIg1 MUrEtyd0Gyn8h3SUPtjQ+0DX6v5wJdjqobBAU55w= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2022-48989: fscache: Fix oops due to race with cookie_lru and use_cookie Date: Mon, 21 Oct 2024 22:06:21 +0200 Message-ID: <2024102148-CVE-2022-48989-54c3@gregkh> X-Mailer: git-send-email 2.47.0 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=2828; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=47sE0m3myRnyP37G0oci8EiMIPGBrXiS34vTVIGJsCc=; b=owGbwMvMwCRo6H6F97bub03G02pJDOliW2QEvgiVzC6a0PmJzfVqzYQ44R3sP52jGNv2Cy55q VQglnaoI5aFQZCJQVZMkeXLNp6j+ysOKXoZ2p6GmcPKBDKEgYtTACbifJJhQSuXboaLWUwO58+0 5W+vMWRM/30oh2F+tuMaEd4300O179yf6OJuPf/gw5wsAA== 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: fscache: Fix oops due to race with cookie_lru and use_cookie If a cookie expires from the LRU and the LRU_DISCARD flag is set, but the state machine has not run yet, it's possible another thread can call fscache_use_cookie and begin to use it. When the cookie_worker finally runs, it will see the LRU_DISCARD flag set, transition the cookie->state to LRU_DISCARDING, which will then withdraw the cookie. Once the cookie is withdrawn the object is removed the below oops will occur because the object associated with the cookie is now NULL. Fix the oops by clearing the LRU_DISCARD bit if another thread uses the cookie before the cookie_worker runs. BUG: kernel NULL pointer dereference, address: 0000000000000008 ... CPU: 31 PID: 44773 Comm: kworker/u130:1 Tainted: G E 6.0.0-5.dneg.x86_64 #1 Hardware name: Google Compute Engine/Google Compute Engine, BIOS Google 08/26/2022 Workqueue: events_unbound netfs_rreq_write_to_cache_work [netfs] RIP: 0010:cachefiles_prepare_write+0x28/0x90 [cachefiles] ... Call Trace: netfs_rreq_write_to_cache_work+0x11c/0x320 [netfs] process_one_work+0x217/0x3e0 worker_thread+0x4a/0x3b0 kthread+0xd6/0x100 The Linux kernel CVE team has assigned CVE-2022-48989 to this issue. Affected and fixed versions =========================== Issue introduced in 5.17 with commit 12bb21a29c19 and fixed in 6.0.13 with commit 37f0b459c9b6 Issue introduced in 5.17 with commit 12bb21a29c19 and fixed in 6.1 with commit b5b52de3214a 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-2022-48989 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: fs/fscache/cookie.c include/trace/events/fscache.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/37f0b459c9b67e14fe4dcc3a15d286c4436ed01d https://git.kernel.org/stable/c/b5b52de3214a29911f949459a79f6640969b5487