diff options
author | Jason Cooper <jason@lakedaemon.net> | 2016-10-11 13:54:11 -0700 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2016-10-11 15:06:32 -0700 |
commit | 7425154d3bbf5fcc7554738cab6dfac559ffbdda (patch) | |
tree | 5860053d69fbdf15eee6de00859bcff22e6e76bf /drivers/char/random.c | |
parent | 05c2679e9562f7e9ca11dacc91cf21b6c42d532d (diff) | |
download | op-kernel-dev-7425154d3bbf5fcc7554738cab6dfac559ffbdda.zip op-kernel-dev-7425154d3bbf5fcc7554738cab6dfac559ffbdda.tar.gz |
random: remove unused randomize_range()
All call sites for randomize_range have been updated to use the much
simpler and more robust randomize_addr(). Remove the now unnecessary
code.
Link: http://lkml.kernel.org/r/20160803233913.32511-8-jason@lakedaemon.net
Signed-off-by: Jason Cooper <jason@lakedaemon.net>
Acked-by: Kees Cook <keescook@chromium.org>
Cc: "Theodore Ts'o" <tytso@mit.edu>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/char/random.c')
-rw-r--r-- | drivers/char/random.c | 19 |
1 files changed, 0 insertions, 19 deletions
diff --git a/drivers/char/random.c b/drivers/char/random.c index 40eb07e..d131e15 100644 --- a/drivers/char/random.c +++ b/drivers/char/random.c @@ -2100,25 +2100,6 @@ unsigned long get_random_long(void) } EXPORT_SYMBOL(get_random_long); -/* - * randomize_range() returns a start address such that - * - * [...... <range> .....] - * start end - * - * a <range> with size "len" starting at the return value is inside in the - * area defined by [start, end], but is otherwise randomized. - */ -unsigned long -randomize_range(unsigned long start, unsigned long end, unsigned long len) -{ - unsigned long range = end - len - start; - - if (end <= start + len) - return 0; - return PAGE_ALIGN(get_random_int() % range + start); -} - /** * randomize_page - Generate a random, page aligned address * @start: The smallest acceptable address the caller will take. |