From: Peter Zijlstra <peterz@infradead.org>
To: Kyle Moffett <kyle@moffetthome.net>
Cc: Dhaval Giani <dhaval@linux.vnet.ibm.com>,
Corey Hickey <bugfood-ml@fatooh.org>,
linux-kernel@vger.kernel.org,
Bharata B Rao <bharata@linux.vnet.ibm.com>,
Balbir Singh <balbir@in.ibm.com>,
Srivatsa Vaddagiri <vatsa@linux.vnet.ibm.com>,
Ingo Molnar <mingo@elte.hu>,
mtk.manpages@gmail.com
Subject: Re: RT scheduling and a way to make a process hang, unkillable
Date: Mon, 16 Feb 2009 21:28:24 +0100 [thread overview]
Message-ID: <1234816104.30178.362.camel@laptop> (raw)
In-Reply-To: <f73f7ab80902161216j8690f05sf1103759cc932846@mail.gmail.com>
On Mon, 2009-02-16 at 15:16 -0500, Kyle Moffett wrote:
> On Mon, Feb 16, 2009 at 5:36 AM, Dhaval Giani <dhaval@linux.vnet.ibm.com> wrote:
> > On Sun, Feb 15, 2009 at 12:24:56PM +0100, Peter Zijlstra wrote:
> >> On Sat, 2009-02-14 at 16:51 -0800, Corey Hickey wrote:
> >> > The procedure is for a program to:
> >> > 1. run as root
> >> > 2. set SCHED_FIFO
> >> > 3. change UID to a user with no realtime CPU share allocated
> >>
> >> Hmm, setuid() should fail in that situation.
> >>
> >> /me goes peek at code.
> >>
> >> Can't find any code to make that happen, Dhaval didn't we fix that at
> >> one point?
> >
> > So after some searching around, I realized we did not. Does this help?
> > It fixes it on my system,
> >
> > --
> > sched: Don't allow setuid to succeed if the user does not have rt bandwidth
>
> Erm, hrm, this reminds me of the old sendmail capabilities bug. There
> are an awful lot of buggy binaries out there who assume that if they
> have uid 0 and they call setuid() that it cannot fail. They then do
> all sorts of insecure operations, assuming that they have dropped to
> an unprivileged UID. This one is especially bad because it could bite
> *any* program using setuid() which an admin happens to run with chrt.
>
> Specifically, I personally think that:
> * Process is stuck and unkillable
>
> is a much better result than:
> * Process runs arbitrary untrusted code with full-root privs in RT mode.
You have a point, however there are plenty of ways to fail setuid(), one
of them is severe memory pressure, another is exceeding rlimits, also
the security_*() hooks can do pretty much whatever.
So while security is important, its IMHO not a good enough reason to
preserve broken stuff.
[ dhaval, michael, it appears setuid() already returns errors outside
those specified by POSIX, so I'd rather fail with -ENOTIME, or similar,
rather than with -EAGAIN ]
next prev parent reply other threads:[~2009-02-16 20:28 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-02-15 0:51 RT scheduling and a way to make a process hang, unkillable Corey Hickey
2009-02-15 11:24 ` Peter Zijlstra
2009-02-16 10:36 ` Dhaval Giani
2009-02-16 11:08 ` Peter Zijlstra
2009-02-16 12:02 ` Dhaval Giani
2009-02-16 12:24 ` Peter Zijlstra
2009-02-16 13:14 ` Dhaval Giani
2009-02-16 13:19 ` Peter Zijlstra
2009-02-16 14:23 ` Peter Zijlstra
2009-02-16 13:20 ` Dhaval Giani
2009-02-16 19:18 ` Corey Hickey
2009-02-17 5:00 ` Dhaval Giani
2009-02-17 10:15 ` Dhaval Giani
2009-02-17 11:15 ` Peter Zijlstra
2009-02-18 0:09 ` Corey Hickey
2009-02-23 11:45 ` Dhaval Giani
2009-02-23 11:59 ` Peter Zijlstra
2009-02-24 9:18 ` Dhaval Giani
2009-02-24 15:58 ` Andi Kleen
2009-02-24 16:36 ` Peter Zijlstra
2009-02-24 19:29 ` Chris Friesen
2009-02-27 9:43 ` [PATCH] sched: Don't allow setuid to succeed if the user does not have rt bandwidth Dhaval Giani
2009-02-27 10:25 ` Ingo Molnar
2009-02-16 20:16 ` RT scheduling and a way to make a process hang, unkillable Kyle Moffett
2009-02-16 20:28 ` Peter Zijlstra [this message]
2009-02-17 7:22 ` Dhaval Giani
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=1234816104.30178.362.camel@laptop \
--to=peterz@infradead.org \
--cc=balbir@in.ibm.com \
--cc=bharata@linux.vnet.ibm.com \
--cc=bugfood-ml@fatooh.org \
--cc=dhaval@linux.vnet.ibm.com \
--cc=kyle@moffetthome.net \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@elte.hu \
--cc=mtk.manpages@gmail.com \
--cc=vatsa@linux.vnet.ibm.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