public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Herbert Poetzl <herbert@13thfloor.at>
To: "Serge E. Hallyn" <serue@us.ibm.com>
Cc: Stephen Smalley <sds@tycho.nsa.gov>,
	Oleg Nesterov <oleg@tv-sign.ru>, Pavel Machek <pavel@ucw.cz>,
	Andrew Morton <akpm@linux-foundation.org>,
	"Eric W. Biederman" <ebiederm@xmission.com>,
	Pavel Emelyanov <xemul@openvz.org>,
	Roland McGrath <roland@redhat.com>,
	linux-kernel@vger.kernel.org, Chris Wright <chrisw@sous-sol.org>,
	Andrew Morgan <morgan@kernel.org>,
	Linux Containers <containers@lists.osdl.org>
Subject: Re: [PATCH] ptrace: it is fun to strace /sbin/init
Date: Tue, 25 Mar 2008 20:07:43 +0100	[thread overview]
Message-ID: <20080325190743.GA2379@MAIL.13thfloor.at> (raw)
In-Reply-To: <20080325180611.GB19176@sergelap.ibm.com>

On Tue, Mar 25, 2008 at 01:06:11PM -0500, Serge E. Hallyn wrote:
> Quoting Stephen Smalley (sds@tycho.nsa.gov):
> > 
> > On Tue, 2008-03-25 at 08:40 -0500, Serge E. Hallyn wrote:
> > > Quoting Stephen Smalley (sds@tycho.nsa.gov):
> > > > 
> > > > On Tue, 2008-03-25 at 02:04 +0300, Oleg Nesterov wrote:
> > > > > On 03/24, Pavel Machek wrote:
> > > > > >
> > > > > > > /sbin/init is important, but there are other important (and sometimes
> > > > > > > much more important) services. Why it is so special so that we can't
> > > > > > > debug/strace it?
> > > > > > 
> > > > > > Maybe. Let's kill /sbin/init protection in 2.6.26. But making it
> > > > > > optional is wrong.
> > > > > 
> > > > > You are right, the boot parameter is silly. How about sysctl?
> > > > > 
> > > > > Stephen, do you see any security problems if we make /sbin/init
> > > > > ptraceable by default?
> > > > 
> > > > Not an issue for SELinux (we apply an orthogonal check based on security
> > > > context, so we can already block ptrace of init independent of whether
> > > > root/CAP_SYS_PTRACE can do it).  I'm not sure though as to whether
> > > > people using capabilities have ever relied on this special protection of
> > > > init (e.g. custom init spawns children with lesser capabilities and
> > > > relies on the fact that they cannot ptrace init to effectively re-gain
> > > > those capabilities, even if they possess CAP_SYS_PTRACE).
> > > 
> > > Still thinking it through, but it seems like special casing init isn't
> > > useful.  There are likely to be other tasks with all capabilities
> > > set which the malicious task could just as well ptrace to do his
> > > mischief, right?
> > 
> > Depends on the bounding set.  Didn't it used to be the case that only
> > init had CAP_SETPCAP (until the meaning of it was changed by the
> > filesystem capability support)?
> 
> Not quite.  CAP_SETPCAP was taken out of everyone's bounding set.  But
> kernel/sysctl.c allowed only init to add capabilities to the bounding
> set.  (Whereas CAP_SYS_MODULE was sufficient to remove them).
> 
> > Might want to double check with e.g. the vservers folks that they
> > weren't relying in any way on special handling of init.
> 
> Herbert, Pavel, do you have objections to allowing ptrace of init?
> (I believe Eric has already Acked the idea iirc?)

inside a guest, by default no (i.e. there simply is
no capability for that), on the host the behaviour is
unmodified .. note that there are guests without init
where the blend through init is protected in a special
way

HTH,
Herbert

> thanks,
> -serge

  reply	other threads:[~2008-03-25 19:32 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-03-23 13:51 [PATCH] ptrace: it is fun to strace /sbin/init Oleg Nesterov
2008-03-24 16:01 ` Pavel Machek
2008-03-24 16:40   ` Oleg Nesterov
2008-03-24 22:39     ` Pavel Machek
2008-03-24 23:04       ` Oleg Nesterov
2008-03-24 23:09         ` Pavel Machek
2008-03-24 23:18           ` Oleg Nesterov
2008-03-24 23:26             ` Andrew Morton
2008-03-24 23:38               ` Oleg Nesterov
2008-03-25 12:03         ` Stephen Smalley
2008-03-25 13:40           ` Serge E. Hallyn
2008-03-25 14:37             ` Stephen Smalley
2008-03-25 18:06               ` Serge E. Hallyn
2008-03-25 19:07                 ` Herbert Poetzl [this message]
2008-03-25 21:55                 ` Pavel Machek
2008-03-26 15:31                   ` Andrew Morgan
2008-03-26 15:47                 ` Pavel Emelyanov
2008-03-24 22:29 ` Andrew Morton
2008-03-24 22:56   ` Oleg Nesterov
2008-03-24 23:08     ` Andrew Morton
2008-03-24 23:29       ` Oleg Nesterov
2008-03-25 10:00       ` Andi Kleen
2008-03-25 14:16         ` Krzysztof Halasa
2008-03-25 14:22           ` Andi Kleen
2008-03-25 14:30             ` Krzysztof Halasa
2008-03-25 14:35               ` Andi Kleen
2008-03-25 14:58                 ` Krzysztof Halasa
2008-03-25 14:47             ` Pavel Machek
2008-03-25 14:56               ` Andi Kleen
2008-03-25 17:42         ` Oleg Nesterov
2008-03-25 22:00         ` Roland McGrath

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=20080325190743.GA2379@MAIL.13thfloor.at \
    --to=herbert@13thfloor.at \
    --cc=akpm@linux-foundation.org \
    --cc=chrisw@sous-sol.org \
    --cc=containers@lists.osdl.org \
    --cc=ebiederm@xmission.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=morgan@kernel.org \
    --cc=oleg@tv-sign.ru \
    --cc=pavel@ucw.cz \
    --cc=roland@redhat.com \
    --cc=sds@tycho.nsa.gov \
    --cc=serue@us.ibm.com \
    --cc=xemul@openvz.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox