public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: "Serge E. Hallyn" <serge@hallyn.com>
To: Serge Hallyn <serge@hallyn.com>
Cc: "Kok, Auke-jan H" <auke-jan.h.kok@intel.com>,
	richard -rw- weinberger <richard.weinberger@gmail.com>,
	Serge Hallyn <serge.hallyn@canonical.com>,
	linux-security-module@vger.kernel.org,
	linux-kernel@vger.kernel.org, Eric Paris <eparis@redhat.com>
Subject: Re: [PATCH] Trace event for capable().
Date: Sun, 20 May 2012 13:10:12 +0000	[thread overview]
Message-ID: <20120520131012.GA1100@mail.hallyn.com> (raw)
In-Reply-To: <1337383163.1463.2.camel@Nokia-N900-51-1>

Quoting Serge Hallyn (serge@hallyn.com):
> 
> ----- Original message -----
> > On Fri, May 18, 2012 at 3:33 PM, richard -rw- weinberger
> > <richard.weinberger@gmail.com> wrote:
> > > 
> > > On Thu, May 17, 2012 at 9:50 PM, Auke Kok <auke-jan.h.kok@intel.com>
> > > wrote:
> > > > Add a simple trace event for capable().
> > > > 
> > > > There's been a lot of discussion around capable(), and there
> > > > are plenty of tools to help reduce capabilities' usage from
> > > > userspace. A major gap however is that it's almost impossible
> > > > to see or verify which bits are requested from either userspace
> > > > or in the kernel.
> > > > 
> > > > This patch adds a minimal tracer that will print out which
> > > > CAPs are requested and whether the request was granted.
> > > 
> > > Can we please have support for user namespaces?
> > > At least idicate whether the current namespace is init_user_ns or not.
> > 
> > that was the main reason for sending this out already - that should be
> > trivial to add to the trace event, but I haven't looked at namespaces
> > yet myself. I'll check it out.
> > 
> 
> right, trivial to add, but either go through linux-next or wait for Eric's
> patchset to move from there to Linus' tree.  Print the
> from_kuid(&init_user_ns, current_uid()), and if not in init_user_ns then also
> print the ns creator and task uid in his own ns.
> 
> I don't think you need to do that right now.

Oh, you'll also need to add the uid (in init_user_ns) of the owner of
the target namespace ('ns').  Otherwise, the admin may freak out seeing
uid 500 got cap_sys_admin :)

-serge

  reply	other threads:[~2012-05-20 13:07 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-05-17 19:50 [PATCH] Trace event for capable() Auke Kok
2012-05-18 22:25 ` Serge Hallyn
2012-05-18 23:11   ` Kok, Auke-jan H
2012-05-18 22:33 ` richard -rw- weinberger
2012-05-18 23:09   ` Kok, Auke-jan H
2012-05-18 23:19     ` Serge Hallyn
2012-05-20 13:10       ` Serge E. Hallyn [this message]
2012-05-19  6:59 ` Eric W. Biederman
2012-05-19 18:39   ` Kok, Auke-jan H
2012-05-22  0:03     ` Eric W. Biederman
2012-05-22  2:17       ` Kok, Auke-jan H
2012-05-22 14:50         ` Eric W. Biederman

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=20120520131012.GA1100@mail.hallyn.com \
    --to=serge@hallyn.com \
    --cc=auke-jan.h.kok@intel.com \
    --cc=eparis@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-security-module@vger.kernel.org \
    --cc=richard.weinberger@gmail.com \
    --cc=serge.hallyn@canonical.com \
    /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