summaryrefslogtreecommitdiff
path: root/drivers/crypto/img-hash.c
diff options
context:
space:
mode:
authorWill Thomas <will.thomas@imgtec.com>2016-08-05 14:00:15 +0100
committerHerbert Xu <herbert@gondor.apana.org.au>2016-08-09 18:47:20 +0800
commitdd4f677b0c89280e66ab9bebf97c8c90fbc1c330 (patch)
treebd1d9b95ac7c26d0ff3cecb15fe511e4e4957d96 /drivers/crypto/img-hash.c
parent10badea259fab2ec91a5e6bf1e568a01e4cb5263 (diff)
crypto: img-hash - Fix hash request context
Move 0 length buffer to end of structure to stop overwriting fallback request data. This doesn't cause a bug itself as the buffer is never used alongside the fallback but should be changed. Signed-off-by: Will Thomas <will.thomas@imgtec.com> Reviewed-by: James Hartley <james.hartley@imgtec.com> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to 'drivers/crypto/img-hash.c')
-rw-r--r--drivers/crypto/img-hash.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/crypto/img-hash.c b/drivers/crypto/img-hash.c
index e5c941bdc693..de2b86efbfe4 100644
--- a/drivers/crypto/img-hash.c
+++ b/drivers/crypto/img-hash.c
@@ -102,8 +102,10 @@ struct img_hash_request_ctx {
unsigned long op;
size_t bufcnt;
- u8 buffer[0] __aligned(sizeof(u32));
struct ahash_request fallback_req;
+
+ /* Zero length buffer must remain last member of struct */
+ u8 buffer[0] __aligned(sizeof(u32));
};
struct img_hash_ctx {