Andrey Vagin 24f91eba18 mm: don't lose the SOFT_DIRTY flag on mprotect
The SOFT_DIRTY bit shows that the content of memory was changed after a
defined point in the past.  mprotect() doesn't change the content of
memory, so it must not change the SOFT_DIRTY bit.

This bug causes a malfunction: on the first iteration all pages are
dumped.  On other iterations only pages with the SOFT_DIRTY bit are
dumped.  So if the SOFT_DIRTY bit is cleared from a page by mistake, the
page is not dumped and its content will be restored incorrectly.

This patch does nothing with _PAGE_SWP_SOFT_DIRTY, becase pte_modify()
is called only for present pages.

Fixes commit 0f8975ec4db2 ("mm: soft-dirty bits for user memory changes
tracking").

Signed-off-by: Andrey Vagin <avagin@openvz.org>
Acked-by: Cyrill Gorcunov <gorcunov@openvz.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: "H. Peter Anvin" <hpa@zytor.com>
Cc: Pavel Emelyanov <xemul@parallels.com>
Cc: Borislav Petkov <bp@suse.de>
Cc: Wen Congyang <wency@cn.fujitsu.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2014-01-30 16:56:56 -08:00
..
2013-11-11 19:53:42 +01:00
2013-04-25 10:39:04 +02:00
2014-01-03 14:38:18 +00:00
2014-01-23 16:36:54 -08:00
2013-08-05 06:35:33 -07:00
2013-02-03 18:16:27 -05:00
2012-06-25 13:48:30 +02:00
2014-01-17 10:22:10 +01:00
2013-04-22 15:45:03 +09:30
2013-08-09 07:54:00 -07:00
2014-01-10 14:23:15 -07:00
2013-10-09 20:04:08 -05:00
2013-02-03 18:16:27 -05:00
2013-09-09 12:05:37 -04:00
2013-11-06 20:00:05 +01:00