Re: [Cocci] [PATCH v2 2/2] crypto: Remove unnecessary memzero_explicit()

2020-04-15 Thread Michal Suchánek
On Tue, Apr 14, 2020 at 12:24:36PM -0400, Waiman Long wrote: > On 4/14/20 2:08 AM, Christophe Leroy wrote: > > > > > > Le 14/04/2020 à 00:28, Waiman Long a écrit : > >> Since kfree_sensitive() will do an implicit memzero_explicit(), there > >> is no need to call memzero_explicit() before it.

Re: [Cocci] [PATCH v2 2/2] crypto: Remove unnecessary memzero_explicit()

2020-04-15 Thread Waiman Long
On 4/14/20 3:16 PM, Michal Suchánek wrote: > On Tue, Apr 14, 2020 at 12:24:36PM -0400, Waiman Long wrote: >> On 4/14/20 2:08 AM, Christophe Leroy wrote: >>> >>> Le 14/04/2020 à 00:28, Waiman Long a écrit : Since kfree_sensitive() will do an implicit memzero_explicit(), there is no need

Re: [Cocci] [PATCH v2 2/2] crypto: Remove unnecessary memzero_explicit()

2020-04-15 Thread Joe Perches
On Tue, 2020-04-14 at 15:37 -0400, Waiman Long wrote: > OK, I can change it to clear the key length when the allocation failed > which isn't likely. Perhaps: kfree_sensitive(op->key); op->key = NULL; op->keylen = 0; but I don't know that it impacts any possible state.

Re: [Cocci] [PATCH v2 2/2] crypto: Remove unnecessary memzero_explicit()

2020-04-14 Thread Waiman Long
On 4/14/20 2:08 AM, Christophe Leroy wrote: > > > Le 14/04/2020 à 00:28, Waiman Long a écrit : >> Since kfree_sensitive() will do an implicit memzero_explicit(), there >> is no need to call memzero_explicit() before it. Eliminate those >> memzero_explicit() and simplify the call sites. For better

Re: [Cocci] [PATCH v2 2/2] crypto: Remove unnecessary memzero_explicit()

2020-04-14 Thread Christophe Leroy
Le 14/04/2020 à 00:28, Waiman Long a écrit : Since kfree_sensitive() will do an implicit memzero_explicit(), there is no need to call memzero_explicit() before it. Eliminate those memzero_explicit() and simplify the call sites. For better correctness, the setting of keylen is also moved down

[Cocci] [PATCH v2 2/2] crypto: Remove unnecessary memzero_explicit()

2020-04-14 Thread Waiman Long
Since kfree_sensitive() will do an implicit memzero_explicit(), there is no need to call memzero_explicit() before it. Eliminate those memzero_explicit() and simplify the call sites. For better correctness, the setting of keylen is also moved down after the key pointer check. Signed-off-by: