Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
crypto: sm3 - fix undefined shift by >= width of value
sm3_compress() calls rol32() with shift >= 32, which causes undefined behavior. This is easily detected by enabling CONFIG_UBSAN. Explicitly AND with 31 to make the behavior well defined. Fixes: 4f0fc16 ("crypto: sm3 - add OSCCA SM3 secure hash") Cc: <[email protected]> # v4.15+ Cc: Gilad Ben-Yossef <[email protected]> Signed-off-by: Eric Biggers <[email protected]> Signed-off-by: Herbert Xu <[email protected]>
- Loading branch information