提交 a83034f5 编写于 作者: D Dan Carpenter 提交者: Herbert Xu

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: NDan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: NHerbert Xu <herbert@gondor.apana.org.au>
上级 900831a4
...@@ -464,7 +464,7 @@ static int img_hash_hw_init(struct img_hash_dev *hdev) ...@@ -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_RESET, CR_RESET_UNSET);
img_hash_write(hdev, CR_INTENAB, CR_INT_NEW_RESULTS_SET); 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; u = nbits >> 32;
l = nbits; l = nbits;
img_hash_write(hdev, CR_MESSAGE_LENGTH_H, u); img_hash_write(hdev, CR_MESSAGE_LENGTH_H, u);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册