Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1456064
| From | Jason Cooper <jason@lakedaemon.net> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | [PATCH v3 7/7] random: Remove unused randomize_range() |
| Date | 2016-08-04 01:50 +0200 |
| Message-ID | <s2e5b-U8-11@gated-at.bofh.it> (permalink) |
| References | <s012p-3rN-3@gated-at.bofh.it> <s2e5b-U8-3@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
All call sites for randomize_range have been updated to use the much
simpler and more robust randomize_addr. Remove the now unnecessary
code.
Signed-off-by: Jason Cooper <jason@lakedaemon.net>
---
drivers/char/random.c | 19 -------------------
include/linux/random.h | 1 -
2 files changed, 20 deletions(-)
diff --git a/drivers/char/random.c b/drivers/char/random.c
index 61cb434e3bea..46d332dd27a4 100644
--- a/drivers/char/random.c
+++ b/drivers/char/random.c
@@ -1821,25 +1821,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.
diff --git a/include/linux/random.h b/include/linux/random.h
index 098fec690d65..9281dbbb7f4a 100644
--- a/include/linux/random.h
+++ b/include/linux/random.h
@@ -34,7 +34,6 @@ extern const struct file_operations random_fops, urandom_fops;
unsigned int get_random_int(void);
unsigned long get_random_long(void);
-unsigned long randomize_range(unsigned long start, unsigned long end, unsigned long len);
unsigned long randomize_page(unsigned long start, unsigned long range);
u32 prandom_u32(void);
--
2.9.2
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
[PATCH 0/7] char/random: Simplify random address requests Jason Cooper <jason@lakedaemon.net> - 2016-07-28 23:30 +0200
[PATCH 1/7] random: Simplify API for random address requests Jason Cooper <jason@lakedaemon.net> - 2016-07-28 23:30 +0200
Re: [PATCH 1/7] random: Simplify API for random address requests Yann Droneaud <ydroneaud@opteya.com> - 2016-07-29 11:00 +0200
Re: [PATCH 1/7] random: Simplify API for random address requests Jason Cooper <jason@lakedaemon.net> - 2016-07-29 20:30 +0200
[PATCH 5/7] tile: Use simpler API for random address requests Jason Cooper <jason@lakedaemon.net> - 2016-07-28 23:30 +0200
[PATCH 7/7] random: Remove unused randomize_range() Jason Cooper <jason@lakedaemon.net> - 2016-07-28 23:30 +0200
[PATCH 6/7] unicore32: Use simpler API for random address requests Jason Cooper <jason@lakedaemon.net> - 2016-07-28 23:30 +0200
[PATCH 4/7] arm64: Use simpler API for random address requests Jason Cooper <jason@lakedaemon.net> - 2016-07-28 23:30 +0200
Re: [PATCH 4/7] arm64: Use simpler API for random address requests Will Deacon <will.deacon@arm.com> - 2016-07-29 15:50 +0200
[PATCH 3/7] ARM: Use simpler API for random address requests Jason Cooper <jason@lakedaemon.net> - 2016-07-28 23:30 +0200
[PATCH v2 7/7] random: Remove unused randomize_range() Jason Cooper <jason@lakedaemon.net> - 2016-07-30 17:50 +0200
[PATCH v2 4/7] arm64: Use simpler API for random address requests Jason Cooper <jason@lakedaemon.net> - 2016-07-30 17:50 +0200
[PATCH v2 2/7] x86: Use simpler API for random address requests Jason Cooper <jason@lakedaemon.net> - 2016-07-30 17:50 +0200
[PATCH v2 5/7] tile: Use simpler API for random address requests Jason Cooper <jason@lakedaemon.net> - 2016-07-30 17:50 +0200
[PATCH v2 3/7] ARM: Use simpler API for random address requests Jason Cooper <jason@lakedaemon.net> - 2016-07-30 17:50 +0200
[PATCH v2 1/7] random: Simplify API for random address requests Jason Cooper <jason@lakedaemon.net> - 2016-07-30 17:50 +0200
Re: [PATCH v2 1/7] random: Simplify API for random address requests Kees Cook <keescook@chromium.org> - 2016-07-31 18:50 +0200
Re: [PATCH v2 1/7] random: Simplify API for random address requests Jason Cooper <jason@lakedaemon.net> - 2016-07-31 23:00 +0200
Re: [PATCH v2 1/7] random: Simplify API for random address requests Kees Cook <keescook@chromium.org> - 2016-08-01 21:50 +0200
Re: [PATCH v2 1/7] random: Simplify API for random address requests Jason Cooper <jason@lakedaemon.net> - 2016-08-02 01:20 +0200
Re: [kernel-hardening] Re: [PATCH v2 1/7] random: Simplify API for random address requests Michael Ellerman <mpe@ellerman.id.au> - 2016-08-02 05:40 +0200
Re: [kernel-hardening] Re: [PATCH v2 1/7] random: Simplify API for random address requests Jason Cooper <jason@lakedaemon.net> - 2016-08-03 20:50 +0200
[PATCH v2 0/7] char/random: Simplify random address requests Jason Cooper <jason@lakedaemon.net> - 2016-07-30 17:50 +0200
[PATCH v2 6/7] unicore32: Use simpler API for random address requests Jason Cooper <jason@lakedaemon.net> - 2016-07-30 17:50 +0200
[PATCH v3 2/7] x86: Use simpler API for random address requests Jason Cooper <jason@lakedaemon.net> - 2016-08-04 01:50 +0200
[PATCH v3 6/7] unicore32: Use simpler API for random address requests Jason Cooper <jason@lakedaemon.net> - 2016-08-04 01:50 +0200
[PATCH v3 5/7] tile: Use simpler API for random address requests Jason Cooper <jason@lakedaemon.net> - 2016-08-04 01:50 +0200
[PATCH v3 7/7] random: Remove unused randomize_range() Jason Cooper <jason@lakedaemon.net> - 2016-08-04 01:50 +0200
Re: [PATCH v3 7/7] random: Remove unused randomize_range() Andrew Morton <akpm@linux-foundation.org> - 2016-08-04 01:50 +0200
Re: [PATCH v3 7/7] random: Remove unused randomize_range() Jason Cooper <jason@lakedaemon.net> - 2016-08-04 02:20 +0200
[PATCH v3 0/7] char/random: Simplify random address requests Jason Cooper <jason@lakedaemon.net> - 2016-08-04 01:50 +0200
[PATCH v3 4/7] arm64: Use simpler API for random address requests Jason Cooper <jason@lakedaemon.net> - 2016-08-04 01:50 +0200
[PATCH v3 1/7] random: Simplify API for random address requests Jason Cooper <jason@lakedaemon.net> - 2016-08-04 01:50 +0200
Re: [PATCH v3 1/7] random: Simplify API for random address requests Yann Droneaud <ydroneaud@opteya.com> - 2016-08-04 14:50 +0200
[PATCH v3 3/7] ARM: Use simpler API for random address requests Jason Cooper <jason@lakedaemon.net> - 2016-08-04 01:50 +0200
Re: [PATCH v3 0/7] char/random: Simplify random address requests Kees Cook <keescook@chromium.org> - 2016-08-04 04:50 +0200
csiph-web