Re: [PATCH v2 2/8] exec: Move security_bprm_secureexec() earlier

2017-07-17 Thread Kees Cook
On Mon, Jul 10, 2017 at 7:07 PM, Kees Cook wrote: > On Mon, Jul 10, 2017 at 10:18 AM, Eric W. Biederman > wrote: >> Kees Cook writes: >> >>> On Mon, Jul 10, 2017 at 1:57 AM, Eric W. Biederman >>> wrote: Kees Cook writes: > There are several places where exec needs to know if a pr

Re: [PATCH v2 2/8] exec: Move security_bprm_secureexec() earlier

2017-07-10 Thread Kees Cook
On Mon, Jul 10, 2017 at 10:18 AM, Eric W. Biederman wrote: > Kees Cook writes: > >> On Mon, Jul 10, 2017 at 1:57 AM, Eric W. Biederman >> wrote: >>> Kees Cook writes: >>> There are several places where exec needs to know if a privilege-gain has happened. These should be using the resu

Re: [PATCH v2 2/8] exec: Move security_bprm_secureexec() earlier

2017-07-10 Thread Kees Cook
On Mon, Jul 10, 2017 at 1:57 AM, Eric W. Biederman wrote: > Kees Cook writes: > >> There are several places where exec needs to know if a privilege-gain has >> happened. These should be using the results of security_bprm_secureexec() >> but it is getting (needlessly) called very late. > > It is h

Re: [PATCH v2 2/8] exec: Move security_bprm_secureexec() earlier

2017-07-10 Thread Eric W. Biederman
Kees Cook writes: > There are several places where exec needs to know if a privilege-gain has > happened. These should be using the results of security_bprm_secureexec() > but it is getting (needlessly) called very late. It is hard to tell at a glance but I believe this introduces a regression.

[PATCH v2 2/8] exec: Move security_bprm_secureexec() earlier

2017-07-10 Thread Kees Cook
There are several places where exec needs to know if a privilege-gain has happened. These should be using the results of security_bprm_secureexec() but it is getting (needlessly) called very late. Instead, move this earlier in the exec code, to the start of the point of no return in setup_new_exec