All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH BlueZ] unit/test-ecc: Fix uninitialised values
@ 2018-02-09 13:10 Luiz Augusto von Dentz
  2018-02-09 14:41 ` Marcel Holtmann
  0 siblings, 1 reply; 3+ messages in thread
From: Luiz Augusto von Dentz @ 2018-02-09 13:10 UTC (permalink / raw)
  To: linux-bluetooth

From: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>

Conditional jump or move depends on uninitialised value(s)
   at 0x40208C: test_sample (test-ecc.c:106)
   by 0x4022AB: test_invalid_pub (test-ecc.c:272)
   by 0x406DA2: run_callback (tester.c:415)
   by 0x4E83576: ??? (in /usr/lib64/libglib-2.0.so.0.5400.3)
   by 0x4E86B76: g_main_context_dispatch (in /usr/lib64/libglib-2.0.so.0.5400.3)
   by 0x4E86F1F: ??? (in /usr/lib64/libglib-2.0.so.0.5400.3)
   by 0x4E87231: g_main_loop_run (in /usr/lib64/libglib-2.0.so.0.5400.3)
   by 0x408245: tester_run (tester.c:830)
   by 0x401CC3: main (test-ecc.c:291)

Conditional jump or move depends on uninitialised value(s)
   at 0x4020D6: test_sample (test-ecc.c:113)
   by 0x4022AB: test_invalid_pub (test-ecc.c:272)
   by 0x406DA2: run_callback (tester.c:415)
   by 0x4E83576: ??? (in /usr/lib64/libglib-2.0.so.0.5400.3)
   by 0x4E86B76: g_main_context_dispatch (in /usr/lib64/libglib-2.0.so.0.5400.3)
   by 0x4E86F1F: ??? (in /usr/lib64/libglib-2.0.so.0.5400.3)
   by 0x4E87231: g_main_loop_run (in /usr/lib64/libglib-2.0.so.0.5400.3)
   by 0x408245: tester_run (tester.c:830)
   by 0x401CC3: main (test-ecc.c:291)
---
 unit/test-ecc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/unit/test-ecc.c b/unit/test-ecc.c
index 98400a253..e0f9723fc 100644
--- a/unit/test-ecc.c
+++ b/unit/test-ecc.c
@@ -91,7 +91,7 @@ static int test_sample(uint8_t priv_a[32], uint8_t priv_b[32],
 				uint8_t pub_a[64], uint8_t pub_b[64],
 				uint8_t dhkey[32])
 {
-	uint8_t dhkey_a[32], dhkey_b[32];
+	uint8_t dhkey_a[32] = {}, dhkey_b[32] = {};
 	int fails = 0;
 
 	ecdh_shared_secret(pub_b, priv_a, dhkey_a);
-- 
2.14.3


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH BlueZ] unit/test-ecc: Fix uninitialised values
  2018-02-09 13:10 [PATCH BlueZ] unit/test-ecc: Fix uninitialised values Luiz Augusto von Dentz
@ 2018-02-09 14:41 ` Marcel Holtmann
  2018-02-12 11:29   ` Luiz Augusto von Dentz
  0 siblings, 1 reply; 3+ messages in thread
From: Marcel Holtmann @ 2018-02-09 14:41 UTC (permalink / raw)
  To: Luiz Augusto von Dentz; +Cc: linux-bluetooth

Hi Luiz,

> Conditional jump or move depends on uninitialised value(s)
>  at 0x40208C: test_sample (test-ecc.c:106)
>  by 0x4022AB: test_invalid_pub (test-ecc.c:272)
>  by 0x406DA2: run_callback (tester.c:415)
>  by 0x4E83576: ??? (in /usr/lib64/libglib-2.0.so.0.5400.3)
>  by 0x4E86B76: g_main_context_dispatch (in /usr/lib64/libglib-2.0.so.0.5400.3)
>  by 0x4E86F1F: ??? (in /usr/lib64/libglib-2.0.so.0.5400.3)
>  by 0x4E87231: g_main_loop_run (in /usr/lib64/libglib-2.0.so.0.5400.3)
>  by 0x408245: tester_run (tester.c:830)
>  by 0x401CC3: main (test-ecc.c:291)
> 
> Conditional jump or move depends on uninitialised value(s)
>  at 0x4020D6: test_sample (test-ecc.c:113)
>  by 0x4022AB: test_invalid_pub (test-ecc.c:272)
>  by 0x406DA2: run_callback (tester.c:415)
>  by 0x4E83576: ??? (in /usr/lib64/libglib-2.0.so.0.5400.3)
>  by 0x4E86B76: g_main_context_dispatch (in /usr/lib64/libglib-2.0.so.0.5400.3)
>  by 0x4E86F1F: ??? (in /usr/lib64/libglib-2.0.so.0.5400.3)
>  by 0x4E87231: g_main_loop_run (in /usr/lib64/libglib-2.0.so.0.5400.3)
>  by 0x408245: tester_run (tester.c:830)
>  by 0x401CC3: main (test-ecc.c:291)
> ---
> unit/test-ecc.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/unit/test-ecc.c b/unit/test-ecc.c
> index 98400a253..e0f9723fc 100644
> --- a/unit/test-ecc.c
> +++ b/unit/test-ecc.c
> @@ -91,7 +91,7 @@ static int test_sample(uint8_t priv_a[32], uint8_t priv_b[32],
> 				uint8_t pub_a[64], uint8_t pub_b[64],
> 				uint8_t dhkey[32])
> {
> -	uint8_t dhkey_a[32], dhkey_b[32];
> +	uint8_t dhkey_a[32] = {}, dhkey_b[32] = {};
> 	int fails = 0;

does an explicit memset also fixes this?

Regards

Marcel


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH BlueZ] unit/test-ecc: Fix uninitialised values
  2018-02-09 14:41 ` Marcel Holtmann
@ 2018-02-12 11:29   ` Luiz Augusto von Dentz
  0 siblings, 0 replies; 3+ messages in thread
From: Luiz Augusto von Dentz @ 2018-02-12 11:29 UTC (permalink / raw)
  To: Marcel Holtmann; +Cc: linux-bluetooth

Hi,

On Fri, Feb 9, 2018 at 12:41 PM, Marcel Holtmann <marcel@holtmann.org> wrote:
> Hi Luiz,
>
>> Conditional jump or move depends on uninitialised value(s)
>>  at 0x40208C: test_sample (test-ecc.c:106)
>>  by 0x4022AB: test_invalid_pub (test-ecc.c:272)
>>  by 0x406DA2: run_callback (tester.c:415)
>>  by 0x4E83576: ??? (in /usr/lib64/libglib-2.0.so.0.5400.3)
>>  by 0x4E86B76: g_main_context_dispatch (in /usr/lib64/libglib-2.0.so.0.5400.3)
>>  by 0x4E86F1F: ??? (in /usr/lib64/libglib-2.0.so.0.5400.3)
>>  by 0x4E87231: g_main_loop_run (in /usr/lib64/libglib-2.0.so.0.5400.3)
>>  by 0x408245: tester_run (tester.c:830)
>>  by 0x401CC3: main (test-ecc.c:291)
>>
>> Conditional jump or move depends on uninitialised value(s)
>>  at 0x4020D6: test_sample (test-ecc.c:113)
>>  by 0x4022AB: test_invalid_pub (test-ecc.c:272)
>>  by 0x406DA2: run_callback (tester.c:415)
>>  by 0x4E83576: ??? (in /usr/lib64/libglib-2.0.so.0.5400.3)
>>  by 0x4E86B76: g_main_context_dispatch (in /usr/lib64/libglib-2.0.so.0.5400.3)
>>  by 0x4E86F1F: ??? (in /usr/lib64/libglib-2.0.so.0.5400.3)
>>  by 0x4E87231: g_main_loop_run (in /usr/lib64/libglib-2.0.so.0.5400.3)
>>  by 0x408245: tester_run (tester.c:830)
>>  by 0x401CC3: main (test-ecc.c:291)
>> ---
>> unit/test-ecc.c | 2 +-
>> 1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/unit/test-ecc.c b/unit/test-ecc.c
>> index 98400a253..e0f9723fc 100644
>> --- a/unit/test-ecc.c
>> +++ b/unit/test-ecc.c
>> @@ -91,7 +91,7 @@ static int test_sample(uint8_t priv_a[32], uint8_t priv_b[32],
>>                               uint8_t pub_a[64], uint8_t pub_b[64],
>>                               uint8_t dhkey[32])
>> {
>> -     uint8_t dhkey_a[32], dhkey_b[32];
>> +     uint8_t dhkey_a[32] = {}, dhkey_b[32] = {};
>>       int fails = 0;
>
> does an explicit memset also fixes this?

Applied after changing it to use memsets.

-- 
Luiz Augusto von Dentz

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2018-02-12 11:29 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-02-09 13:10 [PATCH BlueZ] unit/test-ecc: Fix uninitialised values Luiz Augusto von Dentz
2018-02-09 14:41 ` Marcel Holtmann
2018-02-12 11:29   ` Luiz Augusto von Dentz

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.