]> git.baikalelectronics.ru Git - kernel.git/commit
mm: no get_user/put_user while holding mmap_sem in do_pages_stat?
authorBrice Goglin <Brice.Goglin@inria.fr>
Tue, 9 Dec 2008 21:14:23 +0000 (13:14 -0800)
committerLinus Torvalds <torvalds@linux-foundation.org>
Wed, 10 Dec 2008 16:01:53 +0000 (08:01 -0800)
commite2f0b5fb0ef31fdd535b92e1f6038755888102e4
tree1a97a6f5070818ffcb3573c1968471110bed3a42
parent4125217492ad3237465d08a5f641c1c8f32e355d
mm: no get_user/put_user while holding mmap_sem in do_pages_stat?

Since commit 4e7e9568bffebc10dcfb9140150e39a75aba1bfe, do_pages_stat()
gets the page address from user-space and puts the corresponding status
back while holding the mmap_sem for read.  There is no need to hold
mmap_sem there while some page-faults may occur.

This patch adds a temporary address and status buffer so as to only
hold mmap_sem while working on these kernel buffers.  This is
implemented by extracting do_pages_stat_array() out of do_pages_stat().

Signed-off-by: Brice Goglin <Brice.Goglin@inria.fr>
Cc: Christoph Lameter <clameter@sgi.com>
Cc: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
Cc: Nick Piggin <npiggin@suse.de>
Cc: Hugh Dickins <hugh@veritas.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
mm/migrate.c