mirror of
https://github.com/AuxXxilium/linux_dsm_epyc7002.git
synced 2024-12-22 13:37:49 +07:00
eff84b3790
The SHA-512 multibuffer code keeps track of the number of blocks pending
in each lane. The minimum of these values is used to identify the next
lane that will be completed. Unused lanes are set to a large number
(0xFFFFFFFF) so that they don't affect this calculation.
However, it was forgotten to set the lengths to this value in the
initial state, where all lanes are unused. As a result it was possible
for sha512_mb_mgr_get_comp_job_avx2() to select an unused lane, causing
a NULL pointer dereference. Specifically this could happen in the case
where ->update() was passed fewer than SHA512_BLOCK_SIZE bytes of data,
so it then called sha_complete_job() without having actually submitted
any blocks to the multi-buffer code. This hit a NULL pointer
dereference if another task happened to have submitted blocks
concurrently to the same CPU and the flush timer had not yet expired.
Fix this by initializing sha512_mb_mgr->lens correctly.
As usual, this bug was found by syzkaller.
Fixes:
|
||
---|---|---|
.. | ||
Makefile | ||
sha512_mb_ctx.h | ||
sha512_mb_mgr_datastruct.S | ||
sha512_mb_mgr_flush_avx2.S | ||
sha512_mb_mgr_init_avx2.c | ||
sha512_mb_mgr_submit_avx2.S | ||
sha512_mb_mgr.h | ||
sha512_mb.c | ||
sha512_x4_avx2.S |