diff options
Diffstat (limited to 'fs/exec.c')
| -rw-r--r-- | fs/exec.c | 12 |
1 files changed, 6 insertions, 6 deletions
| @@ -126,8 +126,7 @@ asmlinkage long sys_uselib(const char __user * library) | |||
| 126 | struct nameidata nd; | 126 | struct nameidata nd; |
| 127 | int error; | 127 | int error; |
| 128 | 128 | ||
| 129 | nd.intent.open.flags = FMODE_READ; | 129 | error = __user_path_lookup_open(library, LOOKUP_FOLLOW, &nd, FMODE_READ); |
| 130 | error = __user_walk(library, LOOKUP_FOLLOW|LOOKUP_OPEN, &nd); | ||
| 131 | if (error) | 130 | if (error) |
| 132 | goto out; | 131 | goto out; |
| 133 | 132 | ||
| @@ -139,7 +138,7 @@ asmlinkage long sys_uselib(const char __user * library) | |||
| 139 | if (error) | 138 | if (error) |
| 140 | goto exit; | 139 | goto exit; |
| 141 | 140 | ||
| 142 | file = dentry_open(nd.dentry, nd.mnt, O_RDONLY); | 141 | file = nameidata_to_filp(&nd, O_RDONLY); |
| 143 | error = PTR_ERR(file); | 142 | error = PTR_ERR(file); |
| 144 | if (IS_ERR(file)) | 143 | if (IS_ERR(file)) |
| 145 | goto out; | 144 | goto out; |
| @@ -167,6 +166,7 @@ asmlinkage long sys_uselib(const char __user * library) | |||
| 167 | out: | 166 | out: |
| 168 | return error; | 167 | return error; |
| 169 | exit: | 168 | exit: |
| 169 | release_open_intent(&nd); | ||
| 170 | path_release(&nd); | 170 | path_release(&nd); |
| 171 | goto out; | 171 | goto out; |
| 172 | } | 172 | } |
| @@ -490,8 +490,7 @@ struct file *open_exec(const char *name) | |||
| 490 | int err; | 490 | int err; |
| 491 | struct file *file; | 491 | struct file *file; |
| 492 | 492 | ||
| 493 | nd.intent.open.flags = FMODE_READ; | 493 | err = path_lookup_open(name, LOOKUP_FOLLOW, &nd, FMODE_READ); |
| 494 | err = path_lookup(name, LOOKUP_FOLLOW|LOOKUP_OPEN, &nd); | ||
| 495 | file = ERR_PTR(err); | 494 | file = ERR_PTR(err); |
| 496 | 495 | ||
| 497 | if (!err) { | 496 | if (!err) { |
| @@ -504,7 +503,7 @@ struct file *open_exec(const char *name) | |||
| 504 | err = -EACCES; | 503 | err = -EACCES; |
| 505 | file = ERR_PTR(err); | 504 | file = ERR_PTR(err); |
| 506 | if (!err) { | 505 | if (!err) { |
| 507 | file = dentry_open(nd.dentry, nd.mnt, O_RDONLY); | 506 | file = nameidata_to_filp(&nd, O_RDONLY); |
| 508 | if (!IS_ERR(file)) { | 507 | if (!IS_ERR(file)) { |
| 509 | err = deny_write_access(file); | 508 | err = deny_write_access(file); |
| 510 | if (err) { | 509 | if (err) { |
| @@ -516,6 +515,7 @@ out: | |||
| 516 | return file; | 515 | return file; |
| 517 | } | 516 | } |
| 518 | } | 517 | } |
| 518 | release_open_intent(&nd); | ||
| 519 | path_release(&nd); | 519 | path_release(&nd); |
| 520 | } | 520 | } |
| 521 | goto out; | 521 | goto out; |
