Files
erofs-linux/kernel
Vladimir Davydov 4f7d461433 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]>
2014-08-08 15:57:23 -07:00
..
2014-06-12 16:18:45 +02:00
2014-08-08 15:57:17 -07:00
2014-06-10 15:34:46 -07:00
…
…
2014-08-08 15:57:18 -07:00
…
…
2014-07-05 11:17:45 +02:00
…
…
…
…
…
…
…
…
…
…
2014-07-17 22:07:37 +02:00
…
…
…
2014-07-09 09:14:33 -07:00
…
…
2014-07-18 12:13:37 -07:00
…
…
2014-08-08 15:57:22 -07:00
…