Skip to content

Commit 9be148e

Browse files
XiaoNi87liu-song-6
authored andcommitted
async_xor: check src_offs is not NULL before updating it
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]>
1 parent 41fe8d0 commit 9be148e

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

crypto/async_tx/async_xor.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,8 @@ async_xor_offs(struct page *dest, unsigned int offset,
233233
if (submit->flags & ASYNC_TX_XOR_DROP_DST) {
234234
src_cnt--;
235235
src_list++;
236-
src_offs++;
236+
if (src_offs)
237+
src_offs++;
237238
}
238239

239240
/* wait for any prerequisite operations */

0 commit comments

Comments
 (0)