* Re: [PATCH 2.5.30] Allow tasks to share credentials
[not found] <200208022006.g72K6ctD012092@baldur.austin.ibm.com>
@ 2002-08-02 20:10 ` Linus Torvalds
2002-08-02 20:31 ` Dave McCracken
0 siblings, 1 reply; 4+ messages in thread
From: Linus Torvalds @ 2002-08-02 20:10 UTC (permalink / raw)
To: Dave McCracken; +Cc: Linux Kernel
On Fri, 2 Aug 2002, Dave McCracken wrote:
>
> This patch allows tasks to optionally share credentials, selectable
> via a flag to clone().
This still has the "security hole you can run a slow-moving bight yellow
truck with flashing lights on through" problem..
Linus
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH 2.5.30] Allow tasks to share credentials
2002-08-02 20:10 ` [PATCH 2.5.30] Allow tasks to share credentials Linus Torvalds
@ 2002-08-02 20:31 ` Dave McCracken
0 siblings, 0 replies; 4+ messages in thread
From: Dave McCracken @ 2002-08-02 20:31 UTC (permalink / raw)
To: Linus Torvalds; +Cc: Linux Kernel
--On Friday, August 02, 2002 01:10:48 PM -0700 Linus Torvalds
<torvalds@transmeta.com> wrote:
> This still has the "security hole you can run a slow-moving bight yellow
> truck with flashing lights on through" problem..
My apologies. I've been trying to get a copy of the patch that lkml would
accept, and had not seen your reply when I sent that one out. I'll rework
the patch and resubmit.
Dave McCracken
======================================================================
Dave McCracken IBM Linux Base Kernel Team 1-512-838-3059
dmccr@us.ibm.com T/L 678-3059
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH 2.5.30] Allow tasks to share credentials
2002-08-02 17:22 ` Linus Torvalds
@ 2002-08-02 21:12 ` Dave McCracken
0 siblings, 0 replies; 4+ messages in thread
From: Dave McCracken @ 2002-08-02 21:12 UTC (permalink / raw)
To: Linus Torvalds; +Cc: Linux Kernel, Bill Abt
--On Friday, August 02, 2002 10:22:54 AM -0700 Linus Torvalds
<torvalds@transmeta.com> wrote:
> But I _know_, for example, that this is just a horrid security hole the
> way it is now - the execve() path doesn't create a unique "cred"
> structure, so if you execve() a suid binary from a CLONE_CRED thread, the
> other threads get the suid'ness and can do whatever they want.
You are entirely correct. It was an oversight on my part. execve() should
always unshare the cred structure. I'll work up a fixed version.
Dave McCracken
======================================================================
Dave McCracken IBM Linux Base Kernel Team 1-512-838-3059
dmccr@us.ibm.com T/L 678-3059
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH 2.5.30] Allow tasks to share credentials
[not found] <44230000.1028304881@baldur.austin.ibm.com>
@ 2002-08-02 17:22 ` Linus Torvalds
2002-08-02 21:12 ` Dave McCracken
0 siblings, 1 reply; 4+ messages in thread
From: Linus Torvalds @ 2002-08-02 17:22 UTC (permalink / raw)
To: Dave McCracken; +Cc: Linux Kernel, Bill Abt
On Fri, 2 Aug 2002, Dave McCracken wrote:
>
> This patch provides the ability to share credentials (uid, gid,
> capabilities) between tasks, using a clone() flag.
I worry about the lack of locking here.
Maybe it's the right thing to do, I don't really know.
But I _know_, for example, that this is just a horrid security hole the
way it is now - the execve() path doesn't create a unique "cred"
structure, so if you execve() a suid binary from a CLONE_CRED thread, the
other threads get the suid'ness and can do whatever they want.
At the very least, it should disallow suid exec's when
atomic_read(¤t->cred->count) > 1
which is the same approach we do wrt other shared state (ie disallow a
CLONE_FILES thing from doing a suid execve etc).
The alternative is to just allocate a new cred structure on execve.
As-is this patch is way way too dangerous. You can trivially create a root
hole by doing
if (!clone(CLONE_CRED)) {
execve("su");
exit(1);
}
..this thread now also got root..
> There is no lock around the credential accesses, but from my analysis none
> is needed.
You may be right. I don't see any huge reason for it, but see above on
other fundamental problems.
Linus
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2002-08-02 21:09 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
[not found] <200208022006.g72K6ctD012092@baldur.austin.ibm.com>
2002-08-02 20:10 ` [PATCH 2.5.30] Allow tasks to share credentials Linus Torvalds
2002-08-02 20:31 ` Dave McCracken
[not found] <44230000.1028304881@baldur.austin.ibm.com>
2002-08-02 17:22 ` Linus Torvalds
2002-08-02 21:12 ` Dave McCracken
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®