* [PATCH 0/3] fs: reject casefolded names that fold to ".", "..", or empty
@ 2026-11-13 6:53 Sarthak Kukreti
2026-11-13 6:53 ` [PATCH 1/3] libfs: " Sarthak Kukreti
` (2 more replies)
0 siblings, 3 replies; 7+ messages in thread
From: Sarthak Kukreti @ 2026-11-13 6:53 UTC (permalink / raw)
To: Theodore Ts'o, Jaegeuk Kim, Chao Yu, Alexander Viro,
Christian Brauner
Cc: Gabriel Krisman Bertazi, Eric Biggers, Dmitry Torokhov,
linux-fsdevel, linux-ext4, linux-f2fs-devel, linux-kernel,
Sarthak Kukreti
Unicode normalization in fs/unicode strips Default_Ignorable_Code_Point
characters (such as U+202E RIGHT-TO-LEFT OVERRIDE and U+200B ZERO WIDTH
SPACE) in both UTF8_NFDI and UTF8_NFDICF. In casefolded directories,
filenames consisting of 0 to 2 ASCII dots plus ignorable code points
(e.g. "\u202e", ".\u202e", "..\u202e") pass VFS path walk as normal
multi-byte components, but fold to "", ".", or ".." in utf8_casefold():
1. Looking up ".\u202e" folds to "." and matches the on-disk "." entry
(de->inode == dir->i_ino) in generic_ci_match(), triggering
EXT4_ERROR_INODE ("linked to parent dir") in ext4_lookup().
2. Looking up "..\u202e" folds to ".." and matches the on-disk ".."
entry, returning -ELOOP via d_splice_alias() (or triggering
EXT4_ERROR_INODE on the root directory).
3. Filenames consisting solely of ignorable characters fold to "" (0
bytes), causing distinct ignorable-only filenames to hash and compare
equal and creating entries that e2fsck flags as corruption.
This series rejects casefolding and case-insensitive matching of names
that fold to "", ".", or ".." across libfs (d_hash, d_compare,
generic_ci_match, and generic_ci_validate_strict_name), ext4
(ext4_fname_setup_ci_filename and ext4fs_dirhash), and f2fs
(f2fs_init_casefolded_name), while preserving exact byte-equality
matching for genuine "." and ".." lookups (such as NFS ext4_get_parent)
and opaque byte fallback for invalid UTF-8 sequences in non-strict mode.
Dmitry Torokhov (1):
f2fs: reject casefolded names that fold to ".", "..", or empty
Sarthak Kukreti (2):
libfs: reject casefolded names that fold to ".", "..", or empty
ext4: reject casefolded names that fold to ".", "..", or empty
fs/ext4/hash-test.c | 12 ++++++++++++
fs/ext4/hash.c | 2 +-
fs/ext4/namei.c | 11 +++++++++--
fs/f2fs/dir.c | 6 +++++-
fs/libfs.c | 52 +++++++++++++++++++++++++++++++++++++++++++++++++++-
include/linux/fs.h | 29 +++++++++++++----------------
6 files changed, 91 insertions(+), 21 deletions(-)
--
2.56.0.611.g1030f0b940-goog
^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH 1/3] libfs: reject casefolded names that fold to ".", "..", or empty
2026-11-13 6:53 [PATCH 0/3] fs: reject casefolded names that fold to ".", "..", or empty Sarthak Kukreti
@ 2026-11-13 6:53 ` Sarthak Kukreti
2026-11-13 7:27 ` [f2fs-dev] " sashiko-bot
2026-11-13 6:53 ` [PATCH 2/3] ext4: " Sarthak Kukreti
2026-11-13 6:53 ` [PATCH 3/3] f2fs: " Sarthak Kukreti
2 siblings, 1 reply; 7+ messages in thread
From: Sarthak Kukreti @ 2026-11-13 6:53 UTC (permalink / raw)
To: Theodore Ts'o, Jaegeuk Kim, Chao Yu, Alexander Viro,
Christian Brauner
Cc: Gabriel Krisman Bertazi, Eric Biggers, Dmitry Torokhov,
linux-fsdevel, linux-ext4, linux-f2fs-devel, linux-kernel,
Sarthak Kukreti
Unicode normalization and casefolding (utf8_casefold()) strips code
points with the Default_Ignorable_Code_Point property, such as U+202E
(RIGHT-TO-LEFT OVERRIDE) or U+200B (ZERO WIDTH SPACE). As a result:
1. A filename consisting of "." or ".." followed by ignorable characters
(e.g. ".\xe2\x80\xae" or "..\xe2\x80\xae") bypasses VFS special-entry
handling during path walk, but casefolds to "." or "..".
2. A filename consisting solely of ignorable characters (e.g.
"\xe2\x80\xae") casefolds to the empty string "" (length 0), causing
any two distinct ignorable-only filenames to compare and hash as
equal.
Update generic_ci_d_hash(), generic_ci_d_compare(), generic_ci_match(),
and generic_ci_validate_strict_name() to reject case-insensitive
hashing, matching, and creation of filenames that casefold to "", ".",
or "..", while preserving exact byte-equality matches (such as NFS
export lookups of literal ".."). Using a 3-byte stack buffer with
utf8_casefold() detects all three cases in O(1) space without heap
allocations.
Fixes: c843843e714c ("fs: Add standard casefolding support")
Co-developed-by: Dmitry Torokhov <dtor@google.com>
Signed-off-by: Dmitry Torokhov <dtor@google.com>
Signed-off-by: Sarthak Kukreti <sarthakkukreti@google.com>
---
fs/libfs.c | 50 ++++++++++++++++++++++++++++++++++++++++++----
include/linux/fs.h | 31 ++++++++++++++++------------
2 files changed, 64 insertions(+), 17 deletions(-)
diff --git a/fs/libfs.c b/fs/libfs.c
index 27d7dc16fcb0..54296dfb8444 100644
--- a/fs/libfs.c
+++ b/fs/libfs.c
@@ -1801,8 +1801,11 @@ int generic_ci_d_compare(const struct dentry *dentry, unsigned int len,
{
const struct dentry *parent;
const struct inode *dir;
+ const struct unicode_map *um;
union shortname_store strbuf;
+ unsigned char buf[3];
struct qstr qstr;
+ int cf_len;
/*
* Attempt a case-sensitive match first. It is cheaper and
@@ -1821,6 +1824,19 @@ int generic_ci_d_compare(const struct dentry *dentry, unsigned int len,
if (!dir || !IS_CASEFOLDED(dir))
return 1;
+ if (name_is_dot_dotdot(str, len) ||
+ name_is_dot_dotdot(name->name, name->len))
+ return 1;
+
+ /*
+ * utf8_strncasecmp() only matches if both names casefold to the same
+ * byte sequence, so checking @name covers @qstr as well.
+ */
+ um = dentry->d_sb->s_encoding;
+ cf_len = utf8_casefold(um, name, buf, sizeof(buf));
+ if (cf_len == 0 || (cf_len > 0 && name_is_dot_dotdot(buf, cf_len)))
+ return 1;
+
qstr.len = len;
qstr.name = str;
/*
@@ -1839,7 +1855,7 @@ int generic_ci_d_compare(const struct dentry *dentry, unsigned int len,
barrier();
}
- return utf8_strncasecmp(dentry->d_sb->s_encoding, name, &qstr);
+ return utf8_strncasecmp(um, name, &qstr);
}
EXPORT_SYMBOL(generic_ci_d_compare);
@@ -1855,13 +1871,21 @@ int generic_ci_d_hash(const struct dentry *dentry, struct qstr *str)
const struct inode *dir = READ_ONCE(dentry->d_inode);
struct super_block *sb = dentry->d_sb;
const struct unicode_map *um = sb->s_encoding;
+ unsigned char buf[3];
int ret;
if (!dir || !IS_CASEFOLDED(dir))
return 0;
ret = utf8_casefold_hash(um, dentry, str);
- if (ret < 0 && sb_has_strict_encoding(sb))
+ if (ret < 0) {
+ if (sb_has_strict_encoding(sb))
+ return -EINVAL;
+ return 0;
+ }
+
+ ret = utf8_casefold(um, str, buf, sizeof(buf));
+ if (ret == 0 || (ret > 0 && name_is_dot_dotdot(buf, ret)))
return -EINVAL;
return 0;
}
@@ -1934,10 +1958,28 @@ int generic_ci_match(const struct inode *parent,
!memcmp(name->name, dirent.name, dirent.len))
goto out;
- if (folded_name->name)
+ if (name_is_dot_dotdot(dirent.name, dirent.len) ||
+ name_is_dot_dotdot(name->name, name->len) ||
+ (folded_name->name &&
+ (!folded_name->len ||
+ name_is_dot_dotdot(folded_name->name, folded_name->len)))) {
+ res = 1;
+ goto out;
+ }
+
+ if (folded_name->name) {
res = utf8_strncasecmp_folded(um, folded_name, &dirent);
- else
+ } else {
+ unsigned char buf[3];
+ int cf_len = utf8_casefold(um, name, buf, sizeof(buf));
+
+ if (cf_len == 0 ||
+ (cf_len > 0 && name_is_dot_dotdot(buf, cf_len))) {
+ res = 1;
+ goto out;
+ }
res = utf8_strncasecmp(um, name, &dirent);
+ }
out:
kfree(decrypted_name.name);
diff --git a/include/linux/fs.h b/include/linux/fs.h
index f9d1e05e8ae6..84f5ce2bb9ad 100644
--- a/include/linux/fs.h
+++ b/include/linux/fs.h
@@ -3356,28 +3356,26 @@ int generic_ci_d_compare(const struct dentry *dentry, unsigned int len,
* generic_ci_validate_strict_name - Check if a given name is suitable
* for a directory
*
- * This functions checks if the proposed filename is valid for the
- * parent directory. That means that only valid UTF-8 filenames will be
- * accepted for casefold directories from filesystems created with the
- * strict encoding flag. That also means that any name will be
- * accepted for directories that doesn't have casefold enabled, or
- * aren't being strict with the encoding.
+ * This function checks if the proposed filename is valid for the
+ * parent directory. Names that casefold to "", ".", or ".." are
+ * rejected for all casefolded directories. When the filesystem is
+ * created with the strict encoding flag, only valid UTF-8 filenames
+ * are accepted for casefolded directories.
*
* @dir: inode of the directory where the new file will be created
* @name: name of the new file
*
* Return:
- * * True: if the filename is suitable for this directory. It can be
- * true if a given name is not suitable for a strict encoding
- * directory, but the directory being used isn't strict
- * * False if the filename isn't suitable for this directory. This only
- * happens when a directory is casefolded and the filesystem is strict
- * about its encoding.
+ * * True: if the filename is suitable for this directory.
+ * * False: if the filename isn't suitable for this directory.
*/
static inline bool generic_ci_validate_strict_name(struct inode *dir,
const struct qstr *name)
{
- if (!IS_CASEFOLDED(dir) || !sb_has_strict_encoding(dir->i_sb))
+ unsigned char buf[3];
+ int len;
+
+ if (!IS_CASEFOLDED(dir))
return true;
/*
@@ -3387,6 +3385,13 @@ static inline bool generic_ci_validate_strict_name(struct inode *dir,
if (WARN_ON_ONCE(!dir->i_sb->s_encoding))
return true;
+ len = utf8_casefold(dir->i_sb->s_encoding, name, buf, sizeof(buf));
+ if (len == 0 || (len > 0 && name_is_dot_dotdot(buf, len)))
+ return false;
+
+ if (!sb_has_strict_encoding(dir->i_sb))
+ return true;
+
return !utf8_validate(dir->i_sb->s_encoding, name);
}
#else
--
2.56.0.611.g1030f0b940-goog
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [PATCH 2/3] ext4: reject casefolded names that fold to ".", "..", or empty
2026-11-13 6:53 [PATCH 0/3] fs: reject casefolded names that fold to ".", "..", or empty Sarthak Kukreti
2026-11-13 6:53 ` [PATCH 1/3] libfs: " Sarthak Kukreti
@ 2026-11-13 6:53 ` Sarthak Kukreti
2026-11-13 7:04 ` sashiko-bot
2026-11-13 6:53 ` [PATCH 3/3] f2fs: " Sarthak Kukreti
2 siblings, 1 reply; 7+ messages in thread
From: Sarthak Kukreti @ 2026-11-13 6:53 UTC (permalink / raw)
To: Theodore Ts'o, Jaegeuk Kim, Chao Yu, Alexander Viro,
Christian Brauner
Cc: Gabriel Krisman Bertazi, Eric Biggers, Dmitry Torokhov,
linux-fsdevel, linux-ext4, linux-f2fs-devel, linux-kernel,
Sarthak Kukreti
Filenames consisting solely of ignorable Unicode characters fold to
empty strings, while names with leading dots and ignorable characters
fold to "." or "..". Allowing such names to be created or looked up in
casefolded directories collides with on-disk "." and ".." entries (which
triggers EXT4_ERROR_INODE in ext4_lookup()) and introduces duplicate
entries that e2fsck flags as corruption.
Skip casefolding when the lookup name is literally "." or "..", reject
any non-dot names that fold to "", ".", or ".." in
ext4_fname_setup_ci_filename(), and fall back to opaque byte hashing in
ext4fs_dirhash() when utf8_casefold() yields "", ".", or "..".
Fixes: b886ee3e778e ("ext4: Support case-insensitive file name lookups")
Co-developed-by: Dmitry Torokhov <dtor@google.com>
Signed-off-by: Dmitry Torokhov <dtor@google.com>
Signed-off-by: Sarthak Kukreti <sarthakkukreti@google.com>
---
fs/ext4/hash-test.c | 14 ++++++++++++++
fs/ext4/hash.c | 2 +-
fs/ext4/namei.c | 9 +++++++--
3 files changed, 22 insertions(+), 3 deletions(-)
diff --git a/fs/ext4/hash-test.c b/fs/ext4/hash-test.c
index 49b0d874c833..a8b206a6d751 100644
--- a/fs/ext4/hash-test.c
+++ b/fs/ext4/hash-test.c
@@ -541,6 +541,20 @@ static void test_ext4fs_dirhash_casefold_fallback(struct kunit *test)
KUNIT_ASSERT_EQ(test, ret_plain, 0);
KUNIT_EXPECT_EQ(test, folded_dir.hash, plain.hash);
KUNIT_EXPECT_EQ(test, folded_dir.minor_hash, plain.minor_hash);
+
+ ret_cf = ext4fs_dirhash(&ei->vfs_inode, ".\xe2\x80\xae", 4, &folded_dir);
+ ret_plain = ext4fs_dirhash(plain_dir, ".\xe2\x80\xae", 4, &plain);
+ KUNIT_ASSERT_EQ(test, ret_cf, 0);
+ KUNIT_ASSERT_EQ(test, ret_plain, 0);
+ KUNIT_EXPECT_EQ(test, folded_dir.hash, plain.hash);
+ KUNIT_EXPECT_EQ(test, folded_dir.minor_hash, plain.minor_hash);
+
+ ret_cf = ext4fs_dirhash(&ei->vfs_inode, "\xe2\x80\xae", 3, &folded_dir);
+ ret_plain = ext4fs_dirhash(plain_dir, "\xe2\x80\xae", 3, &plain);
+ KUNIT_ASSERT_EQ(test, ret_cf, 0);
+ KUNIT_ASSERT_EQ(test, ret_plain, 0);
+ KUNIT_EXPECT_EQ(test, folded_dir.hash, plain.hash);
+ KUNIT_EXPECT_EQ(test, folded_dir.minor_hash, plain.minor_hash);
}
#endif
diff --git a/fs/ext4/hash.c b/fs/ext4/hash.c
index 978bd92da0ad..65019de4af93 100644
--- a/fs/ext4/hash.c
+++ b/fs/ext4/hash.c
@@ -327,7 +327,7 @@ int ext4fs_dirhash(const struct inode *dir, const char *name, int len,
return -ENOMEM;
dlen = utf8_casefold(um, &qstr, buff, PATH_MAX);
- if (dlen < 0) {
+ if (dlen <= 0 || name_is_dot_dotdot(buff, dlen)) {
kfree(buff);
goto opaque_seq;
}
diff --git a/fs/ext4/namei.c b/fs/ext4/namei.c
index a6386c1d237f..096f78ea5df4 100644
--- a/fs/ext4/namei.c
+++ b/fs/ext4/namei.c
@@ -1368,7 +1368,8 @@ int ext4_fname_setup_ci_filename(struct inode *dir, const struct qstr *iname,
int len;
if (!IS_CASEFOLDED(dir) ||
- (IS_ENCRYPTED(dir) && !fscrypt_has_encryption_key(dir))) {
+ (IS_ENCRYPTED(dir) && !fscrypt_has_encryption_key(dir)) ||
+ name_is_dot_dotdot(iname->name, iname->len)) {
cf_name->name = NULL;
return 0;
}
@@ -1378,9 +1379,13 @@ int ext4_fname_setup_ci_filename(struct inode *dir, const struct qstr *iname,
return -ENOMEM;
len = utf8_casefold(dir->i_sb->s_encoding, iname, buf, EXT4_NAME_LEN);
- if (len <= 0) {
+ if (len < 0) {
kfree(buf);
buf = NULL;
+ } else if (len == 0 || name_is_dot_dotdot(buf, len)) {
+ kfree(buf);
+ cf_name->name = NULL;
+ return -EINVAL;
}
cf_name->name = buf;
cf_name->len = (unsigned) len;
--
2.56.0.611.g1030f0b940-goog
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [PATCH 3/3] f2fs: reject casefolded names that fold to ".", "..", or empty
2026-11-13 6:53 [PATCH 0/3] fs: reject casefolded names that fold to ".", "..", or empty Sarthak Kukreti
2026-11-13 6:53 ` [PATCH 1/3] libfs: " Sarthak Kukreti
2026-11-13 6:53 ` [PATCH 2/3] ext4: " Sarthak Kukreti
@ 2026-11-13 6:53 ` Sarthak Kukreti
2026-11-13 7:00 ` sashiko-bot
2 siblings, 1 reply; 7+ messages in thread
From: Sarthak Kukreti @ 2026-11-13 6:53 UTC (permalink / raw)
To: Theodore Ts'o, Jaegeuk Kim, Chao Yu, Alexander Viro,
Christian Brauner
Cc: Gabriel Krisman Bertazi, Eric Biggers, Dmitry Torokhov,
linux-fsdevel, linux-ext4, linux-f2fs-devel, linux-kernel,
Sarthak Kukreti
From: Dmitry Torokhov <dtor@google.com>
Filenames consisting only of ignorable Unicode characters fold to empty
strings, and names with leading dots and ignorable characters can fold
to "." or "..". Allowing such names in casefolded directories can corrupt
directory structure or cause confusion with special entries.
Reject any non-dot names that fold to empty, ".", or ".." during
casefolded name setup, while still allowing invalid UTF-8 sequences to
be handled as opaque byte sequences when strict mode is not enabled.
Fixes: 2c2eb7a300cd ("f2fs: Support case-insensitive file name lookups")
Signed-off-by: Dmitry Torokhov <dtor@google.com>
Signed-off-by: Sarthak Kukreti <sarthakkukreti@google.com>
---
fs/f2fs/dir.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/fs/f2fs/dir.c b/fs/f2fs/dir.c
index fd0e2cd31a81..a20723edb724 100644
--- a/fs/f2fs/dir.c
+++ b/fs/f2fs/dir.c
@@ -77,13 +77,17 @@ int f2fs_init_casefolded_name(const struct inode *dir,
len = utf8_casefold(sb->s_encoding, fname->usr_fname,
buf, F2FS_NAME_LEN);
- if (len <= 0) {
+ if (len < 0) {
kmem_cache_free(f2fs_cf_name_slab, buf);
if (sb_has_strict_encoding(sb))
return -EINVAL;
/* fall back to treating name as opaque byte sequence */
return 0;
}
+ if (len == 0 || name_is_dot_dotdot(buf, len)) {
+ kmem_cache_free(f2fs_cf_name_slab, buf);
+ return -EINVAL;
+ }
fname->cf_name.name = buf;
fname->cf_name.len = len;
}
--
2.56.0.611.g1030f0b940-goog
^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [PATCH 3/3] f2fs: reject casefolded names that fold to ".", "..", or empty
2026-11-13 6:53 ` [PATCH 3/3] f2fs: " Sarthak Kukreti
@ 2026-11-13 7:00 ` sashiko-bot
0 siblings, 0 replies; 7+ messages in thread
From: sashiko-bot @ 2026-11-13 7:00 UTC (permalink / raw)
To: Sarthak Kukreti; +Cc: linux-ext4, tytso
> From: Dmitry Torokhov <dtor@google.com>
>
> Filenames consisting only of ignorable Unicode characters fold to empty
> strings, and names with leading dots and ignorable characters can fold
> to "." or "..". Allowing such names in casefolded directories can corrupt
> directory structure or cause confusion with special entries.
>
> Reject any non-dot names that fold to empty, ".", or ".." during
> casefolded name setup, while still allowing invalid UTF-8 sequences to
> be handled as opaque byte sequences when strict mode is not enabled.
>
> Fixes: 2c2eb7a300cd ("f2fs: Support case-insensitive file name lookups")
> Signed-off-by: Dmitry Torokhov <dtor@google.com>
> Signed-off-by: Sarthak Kukreti <sarthakkukreti@google.com>
Sashiko has reviewed this patch and found no issues.
--
Sashiko AI review · https://sashiko.dev/#/patchset/20261113065332.929085-1-sarthakkukreti@google.com?part=3
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH 2/3] ext4: reject casefolded names that fold to ".", "..", or empty
2026-11-13 6:53 ` [PATCH 2/3] ext4: " Sarthak Kukreti
@ 2026-11-13 7:04 ` sashiko-bot
0 siblings, 0 replies; 7+ messages in thread
From: sashiko-bot @ 2026-11-13 7:04 UTC (permalink / raw)
To: Sarthak Kukreti; +Cc: linux-ext4, tytso
> Filenames consisting solely of ignorable Unicode characters fold to
> empty strings, while names with leading dots and ignorable characters
> fold to "." or "..". Allowing such names to be created or looked up in
> casefolded directories collides with on-disk "." and ".." entries (which
> triggers EXT4_ERROR_INODE in ext4_lookup()) and introduces duplicate
> entries that e2fsck flags as corruption.
>
> Skip casefolding when the lookup name is literally "." or "..", reject
> any non-dot names that fold to "", ".", or ".." in
> ext4_fname_setup_ci_filename(), and fall back to opaque byte hashing in
> ext4fs_dirhash() when utf8_casefold() yields "", ".", or "..".
>
> Fixes: b886ee3e778e ("ext4: Support case-insensitive file name lookups")
> Co-developed-by: Dmitry Torokhov <dtor@google.com>
> Signed-off-by: Dmitry Torokhov <dtor@google.com>
> Signed-off-by: Sarthak Kukreti <sarthakkukreti@google.com>
Sashiko has reviewed this patch and found no issues.
--
Sashiko AI review · https://sashiko.dev/#/patchset/20261113065332.929085-1-sarthakkukreti@google.com?part=2
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [f2fs-dev] [PATCH 1/3] libfs: reject casefolded names that fold to ".", "..", or empty
2026-11-13 6:53 ` [PATCH 1/3] libfs: " Sarthak Kukreti
@ 2026-11-13 7:27 ` sashiko-bot
0 siblings, 0 replies; 7+ messages in thread
From: sashiko-bot @ 2026-11-13 7:27 UTC (permalink / raw)
To: Sarthak Kukreti via Linux-f2fs-devel; +Cc: linux-ext4, tytso
> Unicode normalization and casefolding (utf8_casefold()) strips code
> points with the Default_Ignorable_Code_Point property, such as U+202E
> (RIGHT-TO-LEFT OVERRIDE) or U+200B (ZERO WIDTH SPACE). As a result:
>
> 1. A filename consisting of "." or ".." followed by ignorable characters
> (e.g. ".\xe2\x80\xae" or "..\xe2\x80\xae") bypasses VFS special-entry
> handling during path walk, but casefolds to "." or "..".
> 2. A filename consisting solely of ignorable characters (e.g.
> "\xe2\x80\xae") casefolds to the empty string "" (length 0), causing
> any two distinct ignorable-only filenames to compare and hash as
> equal.
>
> Update generic_ci_d_hash(), generic_ci_d_compare(), generic_ci_match(),
> and generic_ci_validate_strict_name() to reject case-insensitive
> hashing, matching, and creation of filenames that casefold to "", ".",
> or "..", while preserving exact byte-equality matches (such as NFS
> export lookups of literal ".."). Using a 3-byte stack buffer with
> utf8_casefold() detects all three cases in O(1) space without heap
> allocations.
>
> Fixes: c843843e714c ("fs: Add standard casefolding support")
> Co-developed-by: Dmitry Torokhov <dtor@google.com>
> Signed-off-by: Dmitry Torokhov <dtor@google.com>
> Signed-off-by: Sarthak Kukreti <sarthakkukreti@google.com>
Sashiko has reviewed this patch and found no issues.
--
Sashiko AI review · https://sashiko.dev/#/patchset/20261113065332.929085-1-sarthakkukreti@google.com?part=1
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2026-11-13 7:27 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-13 6:53 [PATCH 0/3] fs: reject casefolded names that fold to ".", "..", or empty Sarthak Kukreti
2026-11-13 6:53 ` [PATCH 1/3] libfs: " Sarthak Kukreti
2026-11-13 7:27 ` [f2fs-dev] " sashiko-bot
2026-11-13 6:53 ` [PATCH 2/3] ext4: " Sarthak Kukreti
2026-11-13 7:04 ` sashiko-bot
2026-11-13 6:53 ` [PATCH 3/3] f2fs: " Sarthak Kukreti
2026-11-13 7:00 ` sashiko-bot
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox