Skip to content

Commit 7ba8385

Browse files
author
Darrick J. Wong
committed
xfs: deprecate the ascii-ci feature
This feature is a mess -- the hash function has been broken for the entire 15 years of its existence if you create names with extended ascii bytes; metadump name obfuscation has silently failed for just as long; and the feature clashes horribly with the UTF8 encodings that most systems use today. There is exactly one fstest for this feature. In other words, this feature is crap. Let's deprecate it now so we can remove it from the codebase in 2030. Signed-off-by: Darrick J. Wong <djwong@kernel.org> Reviewed-by: Christoph Hellwig <hch@lst.de>
1 parent 6db09a8 commit 7ba8385

3 files changed

Lines changed: 41 additions & 0 deletions

File tree

Documentation/admin-guide/xfs.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -240,6 +240,7 @@ Deprecated Mount Options
240240
Name Removal Schedule
241241
=========================== ================
242242
Mounting with V4 filesystem September 2030
243+
Mounting ascii-ci filesystem September 2030
243244
ikeep/noikeep September 2025
244245
attr2/noattr2 September 2025
245246
=========================== ================

fs/xfs/Kconfig

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,33 @@ config XFS_SUPPORT_V4
4747
To continue supporting the old V4 format (crc=0), say Y.
4848
To close off an attack surface, say N.
4949

50+
config XFS_SUPPORT_ASCII_CI
51+
bool "Support deprecated case-insensitive ascii (ascii-ci=1) format"
52+
depends on XFS_FS
53+
default y
54+
help
55+
The ASCII case insensitivity filesystem feature only works correctly
56+
on systems that have been coerced into using ISO 8859-1, and it does
57+
not work on extended attributes. The kernel has no visibility into
58+
the locale settings in userspace, so it corrupts UTF-8 names.
59+
Enabling this feature makes XFS vulnerable to mixed case sensitivity
60+
attacks. Because of this, the feature is deprecated. All users
61+
should upgrade by backing up their files, reformatting, and restoring
62+
from the backup.
63+
64+
Administrators and users can detect such a filesystem by running
65+
xfs_info against a filesystem mountpoint and checking for a string
66+
beginning with "ascii-ci=". If the string "ascii-ci=1" is found, the
67+
filesystem is a case-insensitive filesystem. If no such string is
68+
found, please upgrade xfsprogs to the latest version and try again.
69+
70+
This option will become default N in September 2025. Support for the
71+
feature will be removed entirely in September 2030. Distributors
72+
can say N here to withdraw support earlier.
73+
74+
To continue supporting case-insensitivity (ascii-ci=1), say Y.
75+
To close off an attack surface, say N.
76+
5077
config XFS_QUOTA
5178
bool "XFS Quota support"
5279
depends on XFS_FS

fs/xfs/xfs_super.c

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1548,6 +1548,19 @@ xfs_fs_fill_super(
15481548
#endif
15491549
}
15501550

1551+
/* ASCII case insensitivity is undergoing deprecation. */
1552+
if (xfs_has_asciici(mp)) {
1553+
#ifdef CONFIG_XFS_SUPPORT_ASCII_CI
1554+
xfs_warn_once(mp,
1555+
"Deprecated ASCII case-insensitivity feature (ascii-ci=1) will not be supported after September 2030.");
1556+
#else
1557+
xfs_warn(mp,
1558+
"Deprecated ASCII case-insensitivity feature (ascii-ci=1) not supported by kernel.");
1559+
error = -EINVAL;
1560+
goto out_free_sb;
1561+
#endif
1562+
}
1563+
15511564
/* Filesystem claims it needs repair, so refuse the mount. */
15521565
if (xfs_has_needsrepair(mp)) {
15531566
xfs_warn(mp, "Filesystem needs repair. Please run xfs_repair.");

0 commit comments

Comments
 (0)