]> git.baikalelectronics.ru Git - kernel.git/commit
crypto: nx - Check for bogus firmware properties
authorHerbert Xu <herbert@gondor.apana.org.au>
Fri, 19 Jun 2015 04:07:54 +0000 (12:07 +0800)
committerHerbert Xu <herbert@gondor.apana.org.au>
Sun, 21 Jun 2015 11:59:21 +0000 (19:59 +0800)
commit6123163bfb49a0866e24f85756509a102bd269b6
tree44e2a1ee6e743fe12e59bf422febb7156a37090a
parent317a543b1ea8430db633774a1a95a269117709b6
crypto: nx - Check for bogus firmware properties

The nx driver reads two crucial paramters from the firmware for
each crypto algorithm, the maximum SG list length and byte limit.
Unfortunately those two parameters may be bogus, or worse they
may be absent altogether.  When this happens the algorithms will
still register successfully but will fail when used or tested.

This patch adds checks to report any firmware entries which are
found to be bogus, and avoid registering algorithms which have
bogus parameters.  A warning is also printed when an algorithm
is not registered because of this as there may have been no firmware
entries for it at all.

Reported-by: Ondrej Moriš <omoris@redhat.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
drivers/crypto/nx/nx.c