diff options
-rw-r--r-- | fs/exec.c | 8 | ||||
-rw-r--r-- | fs/namei.c | 8 | ||||
-rw-r--r-- | include/linux/fs.h | 1 |
3 files changed, 11 insertions, 6 deletions
diff --git a/fs/exec.c b/fs/exec.c index 38f63451b928..3b78b22addfb 100644 --- a/fs/exec.c +++ b/fs/exec.c @@ -2070,10 +2070,8 @@ SYSCALL_DEFINE5(execveat, const char __user *const __user *, envp, int, flags) { - int lookup_flags = (flags & AT_EMPTY_PATH) ? LOOKUP_EMPTY : 0; - return do_execveat(fd, - getname_flags(filename, lookup_flags, NULL), + getname_uflags(filename, flags), argv, envp, flags); } @@ -2091,10 +2089,8 @@ COMPAT_SYSCALL_DEFINE5(execveat, int, fd, const compat_uptr_t __user *, envp, int, flags) { - int lookup_flags = (flags & AT_EMPTY_PATH) ? LOOKUP_EMPTY : 0; - return compat_do_execveat(fd, - getname_flags(filename, lookup_flags, NULL), + getname_uflags(filename, flags), argv, envp, flags); } #endif diff --git a/fs/namei.c b/fs/namei.c index 522c35b33fea..41f58dabe84c 100644 --- a/fs/namei.c +++ b/fs/namei.c @@ -204,6 +204,14 @@ getname_flags(const char __user *filename, int flags, int *empty) } struct filename * +getname_uflags(const char __user *filename, int uflags) +{ + int flags = (uflags & AT_EMPTY_PATH) ? LOOKUP_EMPTY : 0; + + return getname_flags(filename, flags, NULL); +} + +struct filename * getname(const char __user * filename) { return getname_flags(filename, 0, NULL); diff --git a/include/linux/fs.h b/include/linux/fs.h index 640574294216..26d41a445e81 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h @@ -2786,6 +2786,7 @@ static inline struct file *file_clone_open(struct file *file) extern int filp_close(struct file *, fl_owner_t id); extern struct filename *getname_flags(const char __user *, int, int *); +extern struct filename *getname_uflags(const char __user *, int); extern struct filename *getname(const char __user *); extern struct filename *getname_kernel(const char *); extern void putname(struct filename *name); |