Message ID | 157045977450.9978.18318761982949903126.tip-bot2@tip-bot2 (mailing list archive) |
---|---|
State | Not Applicable |
Delegated to: | Herbert Xu |
Headers | show |
Series | [tip:,x86/urgent] x86/boot: Provide memzero_explicit() | expand |
diff --git a/arch/x86/boot/compressed/string.c b/arch/x86/boot/compressed/string.c index 81fc1ea..dd30e63 100644 --- a/arch/x86/boot/compressed/string.c +++ b/arch/x86/boot/compressed/string.c @@ -50,6 +50,16 @@ void *memset(void *s, int c, size_t n) return s; } +void memzero_explicit(void *s, size_t count) +{ + memset(s, 0, count); + /* + * Make sure this function never gets inlined and + * the memset() never gets optimized away: + */ + barrier_data(s); +} + void *memmove(void *dest, const void *src, size_t n) { unsigned char *d = dest;