diff options
Diffstat (limited to 'fs/exec.c')
-rw-r--r-- | fs/exec.c | 13 |
1 files changed, 7 insertions, 6 deletions
@@ -105,7 +105,7 @@ static inline void put_binfmt(struct linux_binfmt * fmt) | |||
105 | SYSCALL_DEFINE1(uselib, const char __user *, library) | 105 | SYSCALL_DEFINE1(uselib, const char __user *, library) |
106 | { | 106 | { |
107 | struct file *file; | 107 | struct file *file; |
108 | char *tmp = getname(library); | 108 | struct filename *tmp = getname(library); |
109 | int error = PTR_ERR(tmp); | 109 | int error = PTR_ERR(tmp); |
110 | static const struct open_flags uselib_flags = { | 110 | static const struct open_flags uselib_flags = { |
111 | .open_flag = O_LARGEFILE | O_RDONLY | __FMODE_EXEC, | 111 | .open_flag = O_LARGEFILE | O_RDONLY | __FMODE_EXEC, |
@@ -116,7 +116,7 @@ SYSCALL_DEFINE1(uselib, const char __user *, library) | |||
116 | if (IS_ERR(tmp)) | 116 | if (IS_ERR(tmp)) |
117 | goto out; | 117 | goto out; |
118 | 118 | ||
119 | file = do_filp_open(AT_FDCWD, tmp, &uselib_flags, LOOKUP_FOLLOW); | 119 | file = do_filp_open(AT_FDCWD, tmp->name, &uselib_flags, LOOKUP_FOLLOW); |
120 | putname(tmp); | 120 | putname(tmp); |
121 | error = PTR_ERR(file); | 121 | error = PTR_ERR(file); |
122 | if (IS_ERR(file)) | 122 | if (IS_ERR(file)) |
@@ -1664,10 +1664,10 @@ SYSCALL_DEFINE3(execve, | |||
1664 | const char __user *const __user *, argv, | 1664 | const char __user *const __user *, argv, |
1665 | const char __user *const __user *, envp) | 1665 | const char __user *const __user *, envp) |
1666 | { | 1666 | { |
1667 | const char *path = getname(filename); | 1667 | struct filename *path = getname(filename); |
1668 | int error = PTR_ERR(path); | 1668 | int error = PTR_ERR(path); |
1669 | if (!IS_ERR(path)) { | 1669 | if (!IS_ERR(path)) { |
1670 | error = do_execve(path, argv, envp, current_pt_regs()); | 1670 | error = do_execve(path->name, argv, envp, current_pt_regs()); |
1671 | putname(path); | 1671 | putname(path); |
1672 | } | 1672 | } |
1673 | return error; | 1673 | return error; |
@@ -1677,10 +1677,11 @@ asmlinkage long compat_sys_execve(const char __user * filename, | |||
1677 | const compat_uptr_t __user * argv, | 1677 | const compat_uptr_t __user * argv, |
1678 | const compat_uptr_t __user * envp) | 1678 | const compat_uptr_t __user * envp) |
1679 | { | 1679 | { |
1680 | const char *path = getname(filename); | 1680 | struct filename *path = getname(filename); |
1681 | int error = PTR_ERR(path); | 1681 | int error = PTR_ERR(path); |
1682 | if (!IS_ERR(path)) { | 1682 | if (!IS_ERR(path)) { |
1683 | error = compat_do_execve(path, argv, envp, current_pt_regs()); | 1683 | error = compat_do_execve(path->name, argv, envp, |
1684 | current_pt_regs()); | ||
1684 | putname(path); | 1685 | putname(path); |
1685 | } | 1686 | } |
1686 | return error; | 1687 | return error; |