Skip to content
This repository has been archived by the owner on Mar 25, 2024. It is now read-only.

Use of uninitialized values #97

Open
matthiasgoergens opened this issue Dec 20, 2022 · 0 comments
Open

Use of uninitialized values #97

matthiasgoergens opened this issue Dec 20, 2022 · 0 comments

Comments

@matthiasgoergens
Copy link

When building with memory sanitizer, I am getting a lot of problems like the following:

==68141==WARNING: MemorySanitizer: use-of-uninitialized-value
    #0 0x7feab3c79dca in FF_2048_modmul ff_2048.c
    #1 0x7feab3c7a818 in FF_2048_ct_2w_pow (/home/matthias/incubator-milagro-crypto-c/target/default/lib/libamcl_rsa_2048.so.2+0x77818)
    #2 0x7feab3c7e0e0 in FF_2048_ct_pow_2 (/home/matthias/incubator-milagro-crypto-c/target/default/lib/libamcl_rsa_2048.so.2+0x7b0e0)
    #3 0x555bd4507b73 in main (/home/matthias/incubator-milagro-crypto-c/target/default/bin/test_ff_consistency_2048+0xb6b73)
    #4 0x7feab390628f in __libc_start_call_main /usr/src/debug/glibc/glibc/csu/../sysdeps/nptl/libc_start_call_main.h:58:16
    #5 0x7feab3906349 in __libc_start_main@GLIBC_2.2.5 /usr/src/debug/glibc/glibc/csu/../csu/libc-start.c:381:3
    #6 0x555bd4474404 in _start /build/glibc/src/glibc/csu/../sysdeps/x86_64/start.S:115

  Uninitialized value was stored to memory at
    #0 0x7feab3c0ea76 in BIG_1024_58_cmove (/home/matthias/incubator-milagro-crypto-c/target/default/lib/libamcl_rsa_2048.so.2+0xba76)

  Uninitialized value was stored to memory at
    #0 0x7feab3c0ea76 in BIG_1024_58_cmove (/home/matthias/incubator-milagro-crypto-c/target/default/lib/libamcl_rsa_2048.so.2+0xba76)

  Uninitialized value was stored to memory at
    #0 0x7feab3c0ea76 in BIG_1024_58_cmove (/home/matthias/incubator-milagro-crypto-c/target/default/lib/libamcl_rsa_2048.so.2+0xba76)

  Uninitialized value was stored to memory at
    #0 0x7feab3c0ea76 in BIG_1024_58_cmove (/home/matthias/incubator-milagro-crypto-c/target/default/lib/libamcl_rsa_2048.so.2+0xba76)

  Uninitialized value was stored to memory at
    #0 0x7feab3c0ea76 in BIG_1024_58_cmove (/home/matthias/incubator-milagro-crypto-c/target/default/lib/libamcl_rsa_2048.so.2+0xba76)

  Uninitialized value was stored to memory at
    #0 0x7feab3c0ea76 in BIG_1024_58_cmove (/home/matthias/incubator-milagro-crypto-c/target/default/lib/libamcl_rsa_2048.so.2+0xba76)

  Uninitialized value was created by an allocation of 'vla' in the stack frame of function 'FF_2048_ct_2w_pow'
    #0 0x7feab3c7a170 in FF_2048_ct_2w_pow (/home/matthias/incubator-milagro-crypto-c/target/default/lib/libamcl_rsa_2048.so.2+0x77170)

SUMMARY: MemorySanitizer: use-of-uninitialized-value ff_2048.c in FF_2048_modmul
Exiting

As far as I can tell, this specific example is caused by FF_WWW_ct_2w_pow not always initialising ws. But there are more examples in the code.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant