projects
/
platform
/
kernel
/
linux-stable.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
0903a0c
)
lookup_one_len: don't accept . and ..
author
Al Viro
<viro@zeniv.linux.org.uk>
Fri, 30 Nov 2012 03:17:21 +0000
(22:17 -0500)
committer
Al Viro
<viro@zeniv.linux.org.uk>
Fri, 30 Nov 2012 03:17:21 +0000
(22:17 -0500)
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
fs/namei.c
patch
|
blob
|
history
diff --git
a/fs/namei.c
b/fs/namei.c
index 937f9d50c84bdead7516057fead3d5a702ead4b9..5f4cdf3ad913fec928835d87fbe499efdf7d67e5 100644
(file)
--- 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')