Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1684390

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

From Kees Cook <keescook@chromium.org>
Newsgroups linux.kernel
Subject Re: [PATCH v2 2/8] exec: Move security_bprm_secureexec() earlier
Date 2017-07-10 18:10 +0200
Message-ID <u1Jq1-7dI-1@gated-at.bofh.it> (permalink)
References <u1BLP-2bz-7@gated-at.bofh.it> <u1BLQ-2bz-27@gated-at.bofh.it> <u1CRB-33O-33@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Mon, Jul 10, 2017 at 1:57 AM, Eric W. Biederman
<ebiederm@xmission.com> wrote:
> Kees Cook <keescook@chromium.org> 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.
>
> cap_bprm_set_creds is currently called before cap_bprm_secureexec and
> it has a number of cases such as no_new_privs and ptrace that can result
> in some of the precomputed credential changes not happening.
>
> Without accounting for that I believe your cap_bprm_securexec now
> returns a postive value too early.

It's still before cap_bprm_secureexec. cap_brpm_set_creds() is in
prepare_binprm(), which is well before exec_binprm() and it's eventual
call to setup_new_exec().

-Kees

-- 
Kees Cook
Pixel Security

Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH v2 0/8] exec: Use sane stack rlimit under secureexec Kees Cook <keescook@chromium.org> - 2017-07-10 10:00 +0200
  [PATCH v2 2/8] exec: Move security_bprm_secureexec() earlier Kees Cook <keescook@chromium.org> - 2017-07-10 10:00 +0200
    Re: [PATCH v2 2/8] exec: Move security_bprm_secureexec() earlier ebiederm@xmission.com (Eric W. Biederman) - 2017-07-10 11:10 +0200
      Re: [PATCH v2 2/8] exec: Move security_bprm_secureexec() earlier Kees Cook <keescook@chromium.org> - 2017-07-10 18:10 +0200
        Re: [PATCH v2 2/8] exec: Move security_bprm_secureexec() earlier Kees Cook <keescook@chromium.org> - 2017-07-11 04:10 +0200
          Re: [PATCH v2 2/8] exec: Move security_bprm_secureexec() earlier Kees Cook <keescook@chromium.org> - 2017-07-18 08:50 +0200
  [PATCH v2 6/8] exec: Consolidate dumpability logic Kees Cook <keescook@chromium.org> - 2017-07-10 10:00 +0200
  [PATCH v2 3/8] exec: Use secureexec for setting dumpability Kees Cook <keescook@chromium.org> - 2017-07-10 10:00 +0200
  [PATCH v2 4/8] exec: Use secureexec for clearing pdeath_signal Kees Cook <keescook@chromium.org> - 2017-07-10 10:10 +0200

csiph-web