Kees Cook <[email protected]> wrote:

> -     /* clear any previous set[ug]id data from a previous binary */
> +     /*
> +      * Since this can be called multiple times (via prepare_binprm),
> +      * we must clear any previous work done when setting set[ug]id
> +      * bits from any earlier bprm->file uses (for example when run
> +      * first for a script then for its interpreter).
> +      */
>       bprm->cred->euid = current_euid();
>       bprm->cred->egid = current_egid();

I would further add that this is where we deal with setuid scripts.

David

Reply via email to