mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: ebiederm@xmission.com (Eric W. Biederman)
To: Kees Cook <keescook@chromium.org>
Cc: "Michael Kerrisk \(man-pages\)" <mtk.manpages@gmail.com>,
	Jann Horn <jann@thejh.net>, James Morris <jmorris@namei.org>,
	linux-man <linux-man@vger.kernel.org>,
	Stephen Smalley <sds@tycho.nsa.gov>,
	lkml <linux-kernel@vger.kernel.org>,
	linux-security-module <linux-security-module@vger.kernel.org>,
	Linux API <linux-api@vger.kernel.org>,
	Oleg Nesterov <oleg@redhat.com>
Subject: Re: Documenting ptrace access mode checking
Date: Tue, 21 Jun 2016 15:58:39 -0500	[thread overview]
Message-ID: <878txyuum8.fsf@x220.int.ebiederm.org> (raw)
In-Reply-To: <CAGXu5jLwuqS5w-Thpngc=hFhXOdM-Q5_G1v9np1sOnmq+v2c4g@mail.gmail.com> (Kees Cook's message of "Tue, 21 Jun 2016 13:29:32 -0700")

Kees Cook <keescook@chromium.org> writes:

> On Tue, Jun 21, 2016 at 12:55 PM, Eric W. Biederman
> <ebiederm@xmission.com> wrote:
>
>> "Michael Kerrisk (man-pages)" <mtk.manpages@gmail.com> writes:
>>
>>>        The  algorithm  employed for ptrace access mode checking deter‐
>>>        mines whether the calling process is  allowed  to  perform  the
>>>        corresponding action on the target process, as follows:
>>>
>>>        1.  If the calling thread and the target thread are in the same
>>>            thread group, access is always allowed.
>>
>> This test only exsits because the LSMs historically and I suspect
>> continue to be broken and deny a process the ability to ptrace itself.
>
> Well, it's not that the LSMs are broken, it's that self-inspection is
> a short-circuited "allow". The LSMs aren't involved.

Long ago and far away.  I modified /proc/self/something to use the same
permissions as ptrace.  This broken everyone's selinux setups.  So the
short circuit was added.

Or in short the LSMs aren't involved because they got it wrong.

If the selinux breakage was not in the selinux rules that are loaded from
userspace but in the kernel module that short circuit check would have
been confined to selinux.

I have had an occasional thought and the occassional discussion about
removing that check and just fixing the LSMs but at this point I don't
think anyone cares enough to make that change.

Eric

  reply	other threads:[~2016-06-21 21:10 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-06-21  9:41 Michael Kerrisk (man-pages)
2016-06-21 19:55 ` Eric W. Biederman
2016-06-21 20:29   ` Kees Cook
2016-06-21 20:58     ` Eric W. Biederman [this message]
2016-06-22 19:20     ` Michael Kerrisk (man-pages)
2016-06-22 19:20   ` Michael Kerrisk (man-pages)
2016-06-23 19:04     ` Eric W. Biederman
2016-06-24  9:57       ` Michael Kerrisk (man-pages)
2016-06-22 21:51   ` Oleg Nesterov
2016-06-23  7:06     ` Michael Kerrisk (man-pages)
2016-06-23 18:56       ` Eric W. Biederman
2016-06-24  8:18         ` Michael Kerrisk (man-pages)
2016-06-21 20:55 ` Jann Horn
2016-06-22 19:21   ` Michael Kerrisk (man-pages)
2016-06-22 21:11     ` Kees Cook
2016-06-23  7:02       ` Michael Kerrisk (man-pages)
2016-06-24  8:40       ` Michael Kerrisk (man-pages)
2016-06-24 15:18         ` Casey Schaufler
2016-06-24 20:07           ` Kees Cook
2016-06-25  7:21           ` Michael Kerrisk (man-pages)
2016-06-22 22:44     ` Jann Horn
2016-06-23  7:42       ` Michael Kerrisk (man-pages)
2016-06-24  6:35         ` Jann Horn
2016-06-23 18:05 ` Stephen Smalley
2016-06-24  8:33   ` Michael Kerrisk (man-pages)

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=878txyuum8.fsf@x220.int.ebiederm.org \
    --to=ebiederm@xmission.com \
    --cc=jann@thejh.net \
    --cc=jmorris@namei.org \
    --cc=keescook@chromium.org \
    --cc=linux-api@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-man@vger.kernel.org \
    --cc=linux-security-module@vger.kernel.org \
    --cc=mtk.manpages@gmail.com \
    --cc=oleg@redhat.com \
    --cc=sds@tycho.nsa.gov \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome