Skip to content

Commit

Permalink
kmsan: fixup for 1c54bfd
Browse files Browse the repository at this point in the history
Encryption and decryption functions must both check the inputs and
unpoison the outputs.
  • Loading branch information
ramosian-glider committed Jun 7, 2018
1 parent 1df6c1f commit eb46616
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions include/linux/crypto.h
Expand Up @@ -1575,6 +1575,7 @@ static inline int crypto_cipher_setkey(struct crypto_cipher *tfm,
static inline void crypto_cipher_encrypt_one(struct crypto_cipher *tfm,
u8 *dst, const u8 *src)
{
kmsan_check_memory(src, crypto_cipher_tfm(tfm)->__crt_alg->cra_blocksize);
crypto_cipher_crt(tfm)->cit_encrypt_one(crypto_cipher_tfm(tfm),
dst, src);
kmsan_unpoison_shadow(dst, crypto_cipher_tfm(tfm)->__crt_alg->cra_blocksize);
Expand All @@ -1596,6 +1597,7 @@ static inline void crypto_cipher_decrypt_one(struct crypto_cipher *tfm,
kmsan_check_memory(src, crypto_cipher_tfm(tfm)->__crt_alg->cra_blocksize);
crypto_cipher_crt(tfm)->cit_decrypt_one(crypto_cipher_tfm(tfm),
dst, src);
kmsan_unpoison_shadow(dst, crypto_cipher_tfm(tfm)->__crt_alg->cra_blocksize);
}

static inline struct crypto_comp *__crypto_comp_cast(struct crypto_tfm *tfm)
Expand Down

0 comments on commit eb46616

Please sign in to comment.