]> git.baikalelectronics.ru Git - kernel.git/commit
async_xor: check src_offs is not NULL before updating it
authorXiao Ni <xni@redhat.com>
Fri, 28 May 2021 06:16:38 +0000 (14:16 +0800)
committerSong Liu <song@kernel.org>
Fri, 11 Jun 2021 02:40:14 +0000 (19:40 -0700)
commit5ae3332644dd4c460fed8cf8412930dcb5b8b5ef
treee6b21a9198837ae3e9d8a48adbc1f6126a9522d6
parent723b8a9a1a8f24aeb0a94f36ebc4f1cd7a9d3793
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: 09f7aafc70b1(async_xor: increase src_offs when dropping destination page)
Cc: stable@vger.kernel.org # v5.10+
Reported-by: Oleksandr Shchirskyi <oleksandr.shchirskyi@linux.intel.com>
Tested-by: Oleksandr Shchirskyi <oleksandr.shchirskyi@intel.com>
Signed-off-by: Xiao Ni <xni@redhat.com>
Signed-off-by: Song Liu <song@kernel.org>
crypto/async_tx/async_xor.c