[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <m1ipwu5lj2.fsf@fess.ebiederm.org>
Date: Tue, 08 Feb 2011 12:17:05 -0800
From: ebiederm@...ssion.com (Eric W. Biederman)
To: Kees Cook <kees.cook@...onical.com>
Cc: James Morris <jmorris@...ei.org>, linux-kernel@...r.kernel.org,
Al Viro <viro@....linux.org.uk>
Subject: Re: [SECURITY] /proc/$pid/ leaks contents across setuid exec
Kees Cook <kees.cook@...onical.com> writes:
> On Tue, Feb 08, 2011 at 02:43:15PM +1100, James Morris wrote:
>> On Mon, 7 Feb 2011, Kees Cook wrote:
>> > Sure, I know about O_CLOEXEC, but this is about protecting the
>> > just-been-execed setuid process from the attacking process that has no
>> > reason to set O_CLOEXEC.
>> >
>> > Something like this needs to be enforced on the kernel side. I.e. these
>> > file in /proc need to have O_CLOEXEC set in a way that cannot be unset.
>> >
>> > > Changing the behavior in the core kernel will break userspace.
>> >
>> > I don't think /proc/$pid/* needs to stay open across execs, does it? Or at
>> > least the non-0444 files should be handled separately.
>>
>> Actually, this seems like a more general kind of bug in proc rather than a
>> leaked fd. Each child task should only see its own /proc/[pid] data.
>
> Right, that's precisely the problem. The unprivileged process can read
> the setuid process's /proc files.
If these are things that we actually care about we should sprinkle in a
few more ptrace_may_access calls into implementations of the relevant
proc files.
Eric
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists