From: Valdis.Kletnieks@vt.edu
To: Geoffrey McRae <geoff@rabidhost.com>
Cc: Alan Cox <alan@lxorguk.ukuu.org.uk>, linux-kernel@vger.kernel.org
Subject: Re: New Security Features, Please Comment
Date: Tue, 02 Dec 2008 21:55:32 -0500 [thread overview]
Message-ID: <73639.1228272932@turing-police.cc.vt.edu> (raw)
In-Reply-To: Your message of "Wed, 03 Dec 2008 12:44:17 +1100." <1228268657.6679.4.camel@lappy.spacevs.com>
[-- Attachment #1: Type: text/plain, Size: 1751 bytes --]
On Wed, 03 Dec 2008 12:44:17 +1100, Geoffrey McRae said:
> I would welcome more information as to how this can break applications
> as I am very new to kernel hacking and would like to solve this
> performance vs security problem once and for all.
A *lot* of software has implicit assumptions - for instance, that your process
UID remains constant unless you intentionally did a setuid() call.
Read Henry Spencer's (now ancient but still educational) write-up on *some* of
the things that can happen to set-UID programs:
http://www.daemon-systems.org/man/setuid.7.html
Now consider that *any* program that gets its UID suddenly changed on it
just became vulnerable to all that stuff that Henry writes about.
News flash - most programmers who wrote code thinking it would run as the
same userid the whole time don't do checks for all the sort of stuff that
Henry warns about when programs suddenly get invoked with more privilege
than they were designed to handle.
Then there's the opposite case - somebody manages to trick you into nuking the
permissions on the right process-ID but wrong executable. Hilarity ensues when
the process is running with *less* privilege than it expected. Go and read up
on how Sendmail failed back around 2000, and understand *why* it failed. Just
google for 'sendmail CAP_SETUID' and start reading. Then think what happens if
somebody manages to get PHP to exec() some other binary (a set-UID one) and
it's busy running when you whack its UID.
That's just off the top of my head.
Then go look at kernel/sys.c and read the comments just before the functions
sys_setpgid(), sys_setregid(), and sys_setuid(), and figure out how the
saved uid enters into things....
There be serious and nasty dragons in there...
[-- Attachment #2: Type: application/pgp-signature, Size: 226 bytes --]
next prev parent reply other threads:[~2008-12-03 2:55 UTC|newest]
Thread overview: 27+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-12-02 23:28 Geoffrey McRae
2008-12-03 0:24 ` Geoffrey McRae
2008-12-03 0:53 ` Alan Cox
2008-12-03 1:44 ` Geoffrey McRae
2008-12-03 2:11 ` David Newall
2008-12-03 2:55 ` Valdis.Kletnieks [this message]
2008-12-03 4:02 ` Geoffrey McRae
2008-12-03 4:35 ` Peter Teoh
2008-12-03 5:02 ` Geoffrey McRae
2008-12-03 6:54 ` David Newall
2008-12-03 10:29 ` Alan Cox
2008-12-03 12:42 ` Nick Andrew
2008-12-03 12:46 ` Alan Cox
2008-12-03 22:44 ` Geoffrey McRae
2008-12-03 23:08 ` Alan Cox
2008-12-03 23:27 ` Peter Teoh
2008-12-03 23:40 ` Geoffrey McRae
2008-12-04 21:56 ` Valdis.Kletnieks
2008-12-04 22:30 ` Geoffrey McRae
2008-12-05 3:35 ` Valdis.Kletnieks
2008-12-05 3:44 ` Nick Andrew
2008-12-05 3:50 ` Geoffrey McRae
2008-12-05 4:03 ` Valdis.Kletnieks
2008-12-03 23:39 ` Miquel van Smoorenburg
2008-12-04 0:00 ` Geoffrey McRae
2008-12-04 0:22 ` Peter Teoh
2008-12-04 0:08 ` Alan Cox
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=73639.1228272932@turing-police.cc.vt.edu \
--to=valdis.kletnieks@vt.edu \
--cc=alan@lxorguk.ukuu.org.uk \
--cc=geoff@rabidhost.com \
--cc=linux-kernel@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®