summaryrefslogtreecommitdiffstats
path: root/drivers/crypto/img-hash.c
diff options
context:
space:
mode:
authorDan Carpenter <dan.carpenter@oracle.com>2015-03-23 14:03:55 +0300
committerHerbert Xu <herbert@gondor.apana.org.au>2015-03-23 22:06:50 +1100
commita83034f5cb135bceb5b23dce1746ef2d98c68234 (patch)
tree4a7db7403110fecc2a1b5ff6b35aca6a92254b68 /drivers/crypto/img-hash.c
parent900831a4d9cf3d0280527f176fc20e8c0cdbb63a (diff)
downloadlinux-stable-a83034f5cb135bceb5b23dce1746ef2d98c68234.tar.gz
linux-stable-a83034f5cb135bceb5b23dce1746ef2d98c68234.tar.bz2
linux-stable-a83034f5cb135bceb5b23dce1746ef2d98c68234.zip
crypto: img-hash - shift wrapping bug in img_hash_hw_init()
"hdev->req->nbytes" is an unsigned int so we so we lose the upper 3 bits to the shift wrap bug. Signed-off-by: Dan Carpenter <dan.carpenter@oracle.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.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/crypto/img-hash.c b/drivers/crypto/img-hash.c
index 601ab357f661..ad47d0d61098 100644
--- a/drivers/crypto/img-hash.c
+++ b/drivers/crypto/img-hash.c
@@ -464,7 +464,7 @@ static int img_hash_hw_init(struct img_hash_dev *hdev)
img_hash_write(hdev, CR_RESET, CR_RESET_UNSET);
img_hash_write(hdev, CR_INTENAB, CR_INT_NEW_RESULTS_SET);
- nbits = (hdev->req->nbytes << 3);
+ nbits = (u64)hdev->req->nbytes << 3;
u = nbits >> 32;
l = nbits;
img_hash_write(hdev, CR_MESSAGE_LENGTH_H, u);