Re: [PATCH 01/10] crypto: testmgr - avoid DMA mapping from text, rodata, stack

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 7/23/2014 1:37 AM, Kim Phillips wrote:
> On Fri, 11 Jul 2014 15:34:46 +0300
> Horia Geanta <horia.geanta@xxxxxxxxxxxxx> wrote:
> 
>> +++ b/crypto/testmgr.c
>> @@ -198,13 +198,20 @@ static int __test_hash(struct crypto_ahash *tfm, struct hash_testvec *template,
>>  	const char *algo = crypto_tfm_alg_driver_name(crypto_ahash_tfm(tfm));
>>  	unsigned int i, j, k, temp;
>>  	struct scatterlist sg[8];
>> -	char result[64];
>> +	char *result = NULL;
>> +	char *key = NULL;
> 
> these needn't be initialized, here and elsewhere.

I was under the impression that this is needed for kfree on some exit
paths, but indeed it's not the case.

> 
>>  	struct ahash_request *req;
>>  	struct tcrypt_result tresult;
>>  	void *hash_buff;
>>  	char *xbuf[XBUFSIZE];
>>  	int ret = -ENOMEM;
>>  
>> +	result = kmalloc(64, GFP_KERNEL);
> 
> s/64/MAX_DIGEST_SIZE
> 
>> +++ b/crypto/testmgr.h
>> @@ -32,7 +32,7 @@
>>  #define MAX_DIGEST_SIZE		64
>>  #define MAX_TAP			8
>>  
>> -#define MAX_KEYLEN		56
>> +#define MAX_KEYLEN		160
>>  #define MAX_IVLEN		32
> 
> this change could use a blurb in the commit message.

I'll send a v2 only for current patch, if Herbert is ok with this.

> 
> Other than that, this series gets my:
> 
> Acked-by: Kim Phillips <kim.phillips@xxxxxxxxxxxxx>
> 
> Thanks!

Thanks for reviewing, testing.

Horia


--
To unsubscribe from this list: send the line "unsubscribe linux-crypto" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Kernel]     [Gnu Classpath]     [Gnu Crypto]     [DM Crypt]     [Netfilter]     [Bugtraq]

  Powered by Linux