diff mbox

Move fortified explicit_bzero back to string3

Message ID 1483708082-24175-1-git-send-email-adhemerval.zanella@linaro.org
State Accepted
Commit 75dafa2f323555600a1d1675de6eea09d25e3482
Headers show

Commit Message

Adhemerval Zanella Jan. 6, 2017, 1:08 p.m. UTC
Commit 38765ab68f329fd moved the bzero, bcopy, and explicit_bzero
fortified macros to a common header (strings_fortified.h).  However
the side effect is a fortified explicit_bzero is defined when including
only strings.h.

This patch moves back the fortified explicit_bzero definition to
strings3.h header.

Checked on x86_64-linux-gnu.
---
 ChangeLog                       | 5 +++++
 string/bits/string3.h           | 9 +++++++++
 string/bits/strings_fortified.h | 9 ---------
 3 files changed, 14 insertions(+), 9 deletions(-)

-- 
2.7.4

Comments

Adhemerval Zanella Jan. 9, 2017, 12:57 p.m. UTC | #1
I intend to push it today if no one opposes it (it is a fix for
38765ab68f329fd noted by Florian).

On 06/01/2017 11:08, Adhemerval Zanella wrote:
> Commit 38765ab68f329fd moved the bzero, bcopy, and explicit_bzero

> fortified macros to a common header (strings_fortified.h).  However

> the side effect is a fortified explicit_bzero is defined when including

> only strings.h.

> 

> This patch moves back the fortified explicit_bzero definition to

> strings3.h header.

> 

> Checked on x86_64-linux-gnu.

> ---

>  ChangeLog                       | 5 +++++

>  string/bits/string3.h           | 9 +++++++++

>  string/bits/strings_fortified.h | 9 ---------

>  3 files changed, 14 insertions(+), 9 deletions(-)

> 

> diff --git a/string/bits/string3.h b/string/bits/string3.h

> index 0b0a377..738226d 100644

> --- a/string/bits/string3.h

> +++ b/string/bits/string3.h

> @@ -92,6 +92,15 @@ __NTH (memset (void *__dest, int __ch, size_t __len))

>  

>  #ifdef __USE_MISC

>  # include <bits/strings_fortified.h>

> +

> +void __explicit_bzero_chk (void *__dest, size_t __len, size_t __destlen)

> +  __THROW __nonnull ((1));

> +

> +__fortify_function void

> +__NTH (explicit_bzero (void *__dest, size_t __len))

> +{

> +  __explicit_bzero_chk (__dest, __len, __bos0 (__dest));

> +}

>  #endif

>  

>  __fortify_function char *

> diff --git a/string/bits/strings_fortified.h b/string/bits/strings_fortified.h

> index fd396f9..411e786 100644

> --- a/string/bits/strings_fortified.h

> +++ b/string/bits/strings_fortified.h

> @@ -31,13 +31,4 @@ __NTH (bzero (void *__dest, size_t __len))

>    (void) __builtin___memset_chk (__dest, '\0', __len, __bos0 (__dest));

>  }

>  

> -void __explicit_bzero_chk (void *__dest, size_t __len, size_t __destlen)

> -  __THROW __nonnull ((1));

> -

> -__fortify_function void

> -__NTH (explicit_bzero (void *__dest, size_t __len))

> -{

> -  __explicit_bzero_chk (__dest, __len, __bos0 (__dest));

> -}

> -

>  #endif

>
diff mbox

Patch

diff --git a/string/bits/string3.h b/string/bits/string3.h
index 0b0a377..738226d 100644
--- a/string/bits/string3.h
+++ b/string/bits/string3.h
@@ -92,6 +92,15 @@  __NTH (memset (void *__dest, int __ch, size_t __len))
 
 #ifdef __USE_MISC
 # include <bits/strings_fortified.h>
+
+void __explicit_bzero_chk (void *__dest, size_t __len, size_t __destlen)
+  __THROW __nonnull ((1));
+
+__fortify_function void
+__NTH (explicit_bzero (void *__dest, size_t __len))
+{
+  __explicit_bzero_chk (__dest, __len, __bos0 (__dest));
+}
 #endif
 
 __fortify_function char *
diff --git a/string/bits/strings_fortified.h b/string/bits/strings_fortified.h
index fd396f9..411e786 100644
--- a/string/bits/strings_fortified.h
+++ b/string/bits/strings_fortified.h
@@ -31,13 +31,4 @@  __NTH (bzero (void *__dest, size_t __len))
   (void) __builtin___memset_chk (__dest, '\0', __len, __bos0 (__dest));
 }
 
-void __explicit_bzero_chk (void *__dest, size_t __len, size_t __destlen)
-  __THROW __nonnull ((1));
-
-__fortify_function void
-__NTH (explicit_bzero (void *__dest, size_t __len))
-{
-  __explicit_bzero_chk (__dest, __len, __bos0 (__dest));
-}
-
 #endif