diff options
Diffstat (limited to 'lib/string.c')
| -rw-r--r-- | lib/string.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/lib/string.c b/lib/string.c index 2fc20aa06f84..10063300b830 100644 --- a/lib/string.c +++ b/lib/string.c | |||
| @@ -598,6 +598,22 @@ void *memset(void *s, int c, size_t count) | |||
| 598 | EXPORT_SYMBOL(memset); | 598 | EXPORT_SYMBOL(memset); |
| 599 | #endif | 599 | #endif |
| 600 | 600 | ||
| 601 | /** | ||
| 602 | * memzero_explicit - Fill a region of memory (e.g. sensitive | ||
| 603 | * keying data) with 0s. | ||
| 604 | * @s: Pointer to the start of the area. | ||
| 605 | * @count: The size of the area. | ||
| 606 | * | ||
| 607 | * memzero_explicit() doesn't need an arch-specific version as | ||
| 608 | * it just invokes the one of memset() implicitly. | ||
| 609 | */ | ||
| 610 | void memzero_explicit(void *s, size_t count) | ||
| 611 | { | ||
| 612 | memset(s, 0, count); | ||
| 613 | OPTIMIZER_HIDE_VAR(s); | ||
| 614 | } | ||
| 615 | EXPORT_SYMBOL(memzero_explicit); | ||
| 616 | |||
| 601 | #ifndef __HAVE_ARCH_MEMCPY | 617 | #ifndef __HAVE_ARCH_MEMCPY |
| 602 | /** | 618 | /** |
| 603 | * memcpy - Copy one area of memory to another | 619 | * memcpy - Copy one area of memory to another |
