diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2008-07-22 09:59:21 -0400 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2008-07-26 20:53:34 -0400 |
commit | 2d8f30380ab8c706f4e0a8f1aaa22b5886e9ac8a (patch) | |
tree | b798097fd831eab39f35c8c2e5a8ccfd7a850ef5 /arch | |
parent | 256984a83880ff7ac78055cb87baea48137f0b77 (diff) |
[PATCH] sanitize __user_walk_fd() et.al.
* do not pass nameidata; struct path is all the callers want.
* switch to new helpers:
user_path_at(dfd, pathname, flags, &path)
user_path(pathname, &path)
user_lpath(pathname, &path)
user_path_dir(pathname, &path) (fail if not a directory)
The last 3 are trivial macro wrappers for the first one.
* remove nameidata in callers.
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/alpha/kernel/osf_sys.c | 10 | ||||
-rw-r--r-- | arch/parisc/hpux/sys_hpux.c | 10 |
2 files changed, 10 insertions, 10 deletions
diff --git a/arch/alpha/kernel/osf_sys.c b/arch/alpha/kernel/osf_sys.c index 32ca1b927307..6e943135f0e0 100644 --- a/arch/alpha/kernel/osf_sys.c +++ b/arch/alpha/kernel/osf_sys.c | |||
@@ -253,15 +253,15 @@ do_osf_statfs(struct dentry * dentry, struct osf_statfs __user *buffer, | |||
253 | } | 253 | } |
254 | 254 | ||
255 | asmlinkage int | 255 | asmlinkage int |
256 | osf_statfs(char __user *path, struct osf_statfs __user *buffer, unsigned long bufsiz) | 256 | osf_statfs(char __user *pathname, struct osf_statfs __user *buffer, unsigned long bufsiz) |
257 | { | 257 | { |
258 | struct nameidata nd; | 258 | struct path path; |
259 | int retval; | 259 | int retval; |
260 | 260 | ||
261 | retval = user_path_walk(path, &nd); | 261 | retval = user_path(pathname, &path); |
262 | if (!retval) { | 262 | if (!retval) { |
263 | retval = do_osf_statfs(nd.path.dentry, buffer, bufsiz); | 263 | retval = do_osf_statfs(path.dentry, buffer, bufsiz); |
264 | path_put(&nd.path); | 264 | path_put(&path); |
265 | } | 265 | } |
266 | return retval; | 266 | return retval; |
267 | } | 267 | } |
diff --git a/arch/parisc/hpux/sys_hpux.c b/arch/parisc/hpux/sys_hpux.c index be255ebb609c..18072e03a019 100644 --- a/arch/parisc/hpux/sys_hpux.c +++ b/arch/parisc/hpux/sys_hpux.c | |||
@@ -210,19 +210,19 @@ static int vfs_statfs_hpux(struct dentry *dentry, struct hpux_statfs *buf) | |||
210 | } | 210 | } |
211 | 211 | ||
212 | /* hpux statfs */ | 212 | /* hpux statfs */ |
213 | asmlinkage long hpux_statfs(const char __user *path, | 213 | asmlinkage long hpux_statfs(const char __user *pathname, |
214 | struct hpux_statfs __user *buf) | 214 | struct hpux_statfs __user *buf) |
215 | { | 215 | { |
216 | struct nameidata nd; | 216 | struct path path; |
217 | int error; | 217 | int error; |
218 | 218 | ||
219 | error = user_path_walk(path, &nd); | 219 | error = user_path(pathname, &path); |
220 | if (!error) { | 220 | if (!error) { |
221 | struct hpux_statfs tmp; | 221 | struct hpux_statfs tmp; |
222 | error = vfs_statfs_hpux(nd.path.dentry, &tmp); | 222 | error = vfs_statfs_hpux(path.dentry, &tmp); |
223 | if (!error && copy_to_user(buf, &tmp, sizeof(tmp))) | 223 | if (!error && copy_to_user(buf, &tmp, sizeof(tmp))) |
224 | error = -EFAULT; | 224 | error = -EFAULT; |
225 | path_put(&nd.path); | 225 | path_put(&path); |
226 | } | 226 | } |
227 | return error; | 227 | return error; |
228 | } | 228 | } |