treewide: use get_random_u32_below() instead of deprecated function
This is a simple mechanical transformation done by: @@ expression E; @@ - prandom_u32_max + get_random_u32_below (E) Reviewed-by: Kees Cook <keescook@chromium.org> Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Acked-by: Darrick J. Wong <djwong@kernel.org> # for xfs Reviewed-by: SeongJae Park <sj@kernel.org> # for damon Reviewed-by: Jason Gunthorpe <jgg@nvidia.com> # for infiniband Reviewed-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk> # for arm Acked-by: Ulf Hansson <ulf.hansson@linaro.org> # for mmc Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
This commit is contained in:
@ -1713,7 +1713,7 @@ static int rt6_insert_exception(struct rt6_info *nrt,
|
||||
net->ipv6.rt6_stats->fib_rt_cache++;
|
||||
|
||||
/* Randomize max depth to avoid some side channels attacks. */
|
||||
max_depth = FIB6_MAX_DEPTH + prandom_u32_max(FIB6_MAX_DEPTH);
|
||||
max_depth = FIB6_MAX_DEPTH + get_random_u32_below(FIB6_MAX_DEPTH);
|
||||
while (bucket->depth > max_depth)
|
||||
rt6_exception_remove_oldest(bucket);
|
||||
|
||||
|
Reference in New Issue
Block a user