Received: by 10.192.165.148 with SMTP id m20csp268287imm; Wed, 9 May 2018 12:20:45 -0700 (PDT) X-Google-Smtp-Source: AB8JxZqe+ZbQuEn+GnnQpSBTqbkB5DOi92bX1imRBteJ1M9xZ5Mvx7Ki/iEzuvOyoDaGvoDNERJL X-Received: by 2002:a17:902:8a95:: with SMTP id p21-v6mr28122441plo.325.1525893645643; Wed, 09 May 2018 12:20:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1525893645; cv=none; d=google.com; s=arc-20160816; b=PJOzKStG/BLgV7XOMx4M/MXwni6kPV5Ip8xG2QubR9/eo2yGHHzXpspdQR64fA9Yfo aIZPpbmaFIi86oRvKe0WeZbMA+Dbpz4+tnfr98EjG0AK9lZH19R2nnEnuqMXao9xLIor fSwY2fwsqwGuazf3T+v2iASNugkl/YGH3Q0gwFcu/FU3DQ9vjuM6XpKUEgtPWb3hbQke jgEN8uhN7/POvEvkdAwVDoKEhk15pn4+SEP2NEagAsZO2iAQCiEBiX7QZ3/41M9f+32x 29Upi80n9BazKYs7Q6gSHtjR5uiw9z/P9Svd5X37g3Xg/VfwfixExNDWgRqpzFm6UpKF ut5A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :message-id:in-reply-to:subject:cc:to:from:date :arc-authentication-results; bh=wUbb1pOD2mqOTnfOl8SeAEdW3vx3tmnb5L5JmfpvtFQ=; b=L+3L/WqvJXgwOGYRZVb56ZpzL4lq75QA2gCdQizr3Tijdm/mysTVNAK2y8oC68uga1 VGrSymKPM6qoUD+IgUnazI5Sq7bHUpFcBuoe2KDARmNcfVPRNWiraE924pl98kCU6mcr nhxg92X9mgtTmWoSWH5cdpGndXgF5Nlw8HYrsoc6pZAmAoaMvjMxqvAArDhMTVyuNXLT T8lrDY7m8N/TL9IyN/k4eUtrQgbTBEkjxaons062UX8+tgi5lLOra25+93EnRgMPmBDw HvlQuMPrpCzIheCcl/djC6H6GUt+QrSIvMdR+EGk3yrhdJVQMqFxIJjEo13uGccbIwrA wBEA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a100-v6si27017796pli.588.2018.05.09.12.20.30; Wed, 09 May 2018 12:20:45 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S965336AbeEITTy (ORCPT + 99 others); Wed, 9 May 2018 15:19:54 -0400 Received: from namei.org ([65.99.196.166]:59956 "EHLO namei.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S965017AbeEITTw (ORCPT ); Wed, 9 May 2018 15:19:52 -0400 Received: from localhost (localhost [127.0.0.1]) by namei.org (8.14.4/8.14.4) with ESMTP id w49JJVgJ014014; Wed, 9 May 2018 19:19:31 GMT Date: Thu, 10 May 2018 05:19:31 +1000 (AEST) From: James Morris To: Kees Cook cc: Tycho Andersen , David Howells , keyrings@vger.kernel.org, linux-security-module , LKML , Kernel Hardening , "Serge E. Hallyn" , "Jason A . Donenfeld" , Eric Biggers Subject: Re: [PATCH v3 1/3] big key: get rid of stack array allocation In-Reply-To: Message-ID: References: <20180424202639.19830-1-tycho@tycho.ws> User-Agent: Alpine 2.21 (LRH 202 2017-01-01) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 8 May 2018, Kees Cook wrote: > On Tue, Apr 24, 2018 at 1:26 PM, Tycho Andersen wrote: > > We're interested in getting rid of all of the stack allocated arrays in the > > kernel [1]. This patch simply hardcodes the iv length to match that of the > > hardcoded cipher. > > > > [1]: https://lkml.org/lkml/2018/3/7/621 > > > > v2: hardcode the length of the nonce to be the GCM AES IV length, and do a > > sanity check in init(), Eric Biggers > > v3: * remember to free big_key_aead when sanity check fails > > * define a constant for big key IV size so it can be changed along side > > the algorithm in the code > > > > Signed-off-by: Tycho Andersen > > CC: David Howells > > CC: James Morris > > CC: "Serge E. Hallyn" > > CC: Jason A. Donenfeld > > CC: Eric Biggers > > Please consider this and patches 2 and 3: > > Reviewed-by: Kees Cook > > James, are these something you can take into your tree? > > Thanks! > > -Kees > > > --- > > security/keys/big_key.c | 11 ++++++++++- > > 1 file changed, 10 insertions(+), 1 deletion(-) > > > > diff --git a/security/keys/big_key.c b/security/keys/big_key.c > > index 933623784ccd..2806e70d7f8f 100644 > > --- a/security/keys/big_key.c > > +++ b/security/keys/big_key.c > > @@ -22,6 +22,7 @@ > > #include > > #include > > #include > > +#include > > > > struct big_key_buf { > > unsigned int nr_pages; > > @@ -85,6 +86,7 @@ struct key_type key_type_big_key = { Sure! -- James Morris