[PATCH 4/6] Support clang for explicit_bzero

2020-04-12 Thread roucaries . bastien
From: Bastien Roucariès According to https://bugs.llvm.org/show_bug.cgi?id=15495#c11 llvm need g type constraint Signed-off-by: Bastien Roucariès --- lib/explicit_bzero.c | 6 +- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/explicit_bzero.c b/lib/explicit_bzero.c index

[PATCH 3/6] Use SecureZeroMemory on windows for explicit_bzero

2020-04-12 Thread roucaries . bastien
From: Bastien Roucariès Signed-off-by: Bastien Roucariès --- lib/explicit_bzero.c | 9 - 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/lib/explicit_bzero.c b/lib/explicit_bzero.c index 2168a5285..489732791 100644 --- a/lib/explicit_bzero.c +++ b/lib/explicit_bzero.c @@

[PATCH 6/6] Improve styling in explicit_bzero

2020-04-12 Thread roucaries . bastien
From: Bastien Roucariès Use '\0' instead of 0 Signed-off-by: Bastien Roucariès --- lib/explicit_bzero.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/explicit_bzero.c b/lib/explicit_bzero.c index 03968acbf..072c59498 100644 --- a/lib/explicit_bzero.c +++

[PATCH 2/6] Use memset_s if possible for explicit_bzero

2020-04-12 Thread roucaries . bastien
From: Bastien Roucariès Some OS define memset_s instead of explicit_bzero. Use it. Signed-off-by: Bastien Roucariès --- lib/explicit_bzero.c | 7 +++ m4/explicit_bzero.m4 | 1 + 2 files changed, 8 insertions(+) diff --git a/lib/explicit_bzero.c b/lib/explicit_bzero.c index

[PATCH 1/6] Fix test in case of canaries on heap buffer after free

2020-04-12 Thread roucaries . bastien
From: Bastien Roucariès Some implementation could add canaries after free failling the test Signed-off-by: Bastien Roucariès --- tests/test-explicit_bzero.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tests/test-explicit_bzero.c b/tests/test-explicit_bzero.c index

[PATCH 5/6] Implement fallback for explicit_bzero using jump to volatile pointer

2020-04-12 Thread roucaries . bastien
From: Bastien Roucariès Signed-off-by: Bastien Roucariès --- lib/explicit_bzero.c | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/explicit_bzero.c b/lib/explicit_bzero.c index bb52d11de..03968acbf 100644 --- a/lib/explicit_bzero.c +++ b/lib/explicit_bzero.c @@

[V3][0/6] explicit_bzero

2020-04-12 Thread roucaries . bastien
The test should be fixed in case on hardened compiler (canaries). Tested under linux with gcc and clang, and mingw (under wine) [PATCH 1/6] Fix test in case of canaries on heap buffer after free [PATCH 2/6] Use memset_s if possible for explicit_bzero [PATCH 3/6] Use SecureZeroMemory on windows

Re: [PATCH 6/6] Add test for explicit_bzero

2020-04-12 Thread Bruno Haible
Hi Bastien, > But I will prefer that you push first the test (I have not written > myself and it need comments that are outside my english language > skills). > > So could you push a test ? I'm pushing the test as shown below. It confirms my suspicion that with just a plain memset instead of

Re: [PATCH 6/6] Add test for explicit_bzero

2020-04-12 Thread Bastien ROUCARIES
Yes, it does. But I will prefer that you push first the test (I have not written myself and it need comments that are outside my english language skills). So could you push a test ? I will redo my serie above your test On Sun, Apr 12, 2020 at 1:22 PM Bruno Haible wrote: > > Hi Bastien, > > >

Re: [V2][PATH 0/6] Explicit_bzero improvement

2020-04-12 Thread Bastien ROUCARIES
Thank you for the clarification. I will do it. On Sun, Apr 12, 2020 at 1:33 PM Bruno Haible wrote: > > Hi Bastien, > > > [PATCH 1/6] Use memset_s if possible for explicit_bzero > > [PATCH 2/6] Use SecureZeroMemory on windows for explicit_bzero > > [PATCH 3/6] Support clang for explicit_bzero >

Re: [V2][PATH 0/6] Explicit_bzero improvement

2020-04-12 Thread Bruno Haible
Hi Bastien, > [PATCH 1/6] Use memset_s if possible for explicit_bzero > [PATCH 2/6] Use SecureZeroMemory on windows for explicit_bzero > [PATCH 3/6] Support clang for explicit_bzero > [PATCH 4/6] Implement fallback for explicit_bzero using jump to > [PATCH 5/6] Improve styling in explicit_bzero >

Re: [PATCH 6/6] Add test for explicit_bzero

2020-04-12 Thread Bruno Haible
Hi Bastien, > Simple test A module description file modules/explicit_bzero-tests is needed as well. Then you can test the changed implementation through 1. ./gnulib-tool --create-testdir --dir=/tmp/testdir --single-configure explicit_bzero 2. transport the test dir to a different machine, 3.