mirror of
https://github.com/torvalds/linux.git
synced 2024-11-10 22:21:40 +00:00
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>
This commit is contained in:
parent
900831a4d9
commit
a83034f5cb
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user