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]
Message-ID: <a72257ba-14c2-8e61-435c-4daa3a7d6b6e@linaro.org>
Date:   Fri, 8 Jan 2021 10:50:11 -0500
From:   Thara Gopinath <thara.gopinath@...aro.org>
To:     Herbert Xu <herbert@...dor.apana.org.au>
Cc:     davem@...emloft.net, bjorn.andersson@...aro.org,
        ebiggers@...gle.com, ardb@...nel.org, sivaprak@...eaurora.org,
        linux-crypto@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH 1/6] drivers: crypto: qce: sha: Restore/save
 sha1_state/sha256_state with qce_sha_reqctx in export/import



On 1/2/21 4:25 PM, Herbert Xu wrote:
> On Fri, Dec 18, 2020 at 10:30:22PM -0500, Thara Gopinath wrote:
>> Export and import interfaces save and restore partial transformation
>> states. The partial states were being stored and restored in struct
>> sha1_state for sha1/hmac(sha1) transformations and sha256_state for
>> sha256/hmac(sha256) transformations.This led to a bunch of corner cases
>> where improper state was being stored and restored. A few of the corner
>> cases that turned up during testing are:
>>
>> - wrong byte_count restored if export/import is called twice without h/w
>> transaction in between
>> - wrong buflen restored back if the pending buffer
>> length is exactly the block size.
>> - wrong state restored if buffer length is 0.
>>
>> To fix these issues, save and restore the entire qce_sha_rctx structure
>> instead of parts of it in sha1_state and sha256_state structures.
>> This in turn simplifies the export and import apis.
>>
>> Signed-off-by: Thara Gopinath <thara.gopinath@...aro.org>
>> ---
>>   drivers/crypto/qce/sha.c | 93 ++++------------------------------------
>>   1 file changed, 8 insertions(+), 85 deletions(-)
> 
> How is this safe when the reqctx structure contains pointers?

Hi Herbert,

You are right. Also more I think about this, it is better to have 
another struct to export and import the relevant pieces.
I will fix this and send across a v2.

> 
> Cheers,
> 

-- 
Warm Regards
Thara

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ