diff options
author | Christian Brauner <brauner@kernel.org> | 2024-01-23 19:25:51 +0300 |
---|---|---|
committer | Christian Brauner <brauner@kernel.org> | 2024-01-23 19:56:30 +0300 |
commit | 0000ff2523df42bcf3c2fe3e8daaeca038835487 (patch) | |
tree | 1be5d8f49a61fe06ce678aba9fa55cf513caf7c0 /fs/namei.c | |
parent | bd46543d7f9a8b2c03420499b1885287e96aaf28 (diff) | |
parent | 42c3732fa8073717dd7d924472f1c0bc5b452fdc (diff) | |
download | linux-0000ff2523df42bcf3c2fe3e8daaeca038835487.tar.xz |
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.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/fs/namei.c b/fs/namei.c index 4e0de939fea1..4c961e07157c 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++; |