https://github.com/torvalds/linux
Revision 096b7fe012d66ed55e98bc8022405ede0cc80e96 authored by Li Zefan on 29 July 2009, 22:04:04 UTC, committed by Linus Torvalds on 30 July 2009, 02:10:35 UTC
The bug was introduced by commit cc31edceee04a7b87f2be48f9489ebb72d264844
("cgroups: convert tasks file to use a seq_file with shared pid array").

We cache a pid array for all threads that are opening the same "tasks"
file, but the pids in the array are always from the namespace of the
last process that opened the file, so all other threads will read pids
from that namespace instead of their own namespaces.

To fix it, we maintain a list of pid arrays, which is keyed by pid_ns.
The list will be of length 1 at most time.

Reported-by: Paul Menage <menage@google.com>
Idea-by: Paul Menage <menage@google.com>
Signed-off-by: Li Zefan <lizf@cn.fujitsu.com>
Reviewed-by: Serge Hallyn <serue@us.ibm.com>
Cc: Balbir Singh <balbir@in.ibm.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
1 parent b317c83
History
Tip revision: 096b7fe012d66ed55e98bc8022405ede0cc80e96 authored by Li Zefan on 29 July 2009, 22:04:04 UTC
cgroups: fix pid namespace bug
Tip revision: 096b7fe
File Mode Size
.gitignore -rw-r--r-- 102 bytes
Kconfig -rw-r--r-- 4.4 KB
Makefile -rw-r--r-- 2.1 KB
gen_init_cpio.c -rw-r--r-- 12.2 KB
initramfs_data.S -rw-r--r-- 1021 bytes
initramfs_data.bz2.S -rw-r--r-- 1.0 KB
initramfs_data.gz.S -rw-r--r-- 1023 bytes
initramfs_data.lzma.S -rw-r--r-- 1.0 KB

back to top