From: <gregkh@linuxfoundation.org>
To: okozina@redhat.com, gregkh@linuxfoundation.org, snitzer@redhat.com
Cc: <stable@vger.kernel.org>, <stable-commits@vger.kernel.org>
Subject: Patch "dm crypt: rewrite (wipe) key in crypto layer using random data" has been added to the 4.11-stable tree
Date: Tue, 16 May 2017 12:50:58 +0200 [thread overview]
Message-ID: <149493185848144@kroah.com> (raw)
This is a note to let you know that I've just added the patch titled
dm crypt: rewrite (wipe) key in crypto layer using random data
to the 4.11-stable tree which can be found at:
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary
The filename of the patch is:
dm-crypt-rewrite-wipe-key-in-crypto-layer-using-random-data.patch
and it can be found in the queue-4.11 subdirectory.
If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@vger.kernel.org> know about it.
>From c82feeec9a014b72c4ffea36648cfb6f81cc1b73 Mon Sep 17 00:00:00 2001
From: Ondrej Kozina <okozina@redhat.com>
Date: Mon, 24 Apr 2017 14:21:53 +0200
Subject: dm crypt: rewrite (wipe) key in crypto layer using random data
From: Ondrej Kozina <okozina@redhat.com>
commit c82feeec9a014b72c4ffea36648cfb6f81cc1b73 upstream.
The message "key wipe" used to wipe real key stored in crypto layer by
rewriting it with zeroes. Since commit 28856a9 ("crypto: xts -
consolidate sanity check for keys") this no longer works in FIPS mode
for XTS.
While running in FIPS mode the crypto key part has to differ from the
tweak key.
Fixes: 28856a9 ("crypto: xts - consolidate sanity check for keys")
Signed-off-by: Ondrej Kozina <okozina@redhat.com>
Signed-off-by: Mike Snitzer <snitzer@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/md/dm-crypt.c | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
--- a/drivers/md/dm-crypt.c
+++ b/drivers/md/dm-crypt.c
@@ -1649,12 +1649,16 @@ out:
static int crypt_wipe_key(struct crypt_config *cc)
{
+ int r;
+
clear_bit(DM_CRYPT_KEY_VALID, &cc->flags);
- memset(&cc->key, 0, cc->key_size * sizeof(u8));
+ get_random_bytes(&cc->key, cc->key_size);
kzfree(cc->key_string);
cc->key_string = NULL;
+ r = crypt_setkey(cc);
+ memset(&cc->key, 0, cc->key_size * sizeof(u8));
- return crypt_setkey(cc);
+ return r;
}
static void crypt_dtr(struct dm_target *ti)
Patches currently in stable-queue which might be from okozina@redhat.com are
queue-4.11/dm-crypt-rewrite-wipe-key-in-crypto-layer-using-random-data.patch
reply other threads:[~2017-05-16 10:51 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=149493185848144@kroah.com \
--to=gregkh@linuxfoundation.org \
--cc=okozina@redhat.com \
--cc=snitzer@redhat.com \
--cc=stable-commits@vger.kernel.org \
--cc=stable@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).