Re: [syzbot] [crypto?] KMSAN: uninit-value in skcipher_walk_virt

From: syzbot
Date: Fri May 03 2024 - 10:41:16 EST


> req->base.flags were not initialized, zero might suit in this case.
> Do it with skcipher_request_set_callback() as it's common practice.
>
> #syz test https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master

This crash does not have a reproducer. I cannot test it.

>
> ---
> fs/bcachefs/checksum.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/fs/bcachefs/checksum.c b/fs/bcachefs/checksum.c
> index 7ed779b411f6..088fd2e7bdf1 100644
> --- a/fs/bcachefs/checksum.c
> +++ b/fs/bcachefs/checksum.c
> @@ -102,6 +102,7 @@ static inline int do_encrypt_sg(struct crypto_sync_skcipher *tfm,
> int ret;
>
> skcipher_request_set_sync_tfm(req, tfm);
> + skcipher_request_set_callback(req, 0, NULL, NULL);
> skcipher_request_set_crypt(req, sg, sg, len, nonce.d);
>
> ret = crypto_skcipher_encrypt(req);