Re: [V2] kexec_file: use crypto_free_shash to free memory

2017-08-09 Thread Baoquan He
On 08/09/17 at 07:30pm, Pan Bian wrote: > In function kexec_calculate_store_digests(), kfree() is used to free > memory allocated by crypto_alloc_shash(). It is better to use function > crypto_free_shash(), which frees up tfm and any resources associated with > it. And then, the refcount of the

[V2] kexec_file: use crypto_free_shash to free memory

2017-08-09 Thread Pan Bian
In function kexec_calculate_store_digests(), kfree() is used to free memory allocated by crypto_alloc_shash(). It is better to use function crypto_free_shash(), which frees up tfm and any resources associated with it. And then, the refcount of the algorithm used in crypto_alloc_shash() is also

Re: kexec_file: use crypto_free_shash to free memory

2017-08-08 Thread Eric W. Biederman
Pan Bian writes: > In function kexec_calculate_store_digests(), kfree() is used to free > memory allocated by crypto_alloc_shash(). It is better to use function > crypto_free_shash(), which also zeroizes the memory to be freed. Why is it important to zero memory? There is

kexec_file: use crypto_free_shash to free memory

2017-08-08 Thread Pan Bian
In function kexec_calculate_store_digests(), kfree() is used to free memory allocated by crypto_alloc_shash(). It is better to use function crypto_free_shash(), which also zeroizes the memory to be freed. Signed-off-by: Pan Bian --- kernel/kexec_file.c | 2 +- 1 file