diff options
| author | Andrew Vagin <[email protected]> | 2012-09-17 21:09:12 +0000 |
|---|---|---|
| committer | Linus Torvalds <[email protected]> | 2012-09-17 22:00:38 +0000 |
| commit | 579035dc5ddd6d48fd8529e7358b03d911ab9d8a (patch) | |
| tree | bd54e0a33715547454b241124258c0c3c0d2be5e /lib/mpi/mpi-internal.h | |
| parent | include/net/sock.h: squelch compiler warning in sk_rmem_schedule() (diff) | |
| download | kernel-579035dc5ddd6d48fd8529e7358b03d911ab9d8a.tar.gz kernel-579035dc5ddd6d48fd8529e7358b03d911ab9d8a.zip | |
pid-namespace: limit value of ns_last_pid to (0, max_pid)
The kernel doesn't check the pid for negative values, so if you try to
write -2 to /proc/sys/kernel/ns_last_pid, you will get a kernel panic.
The crash happens because the next pid is -1, and alloc_pidmap() will
try to access to a nonexistent pidmap.
map = &pid_ns->pidmap[pid/BITS_PER_PAGE];
Signed-off-by: Andrew Vagin <[email protected]>
Acked-by: Cyrill Gorcunov <[email protected]>
Acked-by: Oleg Nesterov <[email protected]>
Cc: Eric W. Biederman <[email protected]>
Cc: Pavel Emelyanov <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
Diffstat (limited to 'lib/mpi/mpi-internal.h')
0 files changed, 0 insertions, 0 deletions
