crypto: af_alg - fix possible uninit-value in alg_bind()
commit7b38b6dd316e5359c70fc11df7eb27825d4f3f15
authorEric Dumazet <edumazet@google.com>
Sat, 7 Apr 2018 20:42:36 +0000 (7 13:42 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 16 May 2018 08:08:40 +0000 (16 10:08 +0200)
treed787ab9255b7e3211cbed1594190eb45eda96bd8
parent383250363daf01eb7aa3728c09ef8a4f6d8a3252
crypto: af_alg - fix possible uninit-value in alg_bind()

commit a466856e0b7ab269cdf9461886d007e88ff575b0 upstream.

syzbot reported :

BUG: KMSAN: uninit-value in alg_bind+0xe3/0xd90 crypto/af_alg.c:162

We need to check addr_len before dereferencing sa (or uaddr)

Fixes: bb30b8848c85 ("crypto: af_alg - whitelist mask and type")
Signed-off-by: Eric Dumazet <edumazet@google.com>
Reported-by: syzbot <syzkaller@googlegroups.com>
Cc: Stephan Mueller <smueller@chronox.de>
Cc: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
crypto/af_alg.c