arch/arm/kernel/process.c: Use get_random_max32() for sigpage_addr()
RFC PATCH 48/50 arch/arm/kernel/process.c: Use get_random_max32() for sigpage_addr()
Which is faster and less biased than get_random_int() % range
Signed-off-by George Spelvin <[email protected]>
Cc Nathan Lynch <[email protected]>
Cc Dmitry Safonov <[email protected]>
Cc Russell King <[email protected]>
--- arch/arm/kernel/process.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm/kernel/process.c +1 -1
@@ -391,7 +391,7 @@ static unsigned long sigpage_addr(const struct mm_struct *mm, slots = ((last - first) >>PAGE_SHIFT ) +1 ; - offset =get_random_int () % slots; + offset =get_random_max32 (slots); addr = first + (offset <<PAGE_SHIFT );
Signature · 1 line
2.26.0