libtomcrypt icon indicating copy to clipboard operation
libtomcrypt copied to clipboard

An improper locking bug(e.g., deadlock) on the lock ltc_ecc_fp_lock

Open ycaibb opened this issue 3 years ago • 3 comments

Hi, developers, thank you for your checking. It seems the lock ltc_ecc_fp_lock is not released correctly when cache_entry == NULL in the function ltc_ecc_fp_save_state?

https://github.com/libtom/libtomcrypt/blob/673f5ce29015a9bba3c96792920a10601b5b0718/src/math/fp/ltc_ecc_fp_mulmod.c#L1412-L1433

ycaibb avatar Sep 07 '21 08:09 ycaibb

Hi, developers @sjaeckel @fperrad @karel-m

Any comments would be highly appreciated. Thank you.

Best Regards,

ycaibb avatar Sep 13 '21 10:09 ycaibb

btw. referring to https://github.com/OP-TEE/optee_os/pull/4842 would have been nice :)

looks fine, I'll apply the patch you posted to optee

sjaeckel avatar Sep 14 '21 13:09 sjaeckel

@sjaeckel Thanks~

ycaibb avatar Sep 14 '21 14:09 ycaibb

Can you please check whether #626 correctly fixes this?

sjaeckel avatar Aug 07 '23 13:08 sjaeckel

It looks good to me.

ycaibb avatar Aug 16 '23 02:08 ycaibb