Files
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 <vdavydov@parallels.com>
Cc: Oleg Nesterov <oleg@redhat.com>
Cc: David Rientjes <rientjes@google.com>
Cc: Christoph Lameter <cl@linux.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
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
2013-09-11 15:58:27 -07:00
2014-08-08 15:57:22 -07:00