All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Serge E. Hallyn" <serge@hallyn.com>
To: Kees Cook <kees.cook@canonical.com>
Cc: James Morris <jmorris@namei.org>,
	Christoph Hellwig <hch@infradead.org>,
	linux-security-module@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH 0/2] Yama: add PTRACE exception tracking
Date: Thu, 1 Jul 2010 08:20:39 -0500	[thread overview]
Message-ID: <20100701132038.GA24394@hallyn.com> (raw)
In-Reply-To: <20100701044401.GY4837@outflux.net>

Quoting Kees Cook (kees.cook@canonical.com):
> > This is getting more complicated, with fine-grained security policy now 
> > being introduced, also with the need to modify applications.
> 
> Well, I'm trying to solve what I think is a core problem with PTRACE -- it
> is too permissive.  I'm happy to look at it from other angles if it doesn't
> make sense for this kind of thing to live in Yama.  I'm already very happy
> with the existing restrictions available in Yama.

I've been jumping from one conviction to another to yet another and back
again on this.

First off, if you consider PTRACE_PTRACEME, and just consider this a more
finegrained targeted version of that, it doesn't seem all that gross.  So
maybe that's my fault for suggesting prctl as an easier-to-use in LSMs
api, bc using a PTRACE_PTRACEDBY might just look cleaner.

Still, you say 'ptrace is too permissive', but a rebuttal to that is that,
in a DAC system, ptrace uses what credentials it knows of to authorize.
*You* can make it more finegrained by not insisting on running everything
as a single user.

What you now are trying to do is find a new, natural relationship between
tasks on a plain DAC system to provide finer-grained control.  The one you
picked - process ancestry - doesn't perfectly fit, so you add changes and
make it less clean.  The criticism of that is valid and needs to be
discusssed.

Adding new relationships between tasks is what LSMs do - based on the
policy-defined relationships between the security tasks of the respective
domains.  And it feeld natural there - so it's natural for SELinux and
apparmor to confine firefox to a domain that can't ptrace anything else
(and maybe not itself).

One q then is whether YAMA wants to provide task tracking of its own, or
stack with apparmor.

> > There are several existing LSMs with the ability to control ptrace, but as 
> > part of a system-wide, coherent, analyzable policy -- often in support of 
> > specific security models for which there is concrete user demand and 
> > benefit.
> 
> Sure.  I am curious, though, is there a way for SELinux (or maybe Smack,
> since it has more dynamic labels) to declare this kind of on-runtime PTRACE
> relationship?  Maybe I overlooked some options for this.  I didn't see any

In SELinux, you could give a debugger or crash handler an unprivileged, but
allowed-to-ptrace-the-main-app domain.

> I still think simple chaining is the way to go.  I want to review the
> earlier discussions first (I think Serge said it was in 2004ish?) before I
> write up anything.  There is, I think, one sticking point, which is
> /proc/self/attr/current, but beyond that, I think some simple
> reorganization of LSM initialization routines and a list that security_*
> walks would be sufficient.

In the past, output results for each LSM were simply split by \n or a :
or something, and input was prepended by the LSM name.

-serge

  reply	other threads:[~2010-07-01 13:19 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-06-30  0:38 [PATCH 0/2] Yama: add PTRACE exception tracking Kees Cook
2010-06-30  0:39 ` [PATCH 1/2] security: create task_free security callback Kees Cook
2010-06-30  0:40 ` [PATCH 2/2] Yama: add PTRACE exception tracking Kees Cook
2010-06-30  1:09   ` Tetsuo Handa
2010-06-30  3:51     ` Kees Cook
2010-06-30  3:56   ` Serge E. Hallyn
2010-06-30  5:27     ` Kees Cook
2010-06-30 12:40       ` Serge E. Hallyn
2010-06-30 15:41   ` Eric Paris
2010-06-30 15:53     ` Kees Cook
2010-06-30 21:39       ` Tetsuo Handa
2010-06-30  7:31 ` [PATCH 0/2] " Christoph Hellwig
2010-06-30 15:45   ` Kees Cook
2010-07-01  1:39   ` James Morris
2010-07-01  4:44     ` Kees Cook
2010-07-01 13:20       ` Serge E. Hallyn [this message]
2010-07-01 15:22         ` Stephen Smalley
2010-07-01 17:16         ` Kees Cook
2010-07-01 19:41           ` Serge E. Hallyn
2010-07-01 19:57             ` Stephen Smalley

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=20100701132038.GA24394@hallyn.com \
    --to=serge@hallyn.com \
    --cc=hch@infradead.org \
    --cc=jmorris@namei.org \
    --cc=kees.cook@canonical.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-security-module@vger.kernel.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.