+ x86-mm-support-arch_mmap_rnd_bits-v7.patch added to -mm tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The patch titled
     Subject: x86-mm-support-arch_mmap_rnd_bits-v7.txt
has been added to the -mm tree.  Its filename is
     x86-mm-support-arch_mmap_rnd_bits-v7.patch

This patch should soon appear at
    http://ozlabs.org/~akpm/mmots/broken-out/x86-mm-support-arch_mmap_rnd_bits-v7.patch
and later at
    http://ozlabs.org/~akpm/mmotm/broken-out/x86-mm-support-arch_mmap_rnd_bits-v7.patch

Before you just go and hit "reply", please:
   a) Consider who else should be cc'ed
   b) Prefer to cc a suitable mailing list as well
   c) Ideally: find the original patch on the mailing list and do a
      reply-to-all to that, adding suitable additional cc's

*** Remember to use Documentation/SubmitChecklist when testing your code ***

The -mm tree is included into linux-next and is updated
there every 3-4 working days

------------------------------------------------------
From: Daniel Cashman <dcashman@xxxxxxxxxx>
Subject: x86-mm-support-arch_mmap_rnd_bits-v7.txt

x86: mm: support ARCH_MMAP_RND_BITS.

Signed-off-by: Daniel Cashman <dcashman@xxxxxxxxxxx>
Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx>
---

 arch/x86/Kconfig   |    4 ++--
 arch/x86/mm/mmap.c |    6 +++---
 2 files changed, 5 insertions(+), 5 deletions(-)

diff -puN arch/x86/Kconfig~x86-mm-support-arch_mmap_rnd_bits-v7 arch/x86/Kconfig
--- a/arch/x86/Kconfig~x86-mm-support-arch_mmap_rnd_bits-v7
+++ a/arch/x86/Kconfig
@@ -186,8 +186,8 @@ config MMU
 	def_bool y
 
 config ARCH_MMAP_RND_BITS_MIN
-       default 28 if 64BIT
-       default 8
+	default 28 if 64BIT
+	default 8
 
 config ARCH_MMAP_RND_BITS_MAX
 	default 32 if 64BIT
diff -puN arch/x86/mm/mmap.c~x86-mm-support-arch_mmap_rnd_bits-v7 arch/x86/mm/mmap.c
--- a/arch/x86/mm/mmap.c~x86-mm-support-arch_mmap_rnd_bits-v7
+++ a/arch/x86/mm/mmap.c
@@ -71,12 +71,12 @@ unsigned long arch_mmap_rnd(void)
 
 	if (mmap_is_ia32())
 #ifdef CONFIG_COMPAT
-		rnd = (unsigned long)get_random_int() % (1 << mmap_rnd_compat_bits);
+		rnd = (unsigned long)get_random_int() & ((1 << mmap_rnd_compat_bits) - 1);
 #else
-		rnd = (unsigned long)get_random_int() % (1 << mmap_rnd_bits);
+		rnd = (unsigned long)get_random_int() & ((1 << mmap_rnd_bits) - 1);
 #endif
 	else
-		rnd = (unsigned long)get_random_int() % (1 << mmap_rnd_bits);
+		rnd = (unsigned long)get_random_int() & ((1 << mmap_rnd_bits) - 1);
 
 	return rnd << PAGE_SHIFT;
 }
_

Patches currently in -mm which might be from dcashman@xxxxxxxxxx are

mm-mmap-add-new-proc-tunable-for-mmap_base-aslr.patch
arm-mm-support-arch_mmap_rnd_bits.patch
arm-mm-support-arch_mmap_rnd_bits-v7.patch
arm64-mm-support-arch_mmap_rnd_bits.patch
arm64-mm-support-arch_mmap_rnd_bits-v6.patch
arm64-mm-support-arch_mmap_rnd_bits-v7.patch
x86-mm-support-arch_mmap_rnd_bits.patch
x86-mm-support-arch_mmap_rnd_bits-v7.patch

--
To unsubscribe from this list: send the line "unsubscribe mm-commits" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Kernel Newbies FAQ]     [Kernel Archive]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [Bugtraq]     [Photo]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]

  Powered by Linux