[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Wed, 10 Oct 2012 13:59:43 -0700
From: ebiederm@...ssion.com (Eric W. Biederman)
To: Andrew Morton <akpm@...ux-foundation.org>
Cc: Cyrill Gorcunov <gorcunov@...nvz.org>,
LKML <linux-kernel@...r.kernel.org>,
Pavel Emelyanov <xemul@...allels.com>,
Andrew Vagin <avagin@...nvz.org>,
Oleg Nesterov <oleg@...hat.com>, Greg KH <greg@...ah.com>
Subject: Re: [PATCH] pidns: remove recursion from free_pid_ns() v5
Andrew Morton <akpm@...ux-foundation.org> writes:
> On Thu, 11 Oct 2012 00:42:56 +0400
> Cyrill Gorcunov <gorcunov@...nvz.org> wrote:
>
>> The free_pid_ns function done in recursion fashion:
>>
>> free_pid_ns(parent)
>> put_pid_ns(parent)
>> kref_put(&ns->kref, free_pid_ns);
>> free_pid_ns
>>
>> thus if there was a huge nesting of namespaces the userspace
>> may trigger avalanche calling of free_pid_ns leading to
>> kernel stack exhausting and a panic eventually.
>>
>> This patch turns the recursion into iterative loop.
>>
>> v5 (from oleg@):
>> - Drop @ret variable
>> - Make put_pid_ns non-inline since it grows in size,
>> in turn make free_pid_ns static
>
> OK, let's try that. I'll sit on this until -rc2 to give it a bit of
> time to cook.
>
> A -stable backport might be needed. What capabilities does userspace
> need to be able to trigger the kernel stack overflow?
CAP_SYS_ADMIN is required to create a new pid namespace today.
With a little luck the user namespace bits that allow unprivelged
creation of pid namespaces will be ready for 3.8.
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