lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Date:	Fri, 21 Aug 2009 19:30:15 +0100 (BST)
From:	Hugh Dickins <hugh.dickins@...cali.co.uk>
To:	Andrew Morton <akpm@...ux-foundation.com>
cc:	Andi Kleen <andi@...stfloor.org>,
	Wu Fengguang <fengguang.wu@...el.com>,
	Izik Eidus <ieidus@...hat.com>,
	Chris Wright <chrisw@...hat.com>,
	Andrea Arcangeli <aarcange@...hat.com>,
	Michael Kerrisk <mtk.manpages@...il.com>,
	Richard Henderson <rth@...ddle.net>,
	Ivan Kokshaysky <ink@...assic.park.msu.ru>,
	Ralf Baechle <ralf@...ux-mips.org>,
	Kyle McMartin <kyle@...artin.ca>, Helge Deller <deller@....de>,
	Chris Zankel <chris@...kel.net>,
	Rik van RIel <riel@...hat.com>,
	Balbir Singh <balbir@...ibm.com>,
	KAMEZAWA Hiroyuki <kamezawa.hiroyu@...fujitsu.com>,
	Avi Kivity <avi@...hat.com>,
	Nick Piggin <nickpiggin@...oo.com.au>,
	linux-kernel@...r.kernel.org, linux-mm@...ck.org
Subject: [PATCH mmotm] ksm: antidote to MADV_MERGEABLE HWPOISON

linux-next is now sporting MADV_HWPOISON at 12, which would have a very
nasty effect on KSM if you had CONFIG_MEMORY_FAILURE=y with CONFIG_KSM=y.
Shift MADV_MERGEABLE and MADV_UNMERGEABLE down two - two to reduce the
confusion if old and new userspace and kernel are mismatched.

Personally I'd prefer the MADV_HWPOISON testing feature to shift; but
linux-next comes first in the mmotm lineup, and I can't be sure that
madvise KSM already has more users than there are HWPOISON testers:
so unless Andi is happy to shift MADV_HWPOISON, mmotm needs this.
---
Fix to ksm-define-madv_mergeable-and-madv_unmergeable.patch
parisc unaffected because its MADVs are displaced.

 arch/alpha/include/asm/mman.h     |    4 ++--
 arch/mips/include/asm/mman.h      |    4 ++--
 arch/xtensa/include/asm/mman.h    |    4 ++--
 include/asm-generic/mman-common.h |    4 ++--
 4 files changed, 8 insertions(+), 8 deletions(-)

--- mmotm/arch/alpha/include/asm/mman.h	2009-08-21 12:08:18.000000000 +0100
+++ linux/arch/alpha/include/asm/mman.h	2009-08-21 18:28:14.000000000 +0100
@@ -48,8 +48,8 @@
 #define MADV_DONTFORK	10		/* don't inherit across fork */
 #define MADV_DOFORK	11		/* do inherit across fork */
 
-#define MADV_MERGEABLE   12		/* KSM may merge identical pages */
-#define MADV_UNMERGEABLE 13		/* KSM may not merge identical pages */
+#define MADV_MERGEABLE   14		/* KSM may merge identical pages */
+#define MADV_UNMERGEABLE 15		/* KSM may not merge identical pages */
 
 /* compatibility flags */
 #define MAP_FILE	0
--- mmotm/arch/mips/include/asm/mman.h	2009-08-21 12:08:18.000000000 +0100
+++ linux/arch/mips/include/asm/mman.h	2009-08-21 18:28:24.000000000 +0100
@@ -71,8 +71,8 @@
 #define MADV_DONTFORK	10		/* don't inherit across fork */
 #define MADV_DOFORK	11		/* do inherit across fork */
 
-#define MADV_MERGEABLE   12		/* KSM may merge identical pages */
-#define MADV_UNMERGEABLE 13		/* KSM may not merge identical pages */
+#define MADV_MERGEABLE   14		/* KSM may merge identical pages */
+#define MADV_UNMERGEABLE 15		/* KSM may not merge identical pages */
 
 /* compatibility flags */
 #define MAP_FILE	0
--- mmotm/arch/xtensa/include/asm/mman.h	2009-08-21 12:08:18.000000000 +0100
+++ linux/arch/xtensa/include/asm/mman.h	2009-08-21 18:28:52.000000000 +0100
@@ -78,8 +78,8 @@
 #define MADV_DONTFORK	10		/* don't inherit across fork */
 #define MADV_DOFORK	11		/* do inherit across fork */
 
-#define MADV_MERGEABLE   12		/* KSM may merge identical pages */
-#define MADV_UNMERGEABLE 13		/* KSM may not merge identical pages */
+#define MADV_MERGEABLE   14		/* KSM may merge identical pages */
+#define MADV_UNMERGEABLE 15		/* KSM may not merge identical pages */
 
 /* compatibility flags */
 #define MAP_FILE	0
--- mmotm/include/asm-generic/mman-common.h	2009-08-21 12:08:18.000000000 +0100
+++ linux/include/asm-generic/mman-common.h	2009-08-21 18:29:01.000000000 +0100
@@ -36,8 +36,8 @@
 #define MADV_DOFORK	11		/* do inherit across fork */
 #define MADV_HWPOISON	12		/* poison a page for testing */
 
-#define MADV_MERGEABLE   12		/* KSM may merge identical pages */
-#define MADV_UNMERGEABLE 13		/* KSM may not merge identical pages */
+#define MADV_MERGEABLE   14		/* KSM may merge identical pages */
+#define MADV_UNMERGEABLE 15		/* KSM may not merge identical pages */
 
 /* compatibility flags */
 #define MAP_FILE	0
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ