* [PATCH] key: Fix Valgrind warnings
@ 2016-10-12 20:51 Mat Martineau
2016-10-13 1:18 ` Denis Kenzior
0 siblings, 1 reply; 2+ messages in thread
From: Mat Martineau @ 2016-10-12 20:51 UTC (permalink / raw)
To: ell
[-- Attachment #1: Type: text/plain, Size: 2522 bytes --]
Valgrind doesn't understand all of the keyctl syscalls and how they
set memory, so clear the encrypt/decrypt/sign output buffer to prevent
false positives.
TEST: key crypto
==5884== Conditional jump or move depends on uninitialised value(s)
==5884== at 0x40555F: unpad (key.c:479)
==5884== by 0x4057DF: l_key_decrypt (key.c:556)
==5884== by 0x4021EB: test_key_crypto (test-key.c:535)
==5884== by 0x4039BB: l_test_run (test.c:83)
==5884== by 0x4026F3: main (test-key.c:606)
==5884==
==5884== Conditional jump or move depends on uninitialised value(s)
==5884== at 0x40556F: unpad (key.c:479)
==5884== by 0x4057DF: l_key_decrypt (key.c:556)
==5884== by 0x4021EB: test_key_crypto (test-key.c:535)
==5884== by 0x4039BB: l_test_run (test.c:83)
==5884== by 0x4026F3: main (test-key.c:606)
==5884==
==5884== Conditional jump or move depends on uninitialised value(s)
==5884== at 0x4055AC: unpad (key.c:483)
==5884== by 0x4057DF: l_key_decrypt (key.c:556)
==5884== by 0x4021EB: test_key_crypto (test-key.c:535)
==5884== by 0x4039BB: l_test_run (test.c:83)
==5884== by 0x4026F3: main (test-key.c:606)
==5884==
==5884== Conditional jump or move depends on uninitialised value(s)
==5884== at 0x4C2FC4C: strcmp (vg_replace_strmem.c:842)
==5884== by 0x40223A: test_key_crypto (test-key.c:538)
==5884== by 0x4039BB: l_test_run (test.c:83)
==5884== by 0x4026F3: main (test-key.c:606)
==5884==
==5884== Conditional jump or move depends on uninitialised value(s)
==5884== at 0x4C2FC50: strcmp (vg_replace_strmem.c:842)
==5884== by 0x40223A: test_key_crypto (test-key.c:538)
==5884== by 0x4039BB: l_test_run (test.c:83)
==5884== by 0x4026F3: main (test-key.c:606)
==5884==
==5884== Conditional jump or move depends on uninitialised value(s)
==5884== at 0x4C2FC6C: strcmp (vg_replace_strmem.c:842)
==5884== by 0x40223A: test_key_crypto (test-key.c:538)
==5884== by 0x4039BB: l_test_run (test.c:83)
==5884== by 0x4026F3: main (test-key.c:606)
---
ell/key.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/ell/key.c b/ell/key.c
index 0222b39..fc20d29 100644
--- a/ell/key.c
+++ b/ell/key.c
@@ -218,6 +218,8 @@ static long kernel_key_eds(int op, int32_t serial, const char *encoding,
.out_len = len_out };
char *info = format_key_info(encoding, hash);
+ memset(out, 0, len_out);
+
result = syscall(__NR_keyctl, op, ¶ms, info ?: "", in, out);
l_free(info);
--
2.10.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] key: Fix Valgrind warnings
2016-10-12 20:51 [PATCH] key: Fix Valgrind warnings Mat Martineau
@ 2016-10-13 1:18 ` Denis Kenzior
0 siblings, 0 replies; 2+ messages in thread
From: Denis Kenzior @ 2016-10-13 1:18 UTC (permalink / raw)
To: ell
[-- Attachment #1: Type: text/plain, Size: 336 bytes --]
Hi Mat,
On 10/12/2016 03:51 PM, Mat Martineau wrote:
> Valgrind doesn't understand all of the keyctl syscalls and how they
> set memory, so clear the encrypt/decrypt/sign output buffer to prevent
> false positives.
>
> ---
> ell/key.c | 2 ++
> 1 file changed, 2 insertions(+)
>
Applied, thanks.
Regards,
-Denis
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2016-10-13 1:18 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-10-12 20:51 [PATCH] key: Fix Valgrind warnings Mat Martineau
2016-10-13 1:18 ` Denis Kenzior
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.