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


Groups > linux.kernel > #1525648

Re: [REVIEW][PATCH 1/3] ptrace: Capture the ptracer's creds not PT_PTRACE_CAP

From ebiederm@xmission.com (Eric W. Biederman)
Newsgroups linux.kernel
Subject Re: [REVIEW][PATCH 1/3] ptrace: Capture the ptracer's creds not PT_PTRACE_CAP
Date 2016-11-18 20:00 +0100
Message-ID <sEWye-2tW-37@gated-at.bofh.it> (permalink)
References (14 earlier) <su6AW-6Om-1@gated-at.bofh.it> <su8jn-7Y3-9@gated-at.bofh.it> <sEyme-3v8-89@gated-at.bofh.it> <sEyvU-3yz-25@gated-at.bofh.it> <sEE8i-7lb-15@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


Kees Cook <keescook@chromium.org> writes:

> On Thu, Nov 17, 2016 at 9:05 AM, Eric W. Biederman
> <ebiederm@xmission.com> wrote:
>>
>> When the flag PT_PTRACE_CAP was added the PTRACE_TRACEME path was
>> overlooked.  This can result in incorrect behavior when an application
>> like strace traces an exec of a setuid executable.
>>
>> Further PT_PTRACE_CAP does not have enough information for making good
>> security decisions as it does not report which user namespace the
>> capability is in.  This has already allowed one mistake through
>> insufficient granulariy.
>>
>> I found this issue when I was testing another corner case of exec and
>> discovered that I could not get strace to set PT_PTRACE_CAP even when
>> running strace as root with a full set of caps.
>>
>> This change fixes the above issue with strace allowing stracing as
>> root a setuid executable without disabling setuid.  More fundamentaly
>> this change allows what is allowable at all times, by using the correct
>> information in it's decision.
>>
>> Cc: stable@vger.kernel.org
>> Fixes: 4214e42f96d4 ("v2.4.9.11 -> v2.4.9.12")
>> Signed-off-by: "Eric W. Biederman" <ebiederm@xmission.com>
>> ---
>> [...]
>> diff --git a/include/linux/sched.h b/include/linux/sched.h
>> index 348f51b0ec92..8fe58255d219 100644
>> --- a/include/linux/sched.h
>> +++ b/include/linux/sched.h
>> @@ -1656,6 +1656,7 @@ struct task_struct {
>>         struct list_head cpu_timers[3];
>>
>>  /* process credentials */
>> +       const struct cred __rcu *ptracer_cred; /* Tracer's dredentials at attach */
>
> Typo: credentials.

Thank you, fixed.

Eric

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


Thread

[REVIEW][PATCH 0/3] Fixing ptrace vs exec vs userns interactions ebiederm@xmission.com (Eric W. Biederman) - 2016-11-17 18:10 +0100
  [REVIEW][PATCH 1/3] ptrace: Capture the ptracer's creds not PT_PTRACE_CAP ebiederm@xmission.com (Eric W. Biederman) - 2016-11-17 18:20 +0100
    Re: [REVIEW][PATCH 1/3] ptrace: Capture the ptracer's creds not PT_PTRACE_CAP Kees Cook <keescook@chromium.org> - 2016-11-18 00:20 +0100
      Re: [REVIEW][PATCH 1/3] ptrace: Capture the ptracer's creds not PT_PTRACE_CAP ebiederm@xmission.com (Eric W. Biederman) - 2016-11-18 20:00 +0100
    Re: [REVIEW][PATCH 1/3] ptrace: Capture the ptracer's creds not PT_PTRACE_CAP Andy Lutomirski <luto@amacapital.net> - 2016-11-18 00:30 +0100
      Re: [REVIEW][PATCH 1/3] ptrace: Capture the ptracer's creds not PT_PTRACE_CAP ebiederm@xmission.com (Eric W. Biederman) - 2016-11-18 00:50 +0100
  [REVIEW][PATCH 3/3] exec: Ensure mm->user_ns contains the execed files ebiederm@xmission.com (Eric W. Biederman) - 2016-11-17 18:20 +0100
  [REVIEW][PATCH 2/3] exec: Don't allow ptracing an exec of an unreadable file ebiederm@xmission.com (Eric W. Biederman) - 2016-11-17 18:20 +0100
    Re: [REVIEW][PATCH 2/3] exec: Don't allow ptracing an exec of an  unreadable file Willy Tarreau <w@1wt.eu> - 2016-11-17 21:50 +0100
      Re: [REVIEW][PATCH 2/3] exec: Don't allow ptracing an exec of an  unreadable file Kees Cook <keescook@chromium.org> - 2016-11-17 22:10 +0100
        Re: [REVIEW][PATCH 2/3] exec: Don't allow ptracing an exec of an  unreadable file Willy Tarreau <w@1wt.eu> - 2016-11-17 22:40 +0100
          Re: [REVIEW][PATCH 2/3] exec: Don't allow ptracing an exec of an unreadable file ebiederm@xmission.com (Eric W. Biederman) - 2016-11-17 23:00 +0100
            [REVIEW][PATCH 2/3] ptrace: Don't allow accessing an undumpable mm ebiederm@xmission.com (Eric W. Biederman) - 2016-11-18 00:00 +0100
              Re: [REVIEW][PATCH 2/3] ptrace: Don't allow accessing an undumpable mm Kees Cook <keescook@chromium.org> - 2016-11-18 00:20 +0100
        Re: [REVIEW][PATCH 2/3] exec: Don't allow ptracing an exec of an  unreadable file Andy Lutomirski <luto@amacapital.net> - 2016-11-18 00:30 +0100
    Re: [REVIEW][PATCH 2/3] exec: Don't allow ptracing an exec of an  unreadable file Andy Lutomirski <luto@amacapital.net> - 2016-11-18 00:40 +0100
      Re: [REVIEW][PATCH 2/3] exec: Don't allow ptracing an exec of an unreadable file ebiederm@xmission.com (Eric W. Biederman) - 2016-11-18 01:00 +0100
        Re: [REVIEW][PATCH 2/3] exec: Don't allow ptracing an exec of an  unreadable file Andy Lutomirski <luto@amacapital.net> - 2016-11-18 01:20 +0100
          Re: [REVIEW][PATCH 2/3] exec: Don't allow ptracing an exec of an unreadable file ebiederm@xmission.com (Eric W. Biederman) - 2016-11-18 01:40 +0100
  Re: [REVIEW][PATCH 0/3] Fixing ptrace vs exec vs userns interactions Willy Tarreau <w@1wt.eu> - 2016-11-19 08:20 +0100
    Re: [REVIEW][PATCH 0/3] Fixing ptrace vs exec vs userns interactions Willy Tarreau <w@1wt.eu> - 2016-11-19 10:30 +0100
      Re: [REVIEW][PATCH 0/3] Fixing ptrace vs exec vs userns interactions Willy Tarreau <w@1wt.eu> - 2016-11-19 10:40 +0100
      Re: [REVIEW][PATCH 0/3] Fixing ptrace vs exec vs userns interactions ebiederm@xmission.com (Eric W. Biederman) - 2016-11-19 19:50 +0100
    Re: [REVIEW][PATCH 0/3] Fixing ptrace vs exec vs userns interactions ebiederm@xmission.com (Eric W. Biederman) - 2016-11-19 19:40 +0100
      Re: [REVIEW][PATCH 0/3] Fixing ptrace vs exec vs userns interactions ebiederm@xmission.com (Eric W. Biederman) - 2016-11-19 19:50 +0100

csiph-web