Thread (26 messages) flat view 26 messages, 4 authors, 2015-06-03

[PATCH v9 4/4] crypto: Add Allwinner Security System crypto accelerator

From: herbert@gondor.apana.org.au (Herbert Xu)
Date: 2015-05-15 06:53:00
Also in: linux-crypto, linux-devicetree, lkml

On Thu, May 14, 2015 at 02:59:01PM +0200, LABBE Corentin wrote:
+int sun4i_hash_export(struct ahash_request *areq, void *out)
+{
+	struct sun4i_req_ctx *op = ahash_request_ctx(areq);
+
+	memcpy(out, op, sizeof(struct sun4i_req_ctx));
+	return 0;
+}
+
+int sun4i_hash_import(struct ahash_request *areq, const void *in)
+{
+	struct sun4i_req_ctx *op = ahash_request_ctx(areq);
+
+	memcpy(op, in, sizeof(struct sun4i_req_ctx));
This is very wrong.  You're importing an arbitrary ss pointer.  The
whole point of having an import function instead of just a simple
memcpy is to deal with such problems.

Cheers,
-- 
Email: Herbert Xu [off-list ref]
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help