From: Ondrej Kozina Date: Wed, 2 Nov 2016 14:02:08 +0000 (+0100) Subject: dm crypt: mark key as invalid until properly loaded X-Git-Tag: v3.2.87~179 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c5331971f5c11c77d08ba5bf4c2c9211fb3f0534;p=pandora-kernel.git dm crypt: mark key as invalid until properly loaded commit 265e9098bac02bc5e36cda21fdbad34cb5b2f48d upstream. In crypt_set_key(), if a failure occurs while replacing the old key (e.g. tfm->setkey() fails) the key must not have DM_CRYPT_KEY_VALID flag set. Otherwise, the crypto layer would have an invalid key that still has DM_CRYPT_KEY_VALID flag set. Signed-off-by: Ondrej Kozina Reviewed-by: Mikulas Patocka Signed-off-by: Mike Snitzer Signed-off-by: Ben Hutchings --- Reading git-diff-tree failed