mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-29 11:11:45 -04:00
parent
22bd002ee7
commit
72c2d53192
29 changed files with 74 additions and 97 deletions
35
fs/exec.c
35
fs/exec.c
|
|
@ -106,6 +106,7 @@ static inline void put_binfmt(struct linux_binfmt * fmt)
|
|||
*/
|
||||
SYSCALL_DEFINE1(uselib, const char __user *, library)
|
||||
{
|
||||
struct linux_binfmt *fmt;
|
||||
struct file *file;
|
||||
struct filename *tmp = getname(library);
|
||||
int error = PTR_ERR(tmp);
|
||||
|
|
@ -136,24 +137,21 @@ SYSCALL_DEFINE1(uselib, const char __user *, library)
|
|||
fsnotify_open(file);
|
||||
|
||||
error = -ENOEXEC;
|
||||
if(file->f_op) {
|
||||
struct linux_binfmt * fmt;
|
||||
|
||||
read_lock(&binfmt_lock);
|
||||
list_for_each_entry(fmt, &formats, lh) {
|
||||
if (!fmt->load_shlib)
|
||||
continue;
|
||||
if (!try_module_get(fmt->module))
|
||||
continue;
|
||||
read_unlock(&binfmt_lock);
|
||||
error = fmt->load_shlib(file);
|
||||
read_lock(&binfmt_lock);
|
||||
put_binfmt(fmt);
|
||||
if (error != -ENOEXEC)
|
||||
break;
|
||||
}
|
||||
read_lock(&binfmt_lock);
|
||||
list_for_each_entry(fmt, &formats, lh) {
|
||||
if (!fmt->load_shlib)
|
||||
continue;
|
||||
if (!try_module_get(fmt->module))
|
||||
continue;
|
||||
read_unlock(&binfmt_lock);
|
||||
error = fmt->load_shlib(file);
|
||||
read_lock(&binfmt_lock);
|
||||
put_binfmt(fmt);
|
||||
if (error != -ENOEXEC)
|
||||
break;
|
||||
}
|
||||
read_unlock(&binfmt_lock);
|
||||
exit:
|
||||
fput(file);
|
||||
out:
|
||||
|
|
@ -1277,13 +1275,10 @@ static int check_unsafe_exec(struct linux_binprm *bprm)
|
|||
*/
|
||||
int prepare_binprm(struct linux_binprm *bprm)
|
||||
{
|
||||
umode_t mode;
|
||||
struct inode * inode = file_inode(bprm->file);
|
||||
struct inode *inode = file_inode(bprm->file);
|
||||
umode_t mode = inode->i_mode;
|
||||
int retval;
|
||||
|
||||
mode = inode->i_mode;
|
||||
if (bprm->file->f_op == NULL)
|
||||
return -EACCES;
|
||||
|
||||
/* clear any previous set[ug]id data from a previous binary */
|
||||
bprm->cred->euid = current_euid();
|
||||
|
|
|
|||
Loading…
Reference in a new issue