Re: [PATCH] pidns: remove recursion from free_pid_ns

From: Cyrill Gorcunov
Date: Fri Oct 05 2012 - 02:42:55 EST


On Fri, Oct 05, 2012 at 01:21:02AM +0400, Andrew Vagin wrote:
> Here is a stack trace of recursion:
> free_pid_ns(parent)
> put_pid_ns(parent)
> kref_put(&ns->kref, free_pid_ns);
> free_pid_ns
>
> This patch turns recursion into loops.
>
> pidns can be nested many times, so in case of recursion
> a simple user space program can provoke a kernel panic
> due to exceed of a kernel stack.

Acked-by: Cyrill Gorcunov <gorcunov@xxxxxxxxxx>

Looks good to me. Thanks Andrew!
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/