Skip to content

Commit

Permalink
async_xor: check src_offs is not NULL before updating it
Browse files Browse the repository at this point in the history
When PAGE_SIZE is greater than 4kB, multiple stripes may share the same
page. Thus, src_offs is added to async_xor_offs() with array of offsets.
However, async_xor() passes NULL src_offs to async_xor_offs(). In such
case, src_offs should not be updated. Add a check before the update.

Fixes: ceaf296(async_xor: increase src_offs when dropping destination page)
Cc: [email protected] # v5.10+
Reported-by: Oleksandr Shchirskyi <[email protected]>
Tested-by: Oleksandr Shchirskyi <[email protected]>
Signed-off-by: Xiao Ni <[email protected]>
Signed-off-by: Song Liu <[email protected]>
  • Loading branch information
XiaoNi87 authored and liu-song-6 committed Jun 11, 2021
1 parent 41fe8d0 commit 9be148e
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion crypto/async_tx/async_xor.c
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,8 @@ async_xor_offs(struct page *dest, unsigned int offset,
if (submit->flags & ASYNC_TX_XOR_DROP_DST) {
src_cnt--;
src_list++;
src_offs++;
if (src_offs)
src_offs++;
}

/* wait for any prerequisite operations */
Expand Down

0 comments on commit 9be148e

Please sign in to comment.