mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Stephan Mueller <smueller@chronox.de>
To: "Jason A. Donenfeld" <Jason@zx2c4.com>
Cc: linux-security-module@vger.kernel.org, keyrings@vger.kernel.org,
	kernel-hardening@lists.openwall.com,
	linux-kernel@vger.kernel.org, dhowells@redhat.com,
	ebiggers3@gmail.com, Herbert Xu <herbert@gondor.apana.org.au>,
	Kirill Marinushkin <k.marinushkin@gmail.com>,
	security@kernel.org, stable@vger.kernel.org
Subject: Re: [PATCH v6] security/keys: rewrite all of big_key crypto
Date: Wed, 20 Sep 2017 07:30:56 +0200	[thread overview]
Message-ID: <1593673.B5xods8kYN@tauon.chronox.de> (raw)
In-Reply-To: <20170917115217.15805-1-Jason@zx2c4.com>

Am Sonntag, 17. September 2017, 13:52:17 CEST schrieb Jason A. Donenfeld:

Hi Jason,

>   * Use of ECB mode, allowing an attacker to trivially swap blocks or
>     compare identical plaintext blocks.

The use of GCM with the implementtion here is just as challenging. The 
implementation uses a NULL IV. GCM is a very brittle cipher where the 
construction of the IV is of special importance. SP800-38D section 8.2.1 and 
8.2.2 outlines the generation methods of the IV. A collision of keys/IVs is 
fatal. I understand that keys are generated anew each time which makes that 
issue less critical here. However, as user space may see the ciphertext, GCM 
should simply not be used.

A fix could be as easy as to use CCM or one of the authenc() ciphers. Yet, for 
both I am not sure how a zero IV affects the cipher.

The cipher where you do not need to handle the IV at all would be the RFC3394/
SP800-38F keywrapping cipher which is meant for the encryption of key material 
which includes authentication as well. It is available as an skcipher under 
the name of kw(aes). If you want to use it, please be careful that you obtain 
the generated IV to be stored with the plaintext as documented in the comments 
in crypto/keywrap.c


Ciao
Stephan

  reply	other threads:[~2017-09-20  5:32 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-09-16 13:00 [PATCH v4] " Jason A. Donenfeld
2017-09-16 13:05 ` [PATCH v5] " Jason A. Donenfeld
2017-09-17  6:04   ` Eric Biggers
2017-09-17 11:50     ` Jason A. Donenfeld
2017-09-17 11:52       ` [PATCH v6] " Jason A. Donenfeld
2017-09-20  5:30         ` Stephan Mueller [this message]
2017-09-20 10:52           ` Jason A. Donenfeld
2017-09-20 13:45             ` Stephan Mueller
2017-09-20 14:01               ` Jason A. Donenfeld
2017-09-20 14:06                 ` Stephan Mueller
2017-09-20 14:09                   ` Jason A. Donenfeld
2017-09-19 15:38       ` David Howells
2017-09-20 14:56         ` Jason A. Donenfeld
2017-09-18  8:49 ` [PATCH v4] " Stephan Mueller
2017-09-18  9:04   ` [kernel-hardening] " Greg KH
2017-09-18  9:12     ` Stephan Mueller
2017-09-18 11:24   ` Jason A. Donenfeld
2017-09-19 13:39     ` Theodore Ts'o
2017-09-19 19:04       ` [kernel-hardening] " Sandy Harris
2017-09-19 19:17         ` Jason A. Donenfeld
2017-09-20  1:16         ` Theodore Ts'o

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=1593673.B5xods8kYN@tauon.chronox.de \
    --to=smueller@chronox.de \
    --cc=Jason@zx2c4.com \
    --cc=dhowells@redhat.com \
    --cc=ebiggers3@gmail.com \
    --cc=herbert@gondor.apana.org.au \
    --cc=k.marinushkin@gmail.com \
    --cc=kernel-hardening@lists.openwall.com \
    --cc=keyrings@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-security-module@vger.kernel.org \
    --cc=security@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

all inboxes | Powered by JetHome®