]> git.ipfire.org Git - thirdparty/coreutils.git/commitdiff
shred: remove redundant zeroing of freed memory
authorPádraig Brady <P@draigBrady.com>
Sun, 23 Jul 2017 08:06:33 +0000 (01:06 -0700)
committerPádraig Brady <P@draigBrady.com>
Sun, 23 Jul 2017 19:26:22 +0000 (12:26 -0700)
* src/shred.c (dopass): shred used to read the input file,
and so needed to ensure internal memory was cleared.
This is no longer the case since SH-UTILS-1_16f-260-gf381610
so avoid this redundant clearing.
(do_wipefd): Likewise.
* NEWS: Remove the recent mention of this issue.

NEWS
src/shred.c

diff --git a/NEWS b/NEWS
index dfd2837a070e732401ba266819b5e01f32344a28..110229bd8e020e30ff7f290422efaa3883401ee4 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -25,10 +25,6 @@ GNU coreutils NEWS                                    -*- outline -*-
   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]
 
index c95546cb7adec8e5f3971aee9507e766ef3e9a22..e6df4095adf4fd920796e1fb73286fbd7d7843bb 100644 (file)
@@ -653,7 +653,6 @@ dopass (int fd, struct stat const *st, char const *qname, off_t *sizep,
     }
 
 free_pattern_mem:
-  explicit_bzero (pbuf, FILLPATTERN_SIZE);
   free (fill_pattern_mem);
 
   return other_error ? -1 : write_error;
@@ -987,7 +986,6 @@ do_wipefd (int fd, char const *qname, struct randint_source *s,
     }
 
 wipefd_out:
-  explicit_bzero (passarray, flags->n_iterations * sizeof (int));
   free (passarray);
   return ok;
 }