mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-28 18:51:56 -04:00
[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 <[email protected]>
This commit is contained in:
parent
256984a838
commit
2d8f30380a
13 changed files with 235 additions and 238 deletions
|
|
@ -152,18 +152,18 @@ long do_utimes(int dfd, char __user *filename, struct timespec *times, int flags
|
|||
error = utimes_common(&file->f_path, times);
|
||||
fput(file);
|
||||
} else {
|
||||
struct nameidata nd;
|
||||
struct path path;
|
||||
int lookup_flags = 0;
|
||||
|
||||
if (!(flags & AT_SYMLINK_NOFOLLOW))
|
||||
lookup_flags |= LOOKUP_FOLLOW;
|
||||
|
||||
error = __user_walk_fd(dfd, filename, lookup_flags, &nd);
|
||||
error = user_path_at(dfd, filename, lookup_flags, &path);
|
||||
if (error)
|
||||
goto out;
|
||||
|
||||
error = utimes_common(&nd.path, times);
|
||||
path_put(&nd.path);
|
||||
error = utimes_common(&path, times);
|
||||
path_put(&path);
|
||||
}
|
||||
|
||||
out:
|
||||
|
|
|
|||
Loading…
Reference in a new issue