diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2014-10-24 15:33:32 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2014-10-24 15:33:32 -0400 |
commit | 14d4cc08832efb724e58944ba2ac22e2ca3143dc (patch) | |
tree | febca1365a5306d5a44b2481ec41f13f4c2defc2 /include | |
parent | 1c45d9a920e6ef4fce38921e4fc776c2abca3197 (diff) | |
parent | 7185ad2672a7d50bc384de0e38d90b75d99f3d82 (diff) |
Merge tag 'random_for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tytso/random
Pull /dev/random updates from Ted Ts'o:
"This adds a memzero_explicit() call which is guaranteed not to be
optimized away by GCC. This is important when we are wiping
cryptographically sensitive material"
* tag 'random_for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tytso/random:
crypto: memzero_explicit - make sure to clear out sensitive data
random: add and use memzero_explicit() for clearing data
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/string.h | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/include/linux/string.h b/include/linux/string.h index e6edfe51575a..2e22a2e58f3a 100644 --- a/include/linux/string.h +++ b/include/linux/string.h | |||
@@ -132,7 +132,7 @@ int bprintf(u32 *bin_buf, size_t size, const char *fmt, ...) __printf(3, 4); | |||
132 | #endif | 132 | #endif |
133 | 133 | ||
134 | extern ssize_t memory_read_from_buffer(void *to, size_t count, loff_t *ppos, | 134 | extern ssize_t memory_read_from_buffer(void *to, size_t count, loff_t *ppos, |
135 | const void *from, size_t available); | 135 | const void *from, size_t available); |
136 | 136 | ||
137 | /** | 137 | /** |
138 | * strstarts - does @str start with @prefix? | 138 | * strstarts - does @str start with @prefix? |
@@ -144,7 +144,8 @@ static inline bool strstarts(const char *str, const char *prefix) | |||
144 | return strncmp(str, prefix, strlen(prefix)) == 0; | 144 | return strncmp(str, prefix, strlen(prefix)) == 0; |
145 | } | 145 | } |
146 | 146 | ||
147 | extern size_t memweight(const void *ptr, size_t bytes); | 147 | size_t memweight(const void *ptr, size_t bytes); |
148 | void memzero_explicit(void *s, size_t count); | ||
148 | 149 | ||
149 | /** | 150 | /** |
150 | * kbasename - return the last part of a pathname. | 151 | * kbasename - return the last part of a pathname. |