* NEWS: Document this.
* bootstrap.conf (gnulib_modules): Add explicit_bzero.
* gl/lib/randint.c (randint_free):
* gl/lib/randread.c (randread_free):
* src/blake2/blake2-impl.h (secure_zero_memory):
* src/shred.c (dopass, do_wipefd):
Prefer explicit_bzero to memset when erasing secrets.
Now, it prints a diagnostic or a line to stdout for each argument.
[bug introduced in the bourne-shell-to-C rewrite for coreutils-6.11]
+ shred now erases buffers containing secrets via the explicit_bzero
+ function, which should be more reliable.
+ [potential bug has always been present in 'shred']
+
split no longer exits when invocations of a --filter return EPIPE.
[bug introduced in coreutils-8.26]
euidaccess
exclude
exitfail
+ explicit_bzero
faccessat
fadvise
fchdir
void
randint_free (struct randint_source *s)
{
- memset (s, 0, sizeof *s);
+ explicit_bzero (s, sizeof *s);
free (s);
}
randread_free (struct randread_source *s)
{
FILE *source = s->source;
- memset (s, 0, sizeof *s);
+ explicit_bzero (s, sizeof *s);
free (s);
return (source ? fclose (source) : 0);
}
/* prevents compiler optimizing out memset() */
static BLAKE2_INLINE void secure_zero_memory(void *v, size_t n)
{
- static void *(*const volatile memset_v)(void *, int, size_t) = &memset;
- memset_v(v, 0, n);
+ explicit_bzero (v, n);
}
#endif
}
free_pattern_mem:
- memset (pbuf, 0, FILLPATTERN_SIZE);
+ explicit_bzero (pbuf, FILLPATTERN_SIZE);
free (fill_pattern_mem);
return other_error ? -1 : write_error;
}
wipefd_out:
- memset (passarray, 0, flags->n_iterations * sizeof (int));
+ explicit_bzero (passarray, flags->n_iterations * sizeof (int));
free (passarray);
return ok;
}