Messages in this thread | | | Date | Fri, 18 Sep 2015 21:17:13 +0800 | From | Herbert Xu <> | Subject | Re: [PATCH v3] crypto: omap-aes: Add support for GCM mode |
| |
On Tue, Sep 15, 2015 at 06:58:01PM +0530, Lokesh Vutla wrote: > > + assoc = &req->src[0]; > + sg_init_table(dd->in_sgl, nsg + 1); > + if (assoclen) { > + if (omap_aes_check_aligned(assoc, assoclen)) { > + dd->sgs_copied |= AES_ASSOC_DATA_COPIED; > + pages = get_order(alen); > + buf_in = (void *)__get_free_pages(GFP_ATOMIC, pages);
It would be better if you used a list of pages rather than n contiguous pages which is likely to fail.
> + buf_in = sg_virt(assoc);
This is bogus as assoc may not be mapped.
> + if (req->cryptlen) { > + input = scatterwalk_ffwd(tmp, req->src, req->assoclen);
scatterwalk_ffwd may return tmp so tmp must not be on the stack unless you stop using input after the function returns. Also tmp must not be reused by a subsequent call to scatterwalk_ffwd.
Cheers, -- Email: Herbert Xu <herbert@gondor.apana.org.au> Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
| |