aboutsummaryrefslogtreecommitdiffstats
path: root/fs/proc/internal.h
diff options
context:
space:
mode:
authorAlexey Dobriyan <adobriyan@gmail.com>2014-08-08 17:21:25 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2014-08-08 18:57:22 -0400
commitdbcdb504417ae108a20454ef89776a614b948571 (patch)
tree397a024e382d28f09ccb020d4a2daedd2d251e9d /fs/proc/internal.h
parentccf94f1b4a8560ffdc221840535bae5e5a91a53c (diff)
proc: add and remove /proc entry create checks
* remove proc_create(NULL, ...) check, let it oops * warn about proc_create("", ...) and proc_create("very very long name", ...) proc code keeps length as u8, no 256+ name length possible * warn about proc_create("123", ...) /proc/$PID and /proc/misc namespaces are separate things, but dumb module might create funky a-la $PID entry. * remove post mortem strchr('/') check Triggering it implies either strchr() is buggy or memory corruption. It should be VFS check anyway. In reality, none of these checks will ever trigger, it is preparation for the next patch. Based on patch from Al Viro. Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com> Cc: Al Viro <viro@zeniv.linux.org.uk> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'fs/proc/internal.h')
-rw-r--r--fs/proc/internal.h6
1 files changed, 3 insertions, 3 deletions
diff --git a/fs/proc/internal.h b/fs/proc/internal.h
index 3ab6d14e71c5..a38408a1dd84 100644
--- a/fs/proc/internal.h
+++ b/fs/proc/internal.h
@@ -112,10 +112,10 @@ static inline int task_dumpable(struct task_struct *task)
112 return 0; 112 return 0;
113} 113}
114 114
115static inline unsigned name_to_int(struct dentry *dentry) 115static inline unsigned name_to_int(const struct qstr *qstr)
116{ 116{
117 const char *name = dentry->d_name.name; 117 const char *name = qstr->name;
118 int len = dentry->d_name.len; 118 int len = qstr->len;
119 unsigned n = 0; 119 unsigned n = 0;
120 120
121 if (len > 1 && *name == '0') 121 if (len > 1 && *name == '0')