]> git.baikalelectronics.ru Git - kernel.git/commit
crypto: api - fix finding algorithm currently being tested
authorEric Biggers <ebiggers@google.com>
Mon, 16 Apr 2018 23:59:13 +0000 (16:59 -0700)
committerHerbert Xu <herbert@gondor.apana.org.au>
Fri, 20 Apr 2018 16:24:02 +0000 (00:24 +0800)
commit5dfd05129cf2811c2f69597ca7d017808440b2a1
tree3706f0ba4529609b611134dd688b17804b86b8b1
parentfedbd783dfdfa040524ea8eb8a31cb2a775a133b
crypto: api - fix finding algorithm currently being tested

Commit 777a24414bec ("crypto: api - Keep failed instances alive") is
making allocating crypto transforms sometimes fail with ELIBBAD, when
multiple processes try to access encrypted files with fscrypt for the
first time since boot.  The problem is that the "request larval" for the
algorithm is being mistaken for an algorithm which failed its tests.

Fix it by only returning ELIBBAD for "non-larval" algorithms.  Also
don't leak a reference to the algorithm.

Fixes: 777a24414bec ("crypto: api - Keep failed instances alive")
Signed-off-by: Eric Biggers <ebiggers@google.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
crypto/api.c