diff options
Diffstat (limited to 'fs/namei.c')
-rw-r--r-- | fs/namei.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/fs/namei.c b/fs/namei.c index 937f9d50c84b..5f4cdf3ad913 100644 --- a/fs/namei.c +++ b/fs/namei.c | |||
@@ -2131,6 +2131,11 @@ struct dentry *lookup_one_len(const char *name, struct dentry *base, int len) | |||
2131 | if (!len) | 2131 | if (!len) |
2132 | return ERR_PTR(-EACCES); | 2132 | return ERR_PTR(-EACCES); |
2133 | 2133 | ||
2134 | if (unlikely(name[0] == '.')) { | ||
2135 | if (len < 2 || (len == 2 && name[1] == '.')) | ||
2136 | return ERR_PTR(-EACCES); | ||
2137 | } | ||
2138 | |||
2134 | while (len--) { | 2139 | while (len--) { |
2135 | c = *(const unsigned char *)name++; | 2140 | c = *(const unsigned char *)name++; |
2136 | if (c == '/' || c == '\0') | 2141 | if (c == '/' || c == '\0') |