lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:   Tue, 08 Aug 2017 13:05:16 -0500
From:   ebiederm@...ssion.com (Eric W. Biederman)
To:     Pan Bian <bianpan2016@....com>
Cc:     kexec@...ts.infradead.org, linux-kernel@...r.kernel.org
Subject: Re: kexec_file: use crypto_free_shash to free memory

Pan Bian <bianpan2016@....com> 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 nothing sensitive being
stored or hashed.  The hash is used for integrity checking purposes.

If the argument is that kfree is simply the wrong frunction for freeing
something allocating with crypto_alloc_shash() I can believe that.  In
which case that sounds like something that needs to be fixed.  But I am
concerned that wasn't your argument and you are talking about something
that appears to be completely irrelevant.

Eric

> Signed-off-by: Pan Bian <bianpan2016@....com>
> ---
>  kernel/kexec_file.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/kernel/kexec_file.c b/kernel/kexec_file.c
> index 9f48f44..94eeb38 100644
> --- a/kernel/kexec_file.c
> +++ b/kernel/kexec_file.c
> @@ -627,7 +627,7 @@ static int kexec_calculate_store_digests(struct kimage *image)
>  out_free_desc:
>  	kfree(desc);
>  out_free_tfm:
> -	kfree(tfm);
> +	crypto_free_shash(tfm);
>  out:
>  	return ret;
>  }

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ