diff options
| author | Vladimir Davydov <[email protected]> | 2014-08-08 14:22:01 -0700 |
|---|---|---|
| committer | Linus Torvalds <[email protected]> | 2014-08-08 15:57:23 -0700 |
| commit | 4f7d461433bb4a4deee61baefdac6cd1a1ecb546 (patch) | |
| tree | fe3609c5e750d4a06876f61ab217503e56b4e182 /kernel/taskstats.c | |
| parent | ce65cefa5debefc0e81d0a533bda467f0aa67350 (diff) | |
fork: copy mm's vm usage counters under mmap_sem
If a forking process has a thread calling (un)mmap (silly but still),
the child process may have some of its mm's vm usage counters (total_vm
and friends) screwed up, because currently they are copied from oldmm
w/o holding any locks (memcpy in dup_mm).
This patch moves the counters initialization to dup_mmap() to be called
under oldmm->mmap_sem, which eliminates any possibility of race.
Signed-off-by: Vladimir Davydov <[email protected]>
Cc: Oleg Nesterov <[email protected]>
Cc: David Rientjes <[email protected]>
Cc: Christoph Lameter <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
Diffstat (limited to 'kernel/taskstats.c')
0 files changed, 0 insertions, 0 deletions