mirror of
https://github.com/torvalds/linux.git
synced 2026-10-07 22:37:45 -04:00
tile: use simpler API for random address requests
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]>
This commit is contained in:
1 parent
fa5114c78c
commit
09fddbaf90
1 file changed
+1
-2
+1
-2
@@ -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);
|
||||
}
|
||||
Reference in new issue
Block a user