crypto: user - Fix crypto_alg_match race
authorHerbert Xu <herbert@gondor.apana.org.au>
Tue, 7 Apr 2015 13:27:01 +0000 (21:27 +0800)
committerHerbert Xu <herbert@gondor.apana.org.au>
Wed, 8 Apr 2015 14:20:06 +0000 (22:20 +0800)
The function crypto_alg_match returns an algorithm without taking
any references on it.  This means that the algorithm can be freed
at any time, therefore all users of crypto_alg_match are buggy.

This patch fixes this by taking a reference count on the algorithm
to prevent such races.

Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
crypto/crypto_user.c

Simple merge