kernel_optimize_test/crypto
Xiao Ni cab2e8e599 async_xor: increase src_offs when dropping destination page
commit ceaf2966ab082bbc4d26516f97b3ca8a676e2af8 upstream.

Now we support sharing one page if PAGE_SIZE is not equal stripe size. To
support this, it needs to support calculating xor value with different
offsets for each r5dev. One offset array is used to record those offsets.

In RMW mode, parity page is used as a source page. It sets
ASYNC_TX_XOR_DROP_DST before calculating xor value in ops_run_prexor5.
So it needs to add src_list and src_offs at the same time. Now it only
needs src_list. So the xor value which is calculated is wrong. It can
cause data corruption problem.

I can reproduce this problem 100% on a POWER8 machine. The steps are:

  mdadm -CR /dev/md0 -l5 -n3 /dev/sdb1 /dev/sdc1 /dev/sdd1 --size=3G
  mkfs.xfs /dev/md0
  mount /dev/md0 /mnt/test
  mount: /mnt/test: mount(2) system call failed: Structure needs cleaning.

Fixes: 29bcff787a ("md/raid5: add new xor function to support different page offset")
Cc: stable@vger.kernel.org # v5.10+
Signed-off-by: Xiao Ni <xni@redhat.com>
Signed-off-by: Song Liu <song@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-05-14 09:49:59 +02:00
..
asymmetric_keys X.509: Fix crash caused by NULL pointer 2021-01-23 16:03:58 +01:00
async_tx async_xor: increase src_offs when dropping destination page 2021-05-14 09:49:59 +02:00
842.c
acompress.c
adiantum.c mm, treewide: rename kzfree() to kfree_sensitive() 2020-08-07 11:33:22 -07:00
aead.c
aegis.h
aegis128-core.c
aegis128-neon-inner.c
aegis128-neon.c
aes_generic.c
aes_ti.c
af_alg.c crypto: af_alg - avoid undefined behavior accessing salg_name 2020-12-26 16:02:45 +01:00
ahash.c crypto: ahash - Add init_tfm/exit_tfm 2020-08-28 16:58:28 +10:00
akcipher.c
algapi.c
algboss.c
algif_aead.c crypto: algif_aead - Do not set MAY_BACKLOG on the async path 2020-08-21 14:45:27 +10:00
algif_hash.c
algif_rng.c crypto: af_alg - add extra parameters for DRBG interface 2020-09-25 17:48:52 +10:00
algif_skcipher.c crypto: algif_skcipher - EBUSY on aio should be an error 2020-08-21 14:45:26 +10:00
ansi_cprng.c
anubis.c
api.c crypto: api - check for ERR pointers in crypto_destroy_tfm() 2021-05-11 14:47:16 +02:00
arc4.c crypto: arc4 - mark ecb(arc4) skcipher as obsolete 2020-09-11 14:39:16 +10:00
authenc.c
authencesn.c
blake2b_generic.c
blake2s_generic.c
blowfish_common.c
blowfish_generic.c
camellia_generic.c
cast_common.c
cast5_generic.c
cast6_generic.c
cbc.c crypto: cbc - Remove cbc.h 2020-09-11 14:39:16 +10:00
ccm.c
cfb.c
chacha_generic.c
chacha20poly1305.c
cipher.c
cmac.c
compress.c
crc32_generic.c
crc32c_generic.c crypto: crc32c_generic - delete and fix duplicated words 2020-08-21 14:45:25 +10:00
crct10dif_common.c
crct10dif_generic.c crypto: crct10dif_generic - fix duplicated words 2020-08-21 14:45:25 +10:00
cryptd.c
crypto_engine.c crypto: engine - delete duplicated word 2020-08-21 14:45:26 +10:00
crypto_null.c
crypto_user_base.c
crypto_user_stat.c
ctr.c
cts.c
curve25519-generic.c
deflate.c mm, treewide: rename kzfree() to kfree_sensitive() 2020-08-07 11:33:22 -07:00
des_generic.c
dh_helper.c
dh.c
drbg.c treewide: Use fallthrough pseudo-keyword 2020-08-23 17:36:59 -05:00
ecb.c
ecc_curve_defs.h
ecc.c mm, treewide: rename kzfree() to kfree_sensitive() 2020-08-07 11:33:22 -07:00
ecc.h
ecdh_helper.c crypto: ecdh_helper - Ensure 'len >= secret.len' in decode_key() 2021-03-04 11:37:49 +01:00
ecdh.c crypto: ecdh - avoid buffer overflow in ecdh_set_secret() 2021-01-12 20:18:17 +01:00
echainiv.c
ecrdsa_defs.h
ecrdsa_params.asn1
ecrdsa_pub_key.asn1
ecrdsa.c crypto: algapi - Remove skbuff.h inclusion 2020-08-20 14:04:28 +10:00
essiv.c
fcrypt.c
fips.c
gcm.c mm, treewide: rename kzfree() to kfree_sensitive() 2020-08-07 11:33:22 -07:00
geniv.c
gf128mul.c mm, treewide: rename kzfree() to kfree_sensitive() 2020-08-07 11:33:22 -07:00
ghash-generic.c
hash_info.c
hmac.c
internal.h crypto: algapi - Move crypto_yield into internal.h 2020-08-19 21:59:43 +10:00
jitterentropy-kcapi.c crypto: algapi - Remove skbuff.h inclusion 2020-08-20 14:04:28 +10:00
jitterentropy.c
jitterentropy.h
Kconfig crypto: mips/poly1305 - enable for all MIPS processors 2021-03-17 17:06:10 +01:00
keywrap.c
khazad.c
kpp.c
lrw.c
lz4.c
lz4hc.c
lzo-rle.c
lzo.c
Makefile crypto: sm2 - introduce OSCCA SM2 asymmetric cipher algorithm 2020-09-25 17:48:54 +10:00
md4.c
md5.c
memneq.c
michael_mic.c crypto: michael_mic - fix broken misalignment handling 2021-03-04 11:38:31 +01:00
nhpoly1305.c
ofb.c
pcbc.c
pcrypt.c
poly1305_generic.c
proc.c crypto: proc - Removing some useless only space lines 2020-09-25 17:48:15 +10:00
ripemd.h
rmd128.c
rmd160.c
rmd256.c
rmd320.c
rng.c crypto: rng - fix crypto_rng_reset() refcounting when !CRYPTO_STATS 2021-05-11 14:47:35 +02:00
rsa_helper.c
rsa-pkcs1pad.c crypto: algapi - Remove skbuff.h inclusion 2020-08-20 14:04:28 +10:00
rsa.c
rsaprivkey.asn1
rsapubkey.asn1
salsa20_generic.c
scatterwalk.c
scompress.c
seed.c
seqiv.c mm, treewide: rename kzfree() to kfree_sensitive() 2020-08-07 11:33:22 -07:00
serpent_generic.c
sha1_generic.c
sha3_generic.c
sha256_generic.c
sha512_generic.c
shash.c mm, treewide: rename kzfree() to kfree_sensitive() 2020-08-07 11:33:22 -07:00
simd.c
skcipher.c mm, treewide: rename kzfree() to kfree_sensitive() 2020-08-07 11:33:22 -07:00
sm2.c crypto: sm2 - introduce OSCCA SM2 asymmetric cipher algorithm 2020-09-25 17:48:54 +10:00
sm2signature.asn1 crypto: sm2 - introduce OSCCA SM2 asymmetric cipher algorithm 2020-09-25 17:48:54 +10:00
sm3_generic.c crypto: sm3 - export crypto_sm3_final function 2020-09-25 17:48:53 +10:00
sm4_generic.c
streebog_generic.c
tcrypt.c crypto: tcrypt - avoid signed overflow in byte count 2021-03-07 12:34:11 +01:00
tcrypt.h crypto: tcrypt - Add support for hash speed testing with keys 2020-08-21 14:45:27 +10:00
tea.c
testmgr.c crypto: sm2 - add SM2 test vectors to testmgr 2020-09-25 17:48:54 +10:00
testmgr.h crypto: sm2 - add SM2 test vectors to testmgr 2020-09-25 17:48:54 +10:00
tgr192.c
twofish_common.c
twofish_generic.c
vmac.c
wp512.c
xcbc.c
xor.c crypto: xor - Fix divide error in do_xor_speed() 2021-01-27 11:54:52 +01:00
xts.c
xxhash_generic.c
zstd.c mm, treewide: rename kzfree() to kfree_sensitive() 2020-08-07 11:33:22 -07:00