Skip to content

Commit

Permalink
tile: use simpler API for random address requests
Browse files Browse the repository at this point in the history
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.

Link: http://lkml.kernel.org/r/[email protected]
Signed-off-by: Jason Cooper <[email protected]>
Acked-by: Kees Cook <[email protected]>
Cc: "Theodore Ts'o" <[email protected]>
Cc: Chris Metcalf <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
Jason Cooper authored and torvalds committed Oct 11, 2016
1 parent fa5114c commit 09fddba
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions arch/tile/mm/mmap.c
Original file line number Diff line number Diff line change
Expand Up @@ -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_page(mm->brk, 0x02000000);
}

0 comments on commit 09fddba

Please sign in to comment.