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 362861ACEDF for ; Sun, 19 Jan 2025 10:19: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=1737281996; cv=none; b=QuXlQukxHtUzcw4aSI8Ckp0uEbfzMtevMRO0RQOiDz+bsWk1U2XVzQWyZS6QwRXbD7wQAUvtnd5qNY7b3l3frktf31uy8j1VtfpmzfiOYT7qp+alF0rEwvvkzEPUgo4s9KSAoKlhoVBW6HhbiAMYwFn8u+O6H9Vs/zlVj8dMS8o= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737281996; c=relaxed/simple; bh=whpvsox0TswwUbKKNfo7ywPT4VB6tTk/7WQMsSw5QZk=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=H7WxqJ+13kgX6KEWmaOj0IxzUsKLNii8EDtKRxZYwUtWtVuPVa++uqjJ925ajCJHhK6GycFy/q7halhYUWDsnIgdnNPqEUfeQsqDVI3C9GFVsVTl3eHGW4oXH8JFs7VBsNKsNEV3HG/RIabiQr13VD7EuS6Rgg4vf94wW4yKhts= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=Ew84DNxx; 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="Ew84DNxx" Received: by smtp.kernel.org (Postfix) with ESMTPSA id AAF5DC4CED6; Sun, 19 Jan 2025 10:19:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1737281996; bh=whpvsox0TswwUbKKNfo7ywPT4VB6tTk/7WQMsSw5QZk=; h=From:To:Cc:Subject:Date:Reply-to:From; b=Ew84DNxxQyXSVEjVW1dzdhuX4u0GagZVTULCigqNO3wWsrBSQqN9z8+R7myVp8jMA W6AkSiQDED7kDeYENbACPapCh3K/HyyhDMGB7ckD+TvhfSnlbpZriwSgb4UG+WvnUe Tsz2wATBPN+8H0y74VdPtsaCWaJ7Ip5CWZXaVxU4= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2025-21654: ovl: support encoding fid from inode with no alias Date: Sun, 19 Jan 2025 11:18:03 +0100 Message-ID: <2025011947-CVE-2025-21654-5eac@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=3120; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=whpvsox0TswwUbKKNfo7ywPT4VB6tTk/7WQMsSw5QZk=; b=owGbwMvMwCRo6H6F97bub03G02pJDOk9F73f1wrwc1VM9lwl3hyWkyi8vkLjl/DEtcFWP5Zw3 FmeyGfcEcvCIMjEICumyPJlG8/R/RWHFL0MbU/DzGFlAhnCwMUpABN5VMewYNatxrt3zfTk+n+l +lps+aLOJnuanWF+/JLyzv+N3MdX5y7b5lx8efrO0r53AA== 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: ovl: support encoding fid from inode with no alias Dmitry Safonov reported that a WARN_ON() assertion can be trigered by userspace when calling inotify_show_fdinfo() for an overlayfs watched inode, whose dentry aliases were discarded with drop_caches. The WARN_ON() assertion in inotify_show_fdinfo() was removed, because it is possible for encoding file handle to fail for other reason, but the impact of failing to encode an overlayfs file handle goes beyond this assertion. As shown in the LTP test case mentioned in the link below, failure to encode an overlayfs file handle from a non-aliased inode also leads to failure to report an fid with FAN_DELETE_SELF fanotify events. As Dmitry notes in his analyzis of the problem, ovl_encode_fh() fails if it cannot find an alias for the inode, but this failure can be fixed. ovl_encode_fh() seldom uses the alias and in the case of non-decodable file handles, as is often the case with fanotify fid info, ovl_encode_fh() never needs to use the alias to encode a file handle. Defer finding an alias until it is actually needed so ovl_encode_fh() will not fail in the common case of FAN_DELETE_SELF fanotify events. The Linux kernel CVE team has assigned CVE-2025-21654 to this issue. Affected and fixed versions =========================== Issue introduced in 6.6 with commit 16aac5ad1fa94894b798dd522c5c3a6a0628d7f0 and fixed in 6.6.72 with commit a1a541fbfa7e97c1100144db34b57553d7164ce5 Issue introduced in 6.6 with commit 16aac5ad1fa94894b798dd522c5c3a6a0628d7f0 and fixed in 6.12.10 with commit 3c7c90274ae339e1ad443c9be1c67a20b80b9c76 Issue introduced in 6.6 with commit 16aac5ad1fa94894b798dd522c5c3a6a0628d7f0 and fixed in 6.13-rc7 with commit c45beebfde34aa71afbc48b2c54cdda623515037 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-2025-21654 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/overlayfs/export.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/a1a541fbfa7e97c1100144db34b57553d7164ce5 https://git.kernel.org/stable/c/3c7c90274ae339e1ad443c9be1c67a20b80b9c76 https://git.kernel.org/stable/c/c45beebfde34aa71afbc48b2c54cdda623515037