crypto: af_alg - Initialize sg_num_bytes in error code path
authorStephan Mueller <smueller@chronox.de>
Sat, 7 Jul 2018 18:41:47 +0000 (20:41 +0200)
committerHerbert Xu <herbert@gondor.apana.org.au>
Fri, 13 Jul 2018 10:24:23 +0000 (18:24 +0800)
commit2546da99212f22034aecf279da9c47cbfac6c981
treee7812d62c3febd6ce73707e9442610253e8a774b
parent221e00d1fce976d8a04ff591a0150caf84e176f8
crypto: af_alg - Initialize sg_num_bytes in error code path

The RX SGL in processing is already registered with the RX SGL tracking
list to support proper cleanup. The cleanup code path uses the
sg_num_bytes variable which must therefore be always initialized, even
in the error code path.

Signed-off-by: Stephan Mueller <smueller@chronox.de>
Reported-by: syzbot+9c251bdd09f83b92ba95@syzkaller.appspotmail.com
#syz test: https://github.com/google/kmsan.git master
CC: <stable@vger.kernel.org> #4.14
Fixes: e870456d8e7c ("crypto: algif_skcipher - overhaul memory management")
Fixes: d887c52d6ae4 ("crypto: algif_aead - overhaul memory management")
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
crypto/af_alg.c