crypto: af_alg - whitelist mask and type
authorStephan Mueller <smueller@chronox.de>
Tue, 2 Jan 2018 07:55:25 +0000 (08:55 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 3 Feb 2018 16:04:25 +0000 (17:04 +0100)
commitfba245f4c6351b1d25dd4594f0a092bb7a78cf12
treef91303bbf8623b25c8fdac12c9efafd954c7df79
parent0b69d7f4b5fc1ac0cf49a21139a1384e6d0c934f
crypto: af_alg - whitelist mask and type

commit bb30b8848c85e18ca7e371d0a869e94b3e383bdf upstream.

The user space interface allows specifying the type and mask field used
to allocate the cipher. Only a subset of the possible flags are intended
for user space. Therefore, white-list the allowed flags.

In case the user space caller uses at least one non-allowed flag, EINVAL
is returned.

Reported-by: syzbot <syzkaller@googlegroups.com>
Signed-off-by: Stephan Mueller <smueller@chronox.de>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
crypto/af_alg.c