From: Will Thomas Date: Fri, 5 Aug 2016 13:00:15 +0000 (+0100) Subject: crypto: img-hash - Fix hash request context X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=dd4f677b0c89280e66ab9bebf97c8c90fbc1c330;p=linux-beck.git 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 Reviewed-by: James Hartley Signed-off-by: Herbert Xu --- 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 {