Uninitialised memory detected by Valgrind after mpn_sec_tabselect on i686

Torbjörn Granlund tg at gmplib.org
Tue Jul 22 16:11:12 CEST 2025


I believe this is not actually a bug in GMP.  But we might make some
changes in order to make valgrind happy.

This is what might be happening:

The function mpn_sec_tabselect is used for choosing a bignum value from
a table of bignum values, without leaking which entry is chosen.

It reads the destination bignum variable and the next tabled bignum
variable, and then use logic operations to chose either.

Valgrind becomes unhappy as mpn_sec_tabselect pseudo-depends on the
value of its destination bignum area.

We should probably change this.  It is not hard, but masny asm
mpn_sec_tabselect needs to be changed.


-- 
Torbjörn
Please encrypt, key id 0xC8601622


More information about the gmp-bugs mailing list