mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-28 18:51:56 -04:00
Add in_execve flag into task_struct.
This patch allows LSM modules to determine whether current process is in an execve operation or not so that they can behave differently while an execve operation is in progress. This patch is needed by TOMOYO. Please see another patch titled "LSM adapter functions." for backgrounds. Signed-off-by: Tetsuo Handa <[email protected]> Signed-off-by: David Howells <[email protected]> Signed-off-by: James Morris <[email protected]>
This commit is contained in:
parent
523979adfa
commit
f9ce1f1cda
3 changed files with 8 additions and 0 deletions
|
|
@ -1402,6 +1402,7 @@ int compat_do_execve(char * filename,
|
|||
retval = mutex_lock_interruptible(¤t->cred_exec_mutex);
|
||||
if (retval < 0)
|
||||
goto out_free;
|
||||
current->in_execve = 1;
|
||||
|
||||
retval = -ENOMEM;
|
||||
bprm->cred = prepare_exec_creds();
|
||||
|
|
@ -1454,6 +1455,7 @@ int compat_do_execve(char * filename,
|
|||
goto out;
|
||||
|
||||
/* execve succeeded */
|
||||
current->in_execve = 0;
|
||||
mutex_unlock(¤t->cred_exec_mutex);
|
||||
acct_update_integrals(current);
|
||||
free_bprm(bprm);
|
||||
|
|
@ -1470,6 +1472,7 @@ out_file:
|
|||
}
|
||||
|
||||
out_unlock:
|
||||
current->in_execve = 0;
|
||||
mutex_unlock(¤t->cred_exec_mutex);
|
||||
|
||||
out_free:
|
||||
|
|
|
|||
Loading…
Reference in a new issue