]> git.proxmox.com Git - mirror_ubuntu-artful-kernel.git/commit
ksm: fix unlocked iteration over vmas in cmp_and_merge_page()
authorKirill Tkhai <ktkhai@virtuozzo.com>
Tue, 3 Oct 2017 23:14:27 +0000 (16:14 -0700)
committerSeth Forshee <seth.forshee@canonical.com>
Thu, 19 Oct 2017 14:48:55 +0000 (09:48 -0500)
commitc6d268523611fe59dc96c0c2be901be28c94ac72
tree763385096d342ec0a8b8063735045c1900f935c9
parent7687aedf86b44564a0cf707a5cfb90fcc9c67d78
ksm: fix unlocked iteration over vmas in cmp_and_merge_page()

BugLink: http://bugs.launchpad.net/bugs/1723145
commit 4b22927f0cbd58303aac689e378d20bf56267a39 upstream.

In this place mm is unlocked, so vmas or list may change.  Down read
mmap_sem to protect them from modifications.

Link: http://lkml.kernel.org/r/150512788393.10691.8868381099691121308.stgit@localhost.localdomain
Fixes: e86c59b1b12d ("mm/ksm: improve deduplication of zero pages with colouring")
Signed-off-by: Kirill Tkhai <ktkhai@virtuozzo.com>
Acked-by: Michal Hocko <mhocko@suse.com>
Reviewed-by: Andrea Arcangeli <aarcange@redhat.com>
Cc: Minchan Kim <minchan@kernel.org>
Cc: zhong jiang <zhongjiang@huawei.com>
Cc: Ingo Molnar <mingo@kernel.org>
Cc: Claudio Imbrenda <imbrenda@linux.vnet.ibm.com>
Cc: "Kirill A. Shutemov" <kirill.shutemov@linux.intel.com>
Cc: Hugh Dickins <hughd@google.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
mm/ksm.c