aboutsummaryrefslogtreecommitdiff
path: root/fs/namei.c
diff options
context:
space:
mode:
authorMark Brown <broonie@opensource.wolfsonmicro.com>2012-12-15 23:56:43 +0900
committerMark Brown <broonie@opensource.wolfsonmicro.com>2012-12-15 23:56:43 +0900
commit326b06a8a9b09d6d9a276fd550b6b6bb138e9a47 (patch)
treeb9bdcb0bd635b91258cec09c981af2c5dcc0f683 /fs/namei.c
parent92b2e81d6f95bcee386abac4c4389f5b950f7bb9 (diff)
parent9bffb1fb7c22c96d51d4ba06e2e023dd568a5872 (diff)
Merge remote-tracking branch 'asoc/topic/core' into asoc-next
Diffstat (limited to 'fs/namei.c')
-rw-r--r--fs/namei.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/fs/namei.c b/fs/namei.c
index 937f9d50c84..5f4cdf3ad91 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)
if (!len)
return ERR_PTR(-EACCES);
+ if (unlikely(name[0] == '.')) {
+ if (len < 2 || (len == 2 && name[1] == '.'))
+ return ERR_PTR(-EACCES);
+ }
+
while (len--) {
c = *(const unsigned char *)name++;
if (c == '/' || c == '\0')