diff options
Diffstat (limited to 'fs/exec.c')
| -rw-r--r-- | fs/exec.c | 14 |
1 files changed, 10 insertions, 4 deletions
| @@ -106,11 +106,17 @@ static inline void put_binfmt(struct linux_binfmt * fmt) | |||
| 106 | */ | 106 | */ |
| 107 | asmlinkage long sys_uselib(const char __user * library) | 107 | asmlinkage long sys_uselib(const char __user * library) |
| 108 | { | 108 | { |
| 109 | struct file * file; | 109 | struct file *file; |
| 110 | struct nameidata nd; | 110 | struct nameidata nd; |
| 111 | int error; | 111 | char *tmp = getname(library); |
| 112 | 112 | int error = PTR_ERR(tmp); | |
| 113 | error = __user_path_lookup_open(library, LOOKUP_FOLLOW, &nd, FMODE_READ|FMODE_EXEC); | 113 | |
| 114 | if (!IS_ERR(tmp)) { | ||
| 115 | error = path_lookup_open(AT_FDCWD, tmp, | ||
| 116 | LOOKUP_FOLLOW, &nd, | ||
| 117 | FMODE_READ|FMODE_EXEC); | ||
| 118 | putname(tmp); | ||
| 119 | } | ||
| 114 | if (error) | 120 | if (error) |
| 115 | goto out; | 121 | goto out; |
| 116 | 122 | ||
