]> git.baikalelectronics.ru Git - kernel.git/commit
dm crypt: fix crash by adding missing check for auth key size
authorMilan Broz <gmazyland@gmail.com>
Wed, 3 Jan 2018 21:48:59 +0000 (22:48 +0100)
committerMike Snitzer <snitzer@redhat.com>
Wed, 17 Jan 2018 14:08:41 +0000 (09:08 -0500)
commit79a49636323594c5be5c13a4055a772c6537527f
treeae436f726a28d0e83265bcf34ec9e500658df575
parent5b2351f82ebf86c5575c651c97457c483174a201
dm crypt: fix crash by adding missing check for auth key size

If dm-crypt uses authenticated mode with separate MAC, there are two
concatenated part of the key structure - key(s) for encryption and
authentication key.

Add a missing check for authenticated key length.  If this key length is
smaller than actually provided key, dm-crypt now properly fails instead
of crashing.

Fixes: a4a4270be0 ("dm crypt: add cryptographic data integrity protection (authenticated encryption)")
Cc: stable@vger.kernel.org # 4.12+
Reported-by: Salah Coronya <salahx@yahoo.com>
Signed-off-by: Milan Broz <gmazyland@gmail.com>
Signed-off-by: Mike Snitzer <snitzer@redhat.com>
drivers/md/dm-crypt.c