From mboxrd@z Thu Jan 1 00:00:00 1970 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 DFF5521ADC9 for ; Wed, 26 Feb 2025 02:27:36 +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=1740536857; cv=none; b=En76KNlTUaAOu5PP1OJT0OpzZZH+K6P+5Gv98RFhp0AWYSI/aSsxiW8paya8FUeOVR2gyawQlEICGb857QbUd6xL97mdRrgjns/wF20IvizIJ7j2/b5uywI+Jr/J7Ks2+1RC6u84CQ1AnX8xBSOwmyjL4GG5Ccr5zq+pce0eD4M= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1740536857; c=relaxed/simple; bh=qQAQhMSBTkuJG+bynvlq5+Se0XnUytoi9U9Pphph/rI=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=pRArkAl99ZIqGOTimissQf8Nc3oQSaA6mA+WJhSnC9lVq2OHvemvmmYFvpoM/HikATxcFX6EFTTMpizbndHGPJ45abVnWknYVvBLKn6wM2ZR3rDHTW/e5eNO39b9yoxZKCj0tkC0EpqqXWJOTiZhrX00Ot2eM42HDMQlertDVnk= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=ZoHzGahR; 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="ZoHzGahR" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 598CAC4CEE6; Wed, 26 Feb 2025 02:27:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1740536856; bh=qQAQhMSBTkuJG+bynvlq5+Se0XnUytoi9U9Pphph/rI=; h=From:To:Cc:Subject:Date:Reply-to:From; b=ZoHzGahRJWgL76w6aiF5yn7FkanSrV+7bbT7M3H0FS4+X4iWvqvKmQDi6iFZUTLnl fsOWpeJZrwvKxsjHgP2utWPqzwSMXVRXfDqGJRgUSdWuQ61n7cavMTGyPCP9VAse+g BNKi5tCj/EvTy4LWGKgSKvKRjyUOUXJVN4NmRwKE= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2022-49699: filemap: Handle sibling entries in filemap_get_read_batch() Date: Wed, 26 Feb 2025 03:24:22 +0100 Message-ID: <2025022628-CVE-2022-49699-d60e@gregkh> X-Mailer: git-send-email 2.48.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=2256; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=qQAQhMSBTkuJG+bynvlq5+Se0XnUytoi9U9Pphph/rI=; b=owGbwMvMwCRo6H6F97bub03G02pJDOn7qp6e5LnkduX4r7IW/vPNBbF1ZytK1UNP94uvL/Rcq aAfUBzeEcvCIMjEICumyPJlG8/R/RWHFL0MbU/DzGFlAhnCwMUpABOZNY9hvuvaFp7//Z2nnVlL 2t7dEvuR8nPGRIb5+elLww5wrCh+PWnzCplrsbubFn/QAwA= 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: filemap: Handle sibling entries in filemap_get_read_batch() If a read races with an invalidation followed by another read, it is possible for a folio to be replaced with a higher-order folio. If that happens, we'll see a sibling entry for the new folio in the next iteration of the loop. This manifests as a NULL pointer dereference while holding the RCU read lock. Handle this by simply returning. The next call will find the new folio and handle it correctly. The other ways of handling this rare race are more complex and it's just not worth it. The Linux kernel CVE team has assigned CVE-2022-49699 to this issue. Affected and fixed versions =========================== Issue introduced in 5.12 with commit cbd59c48ae2bcadc4a7599c29cf32fd3f9b78251 and fixed in 5.18.8 with commit a66f131d30e53000f08301776bf85c912ef47aad Issue introduced in 5.12 with commit cbd59c48ae2bcadc4a7599c29cf32fd3f9b78251 and fixed in 5.19 with commit cb995f4eeba9d268fd4b56c2423ad6c1d1ea1b82 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-49699 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: mm/filemap.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/a66f131d30e53000f08301776bf85c912ef47aad https://git.kernel.org/stable/c/cb995f4eeba9d268fd4b56c2423ad6c1d1ea1b82