Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1450344

[RFC patch 5/6] tile: Use simpler API for random address requests

From Jason Cooper <jason@lakedaemon.net>
Newsgroups linux.kernel
Subject [RFC patch 5/6] tile: Use simpler API for random address requests
Date 2016-07-26 05:10 +0200
Message-ID <rZ0UN-53b-21@gated-at.bofh.it> (permalink)
References <rYSNA-7Vk-7@gated-at.bofh.it> <rZ0UN-53b-7@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


Currently, all callers to randomize_range() set the length to 0 and
calculate end by adding a constant to the start address.  We can
simplify the API to remove a bunch of needless checks and variables.

Use the new randomize_addr(start, range) call to set the requested
address.

Signed-off-by: Jason Cooper <jason@lakedaemon.net>
---
 arch/tile/mm/mmap.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/arch/tile/mm/mmap.c b/arch/tile/mm/mmap.c
index 851a94e6ae58..50f6a693a2b6 100644
--- a/arch/tile/mm/mmap.c
+++ b/arch/tile/mm/mmap.c
@@ -88,6 +88,5 @@ void arch_pick_mmap_layout(struct mm_struct *mm)
 
 unsigned long arch_randomize_brk(struct mm_struct *mm)
 {
-	unsigned long range_end = mm->brk + 0x02000000;
-	return randomize_range(mm->brk, range_end, 0) ? : mm->brk;
+	return randomize_addr(mm->brk, 0x02000000);
 }
-- 
2.9.2

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH] randomize_range: use random long instead of int william.c.roberts@intel.com - 2016-07-25 20:30 +0200
  Re: [PATCH] randomize_range: use random long instead of int Kees Cook <keescook@chromium.org> - 2016-07-25 21:00 +0200
  Re: [PATCH] randomize_range: use random long instead of int Jason Cooper <jason@lakedaemon.net> - 2016-07-26 04:20 +0200
  [RFC patch 6/6] unicore32: Use simpler API for random address requests Jason Cooper <jason@lakedaemon.net> - 2016-07-26 05:10 +0200
  [RFC patch 4/6] arm64: Use simpler API for random address requests Jason Cooper <jason@lakedaemon.net> - 2016-07-26 05:10 +0200
  [RFC patch 3/6] ARM: Use simpler API for random address requests Jason Cooper <jason@lakedaemon.net> - 2016-07-26 05:10 +0200
  [RFC patch 2/6] x86: Use simpler API for random address requests Jason Cooper <jason@lakedaemon.net> - 2016-07-26 05:10 +0200
  [RFC patch 5/6] tile: Use simpler API for random address requests Jason Cooper <jason@lakedaemon.net> - 2016-07-26 05:10 +0200
  [RFC patch 1/6] random: Simplify API for random address requests Jason Cooper <jason@lakedaemon.net> - 2016-07-26 05:10 +0200
    Re: [RFC patch 1/6] random: Simplify API for random address requests Jason Cooper <jason@lakedaemon.net> - 2016-07-26 05:40 +0200
      Re: [RFC patch 1/6] random: Simplify API for random address requests Kees Cook <keescook@chromium.org> - 2016-07-26 06:50 +0200
        Re: [RFC patch 1/6] random: Simplify API for random address requests Jason Cooper <jason@lakedaemon.net> - 2016-07-26 19:10 +0200
          Re: [RFC patch 1/6] random: Simplify API for random address requests Kees Cook <keescook@chromium.org> - 2016-07-26 19:10 +0200
            Re: [RFC patch 1/6] random: Simplify API for random address requests Jason Cooper <jason@lakedaemon.net> - 2016-07-28 21:10 +0200
      RE: [RFC patch 1/6] random: Simplify API for random address requests "Roberts, William C" <william.c.roberts@intel.com> - 2016-07-26 19:40 +0200
    Re: [RFC patch 1/6] random: Simplify API for random address requests Kees Cook <keescook@chromium.org> - 2016-07-26 06:50 +0200
      Re: [RFC patch 1/6] random: Simplify API for random address requests Jason Cooper <jason@lakedaemon.net> - 2016-07-26 18:00 +0200
        Re: [RFC patch 1/6] random: Simplify API for random address requests Kees Cook <keescook@chromium.org> - 2016-07-26 18:50 +0200
    Re: [kernel-hardening] [RFC patch 1/6] random: Simplify API for  random address requests Yann Droneaud <ydroneaud@opteya.com> - 2016-07-27 16:30 +0200

csiph-web