diff options
author | Huacai Chen <chenhc@lemote.com> | 2013-03-17 11:50:14 +0000 |
---|---|---|
committer | Ralf Baechle <ralf@linux-mips.org> | 2013-05-08 01:19:06 +0200 |
commit | 224786779d04bbcd5f61eaafc86bf8fee350388a (patch) | |
tree | 3db7c2ce9fdda70337de38ab344177b199153efb /arch/mips/lib | |
parent | 8759934e2b6bdb3a08a81fc14a6588f3321719b1 (diff) | |
download | blackbird-op-linux-224786779d04bbcd5f61eaafc86bf8fee350388a.tar.gz blackbird-op-linux-224786779d04bbcd5f61eaafc86bf8fee350388a.zip |
MIPS: Init new mmu_context for each possible CPU to avoid memory corruption
Currently, init_new_context() only for each online CPU, this may cause
memory corruption when CPU hotplug and fork() happens at the same time.
To avoid this, we make init_new_context() cover each possible CPU.
Scenario:
1, CPU#1 is being offline;
2, On CPU#0, do_fork() call dup_mm() and copy a mm_struct to the child;
3, On CPU#0, dup_mm() call init_new_context(), since CPU#1 is offline
and init_new_context() only covers the online CPUs, child has the
same asid as its parent on CPU#1 (however, child's asid should be 0);
4, CPU#1 is being online;
5, Now, if both parent and child run on CPU#1, memory corruption (e.g.
segfault, bus error, etc.) will occur.
Signed-off-by: Huacai Chen <chenhc@lemote.com>
Acked-by: David Daney <david.daney@cavium.com>
Patchwork: http://patchwork.linux-mips.org/patch/4995/
Acked-by: John Crispin <blogic@openwrt.org>
Diffstat (limited to 'arch/mips/lib')
0 files changed, 0 insertions, 0 deletions