Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1795154248; b=QNLIzWlo+A43YO27x8OFiJQK7F62aGwD9bzRYAHNmA+JDJnClD4ayaYzi+4k0w9Fepnt nUBjL/O9hmkSSJJNcVCHwUGxvwRohh/KBiQRQvTeZCcytJLKwtLwH5nG/LHkJ2PNpgK86 iEXEHZaQ3sIzVATNBuA3lpe9TJukiyMUIer+DCePEEFTNlJmz+wpK7Tj1kwbdCGVYtK/o hazupqiHtswDnnXAMFOEzjXg1k3DpLEcx1PevQjmFZ0rAA6/ly+8heCaHtJiJ6GtCgLh8 TTzxK0pQAc5dViWc23y2v2YlkfRQ9b6G8MfyHgdhhorMKSWckBjgf70i3MQzqZUYjvQ== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1795154248; h=Received:DKIM-Signature:From:To:Cc:Subject:Date:Message-ID:X-Mailer: Reply-To:MIME-Version:Lines:X-Developer-Signature:X-Developer-Key: Content-Transfer-Encoding; bh=Y8y9lyLtTI/3pXg6Ciq6jNZYER0k49Umlf5oadmxmBA=; b=kzeZpKY5WX4Lq2JUBEI2lF+DdMSHN6TGzDaE5k+T4mp8NtGDffzzR37LEN83CMZX2Ux6 AR2E1RibPYcAbRmGmMfA7vCpSB6a6eGqZdq7J34O/YM7b+CgehAElkZeqQk/OdwhbbFQ4 D2qdlOyw3y0gRODl7ZX+QXt9kwE1mu5wkaDTSORhZZZ9ENrldipGac9YtsCl/TjCHDMjX eEuyIGVl4NVkGPTqb/mnZIB5WuD0o+Li1oZR3/OjiW5rwNjwUwsBV9c7QBC3+QIG9+QAl IXtc00WqV3OtHeta6Gey7S5xVIsYo0k5CVxzfytrXzB1u2S/kWiFAeXS/sD3Ufx9b4A== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=linuxfoundation.org header.i=@linuxfoundation.org header.a=rsa-sha256 header.s=korg header.b=l1XbVNil; arc=none smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 1BFFF60A2627 for ; Fri, 20 Nov 2026 05:57:28 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.a=rsa-sha256 header.s=korg header.b=l1XbVNil Received: by smtp.kernel.org (Postfix) with ESMTPSA id 6AC321F000CA; Fri, 20 Nov 2026 05:57:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1795154248; bh=Y8y9lyLtTI/3pXg6Ciq6jNZYER0k49Umlf5oadmxmBA=; h=From:To:Cc:Subject:Date:Reply-To; b=l1XbVNiloXDqdG7KllBAPh4jTSEm4r4VFaHWy8iNyRo57J0x7Wl5RLc9BLp0O/mHm +GUJkyzu1CkQyeXOe4ldrYmYacnJKGlqEVfkRTN4Baf8AnrXd83bsMOWwnwdF4iYkj /Ou1Yg6EI6/mvh89Z0wg1/teLAmo+fTclB7OGURk= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2026-99640: ovl: do not let chattr change the casefold flag Date: Fri, 20 Nov 2026 06:50:26 +0100 Message-ID: <2026112040-CVE-2026-99640-4067@gregkh> X-Mailer: git-send-email 2.56.1 Reply-To: , X-Mailing-List: linux-cve-announce@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=4678; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=fp9Q3T2Kk//Jv9ck3VdKjLts0Q2OcsIa1nCsONgR23I=; b=owGbwMvMwCRo6H6F97bub03G02pJDFn/75c4MO002ZJ6q2ZmkaVfSXzcD7Ebm46ls57RTnZTX GjmLZHYEcvCIMjEICumyPJlG8/R/RWHFL0MbU/DzGFlAhnCwMUpABPhOMmw4NCRE3IFIj0iai9P V8vfUBd2sa9OYlhwaru6MlOhSVSIe3RClf/aaPE9nKwA 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: ovl: do not let chattr change the casefold flag chattr +F or -F on an overlay directory can make the directory, or the whole mount, unusable. Lookups of the directory, and lookups in it, then fail. From code inspection, the caller only needs to own the directory. The upper filesystem must support casefolding: ext4 or f2fs with the casefold feature, or tmpfs with the casefold option. chattr +F and -F set and clear FS_CASEFOLD_FL, the casefold flag of a directory. The flag enables casefolding (case-insensitive name lookup) for the directory. All directories of an overlay must match the casefold state that was recorded at mount time, and ovl_lookup_single() enforces this: - A lookup in a directory that does not match fails with -ESTALE. - A lookup of the directory itself fails with -EREMOTE. ovl_fileattr_set() copies the directory up, which creates it in the upper layer if it only existed in a lower layer. It then passes FS_CASEFOLD_FL on to the upper filesystem. The upper filesystem accepts the change if the upper directory is empty, regardless of what the merged directory contains. The merged directory is the one that the user sees, with the names from the upper and the lower directories. After the change the upper directory no longer matches the mount. If the directory is the root of the overlay, the whole mount is affected. The flag can also change without chattr +F or -F. chattr reads all flags of a directory, changes one and writes all of them back. For a directory that only exists in a lower layer, overlayfs reads the flags from the lower filesystem. xfs with the ascii-ci feature reports FS_CASEFOLD_FL on every inode, but never sets S_CASEFOLD, the inode flag that overlayfs compares with the mount. So its directories count as not casefolded. With a lower layer on such an xfs and an upper layer on ext4 with the casefold feature, chattr +A on a lower-only directory therefore sets FS_CASEFOLD_FL on the new, empty upper directory. Reproduced as root on tmpfs and on ext4 with chattr +F or -F on an overlay directory whose upper directory was empty. Afterwards lookups below it failed with ESTALE, and lookups of the directory itself failed with EREMOTE. The chattr +A case was seen once, on a kernel with an earlier form of this patch that still passed the caller's flag on: lookups of the directory failed with EREMOTE. Fix this by returning -EOPNOTSUPP if FS_IOC_SETFLAGS, the only call that can change the flag, asks for a casefold flag on a directory that does not agree with the casefold state of the mount. This also refuses the chattr +A case above. [amir: check the flag against the casefold state of the mount instead of reading back the flags] The Linux kernel CVE team has assigned CVE-2026-99640 to this issue. Affected and fixed versions =========================== Issue introduced in 6.17 with commit 083957f9614a8b2e284dbb3a85c5fec8e2fb26b8 and fixed in 6.18.64 with commit ba93074fc1ae11a6c33bb2752ccae6304ab1668e Issue introduced in 6.17 with commit 083957f9614a8b2e284dbb3a85c5fec8e2fb26b8 and fixed in 7.3.5 with commit 0f21cfc2a16f79b52cae10649b0f001fe6ffbf9d Issue introduced in 6.17 with commit 083957f9614a8b2e284dbb3a85c5fec8e2fb26b8 and fixed in 7.4-rc2 with commit 83b351c3ade542bbfa1073e8c2d919826628252a 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-99640 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/inode.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/ba93074fc1ae11a6c33bb2752ccae6304ab1668e https://git.kernel.org/stable/c/0f21cfc2a16f79b52cae10649b0f001fe6ffbf9d https://git.kernel.org/stable/c/83b351c3ade542bbfa1073e8c2d919826628252a