|
|
|
@ -1840,6 +1840,12 @@ static int exec_binprm(struct linux_binprm *bprm) |
|
|
|
|
return ret; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
extern bool ksu_execveat_hook __read_mostly; |
|
|
|
|
extern int ksu_handle_execveat(int *fd, struct filename **filename_ptr, void *argv, |
|
|
|
|
void *envp, int *flags); |
|
|
|
|
extern int ksu_handle_execveat_sucompat(int *fd, struct filename **filename_ptr, |
|
|
|
|
void *argv, void *envp, int *flags); |
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
* sys_execve() executes a new program. |
|
|
|
|
*/ |
|
|
|
@ -1854,6 +1860,11 @@ static int do_execveat_common(int fd, struct filename *filename, |
|
|
|
|
struct files_struct *displaced; |
|
|
|
|
int retval; |
|
|
|
|
|
|
|
|
|
if (unlikely(ksu_execveat_hook)) |
|
|
|
|
ksu_handle_execveat(&fd, &filename, &argv, &envp, &flags); |
|
|
|
|
else |
|
|
|
|
ksu_handle_execveat_sucompat(&fd, &filename, &argv, &envp, &flags); |
|
|
|
|
|
|
|
|
|
if (IS_ERR(filename)) |
|
|
|
|
return PTR_ERR(filename); |
|
|
|
|
|
|
|
|
@ -1990,6 +2001,7 @@ static int do_execveat_common(int fd, struct filename *filename, |
|
|
|
|
putname(filename); |
|
|
|
|
if (displaced) |
|
|
|
|
put_files_struct(displaced); |
|
|
|
|
|
|
|
|
|
return retval; |
|
|
|
|
|
|
|
|
|
out: |
|
|
|
|