[V2][PATH 0/6] Explicit_bzero improvement

2020-04-11 Thread roucaries . bastien
This is the version 2 of explicit bzero [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

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

2020-04-11 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 3/6] Support clang for explicit_bzero

2020-04-11 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 2/5] Use SecureZeroMemory on windows for explicit_bzero

2020-04-11 Thread roucaries . bastien
From: Bastien Roucariès Signed-off-by: Bastien Roucariès --- lib/explicit_bzero.c | 7 +++ m4/explicit_bzero.m4 | 5 + 2 files changed, 12 insertions(+) diff --git a/lib/explicit_bzero.c b/lib/explicit_bzero.c index 862855421..b355f9bdf 100644 --- a/lib/explicit_bzero.c +++

[patch] Improve explicit_bzero

2020-04-11 Thread roucaries . bastien
Hi, I realease under LGPL2+ improvment of explicit_bzero module. Could you review please [PATCH 1/5] Use memset_s if possible for explicit_bzero [PATCH 2/5] Use SecureZeroMemory on windows for explicit_bzero [PATCH 3/5] Support clang for explicit_bzero [PATCH 4/5] Use volatile trick for

[PATCH 1/5] Use memset_s if possible for explicit_bzero

2020-04-11 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 | 5 + 2 files changed, 12 insertions(+) diff --git a/lib/explicit_bzero.c b/lib/explicit_bzero.c index

[PATCH 3/5] Support clang for explicit_bzero

2020-04-11 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 | 14 ++ 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/lib/explicit_bzero.c

[PATCH 4/5] Use volatile trick for explicit_bzero

2020-04-11 Thread roucaries . bastien
From: Bastien Roucariès Use a volatile pointer to memset function to avoid dead end optimization Signed-off-by: Bastien Roucariès --- lib/explicit_bzero.c | 14 +- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/lib/explicit_bzero.c b/lib/explicit_bzero.c index

[PATCH 5/5] Fix styling in explicit bzero

2020-04-11 Thread roucaries . bastien
From: Bastien Roucariès 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 59215852c..21f42292d 100644 --- a/lib/explicit_bzero.c +++ b/lib/explicit_bzero.c @@ -53,7

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

2020-04-11 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 5/6] Improve styling in explicit_bzero

2020-04-11 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 09907..7eff7f2a7 100644 --- a/lib/explicit_bzero.c +++

[PATCH 6/6] Add test for explicit_bzero

2020-04-11 Thread roucaries . bastien
From: Bastien Roucariès Simple test Signed-off-by: Bastien Roucariès --- tests/test-explicit_bzero.c | 34 ++ 1 file changed, 34 insertions(+) create mode 100644 tests/test-explicit_bzero.c diff --git a/tests/test-explicit_bzero.c

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

2020-04-11 Thread roucaries . bastien
From: Bastien Roucariès Add some resistance against compiler optimization by doing pointer arithmetic with parameter of the function, therefore avoid dead branch optimization Signed-off-by: Bastien Roucariès --- lib/explicit_bzero.c | 56 ++-- 1 file

[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 @@

[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 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 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

[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

[PATCH 1/2] Support clang for explicit_bzero

2021-01-23 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 | 14 -- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/lib/explicit_bzero.c

[V4][0/2] explicit_bzero

2021-01-23 Thread roucaries . bastien
Sorry for the late reply Last modification of explicit_bzero

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

2021-01-23 Thread roucaries . bastien
From: Bastien Roucariès Signed-off-by: Bastien Roucariès --- lib/explicit_bzero.c | 8 +--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/lib/explicit_bzero.c b/lib/explicit_bzero.c index 71a1cca3b0..86a5fd35d7 100644 --- a/lib/explicit_bzero.c +++ b/lib/explicit_bzero.c @@

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

2021-01-23 Thread roucaries . bastien
From: Bastien Roucariès Signed-off-by: Bastien Roucariès --- lib/explicit_bzero.c | 8 +--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/lib/explicit_bzero.c b/lib/explicit_bzero.c index 71a1cca3b0..c39f20164b 100644 --- a/lib/explicit_bzero.c +++ b/lib/explicit_bzero.c @@

[V5] explicit_bzero

2021-01-23 Thread roucaries . bastien
sorry for that [PATCH 1/2] Support clang for explicit_bzero [PATCH 2/2] Implement fallback for explicit_bzero using jump to

[PATCH 1/2] Support clang for explicit_bzero

2021-01-23 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 | 14 -- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/lib/explicit_bzero.c