Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751813AbdITKw1 (ORCPT ); Wed, 20 Sep 2017 06:52:27 -0400 Received: from frisell.zx2c4.com ([192.95.5.64]:37085 "EHLO frisell.zx2c4.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751497AbdITKwZ (ORCPT ); Wed, 20 Sep 2017 06:52:25 -0400 X-Google-Smtp-Source: AOwi7QAY5au9UwT17/XIRrBToKNXbgXy56o/pHLsaVE2Xs7adSjXD5EVGfIrP94N3/QXGXIcX4M9lpOZwOwFZoHtOG4= MIME-Version: 1.0 In-Reply-To: <1593673.B5xods8kYN@tauon.chronox.de> References: <20170917115217.15805-1-Jason@zx2c4.com> <1593673.B5xods8kYN@tauon.chronox.de> From: "Jason A. Donenfeld" Date: Wed, 20 Sep 2017 12:52:21 +0200 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v6] security/keys: rewrite all of big_key crypto To: Stephan Mueller Cc: linux-security-module@vger.kernel.org, keyrings@vger.kernel.org, kernel-hardening@lists.openwall.com, LKML , David Howells , Eric Biggers , Herbert Xu , Kirill Marinushkin , security@kernel.org, stable@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 976 Lines: 15 On Wed, Sep 20, 2017 at 7:30 AM, Stephan Mueller wrote: > 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. This sounds incorrect to me. Choosing a fresh, random, one-time-use 256-bit key and rolling with a zero nonce is a totally legitimate way of using GCM. There's no possible reuse of the key stream this way. However, on the off chance that you know what you're talking about, could you outline the cryptographic attack you have in mind, or if that's too difficult, simply link to the relevant paper on eprint?