aboutsummaryrefslogtreecommitdiffstats
path: root/fs/namei.c
diff options
context:
space:
mode:
authorChristian Brauner <brauner@kernel.org>2024-01-23 17:25:51 +0100
committerChristian Brauner <brauner@kernel.org>2024-01-23 17:56:30 +0100
commit0000ff2523df42bcf3c2fe3e8daaeca038835487 (patch)
tree1be5d8f49a61fe06ce678aba9fa55cf513caf7c0 /fs/namei.c
parentbd46543d7f9a8b2c03420499b1885287e96aaf28 (diff)
parent42c3732fa8073717dd7d924472f1c0bc5b452fdc (diff)
downloadlinux-0000ff2523df42bcf3c2fe3e8daaeca038835487.tar.gz
Merge tag 'exportfs-6.9' of ssh://gitolite.kernel.org/pub/scm/linux/kernel/git/cel/linux
Merge exportfs fixes from Chuck Lever: * tag 'exportfs-6.9' of ssh://gitolite.kernel.org/pub/scm/linux/kernel/git/cel/linux: fs: Create a generic is_dot_dotdot() utility exportfs: fix the fallback implementation of the get_name export operation Link: https://lore.kernel.org/r/BDC2AEB4-7085-4A7C-8DE8-A659FE1DBA6A@oracle.com Signed-off-by: Christian Brauner <brauner@kernel.org>
Diffstat (limited to 'fs/namei.c')
-rw-r--r--fs/namei.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/fs/namei.c b/fs/namei.c
index 4e0de939fea12..4c961e07157c0 100644
--- a/fs/namei.c
+++ b/fs/namei.c
@@ -2676,10 +2676,8 @@ static int lookup_one_common(struct mnt_idmap *idmap,
if (!len)
return -EACCES;
- if (unlikely(name[0] == '.')) {
- if (len < 2 || (len == 2 && name[1] == '.'))
- return -EACCES;
- }
+ if (is_dot_dotdot(name, len))
+ return -EACCES;
while (len--) {
unsigned int c = *(const unsigned char *)name++;