]> www.infradead.org Git - users/jedix/linux-maple.git/commit
crypto: testmgr - fix out of bound read in __test_aead()
authorJerome Marchand <jmarchan@redhat.com>
Wed, 3 Feb 2016 12:58:12 +0000 (13:58 +0100)
committerChuck Anderson <chuck.anderson@oracle.com>
Sun, 26 Feb 2017 05:34:22 +0000 (21:34 -0800)
commitb824b1aa827f235182986f2aead48b69802b83bc
tree21ec83e56a5644e0d922d4cf2520850d76aa53b8
parent4890b27f8143bb8135c3cd89482d14d94b0026f2
crypto: testmgr - fix out of bound read in __test_aead()

Orabug: 25243093

__test_aead() reads MAX_IVLEN bytes from template[i].iv, but the
actual length of the initialisation vector can be shorter.
The length of the IV is already calculated earlier in the
function. Let's just reuses that. Also the IV length is currently
calculated several time for no reason. Let's fix that too.
This fix an out-of-bound error detected by KASan.

Signed-off-by: Jerome Marchand <jmarchan@redhat.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
(cherry picked from commit abfa7f4357e3640fdee87dfc276fd0f379fb5ae6)
Signed-off-by: Ethan Zhao <ethan.zhao@oracle.com>
crypto/testmgr.c