Re: crypto: nx - Fix reentrancy bugs
From: Herbert Xu <herbert@gondor.apana.org.au>
Date: 2015-07-07 22:10:51
On Tue, Jul 07, 2015 at 03:48:37PM -0300, Leonidas S. Barbosa wrote:
On Tue, Jul 07, 2015 at 05:30:25PM +0800, Herbert Xu wrote:quoted
The crypto API allows a single transform to be used by multiple threads simultaneously. For example, IPsec will use a single tfm to process packets for a given SA. As packets may arrive on multiple CPUs that tfm must be reentrant. The nx driver does try to deal with this by using a spin lock. Unfortunately only the basic AES/CBC/ECB algorithms do this in the correct way. The symptom of these bugs may range from the generation of incorrect output to memory corruption.Is this related with the issue in CTR ouput test#4 too?
I don't think so because during the test there should only be a single user. But I'll test it out today just in case. PS it would appear that you can make this completely reentrant by moving all the data from the tfm into the reqeust. Could you work on this and remove the spinlock completely? Thanks, -- Email: Herbert Xu [off-list ref] Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt