[CRIU] Re: [PATCH] kernel: limit a value of ns_last_pid to (0,
max_pid)
Cyrill Gorcunov
gorcunov at openvz.org
Mon Sep 3 11:28:52 EDT 2012
On Mon, Sep 03, 2012 at 07:15:23PM +0400, Andrew Vagin wrote:
> The kernel doesn't check pid on a negative values, so if
> you would try to write -2 in /proc/sys/kernel/ns_last_pid,
> you will get a kernel panic.
>
> In this case the next pid is -1, and alloc_pidmap will try to access
> to a nonexistent pidmap.
>
> map = &pid_ns->pidmap[pid/BITS_PER_PAGE];
Looks reasonable to me, thanks Andrew. Would you send it upstream?
Cyrill
More information about the CRIU
mailing list