Received: by 10.213.65.68 with SMTP id h4csp929175imn; Sat, 7 Apr 2018 13:00:54 -0700 (PDT) X-Google-Smtp-Source: AIpwx48cNHJ0VMG26TBomU4rwIEMQvqlSfGRhJrsudBnurm1woF2Pn7T0KqgknlAJdqj8TrSnVqw X-Received: by 2002:a17:902:7245:: with SMTP id c5-v6mr32439651pll.217.1523131254087; Sat, 07 Apr 2018 13:00:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523131254; cv=none; d=google.com; s=arc-20160816; b=Oqzx1i1sZj8hTGUjrZcRzeid7F+thrbZhMTe+q3BF2dL6L3FGBR25ud5O4j7Mv5GhJ b6QGv8cQGtIe/VwPDWTg+YsSTllDlgrSAKNp3fACgOBGAVlqHE4UkgJQeqPH13qXS+l7 XHTfYWaK8Gm3bTe+57yL1SIMa8VMraAcSHEHb3mcc3px/kjv+fRwlQhyIkVgAQ+dnoSO K5tMICueHV9Gj6VftxfqnzC2xKoCliO6hB5CRNzG6Xw3EKr/PWabvzbWM/wzd0bBZ621 6Kdk9KVWkkS/9lo9MR/WW44Rmly9AQ8DV6+yibumAiak3IDvTOrd/93pixwHoE3eb/eG Q1YQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :references:in-reply-to:mime-version:dkim-signature:dkim-signature :arc-authentication-results; bh=V4LE1CiTkx9EIvRSlhDpkIZspb3GdA19M9eIGvgx4kI=; b=VBJGir+IkaG77zjvlDYfvn9qpvtYm7+Su3+5kO++5e3/vMHi7cHESw9iS/NyFAEnoO qrNfCT78S/4CdXh8ZhOiVPj+on8mpF17cCF6flepYCDxHcUxyeiwfNzapGCASRfZdox2 RfAKDWQgHKp9Ywp/OSTDC42JUyjBmgDJMBQXpRu1NEEeFOHmv4qyjHOT1/ouq7zfBeRS U7pvudm1YHCeLZkLddk//ZWLUzjcmQTTC4pLxhuHgM2KMkRR+gPCtvIMt9n5uFddE4r6 xwUbHqjXh9z7dGef06b311yfWYUmVXJPR4WAb8Aw7agbkiiCTYgXDkTUrgQFTHspZNnZ UUYw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@google.com header.s=20161025 header.b=euflMiQM; dkim=fail header.i=@chromium.org header.s=google header.b=mXmWn0mg; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 3-v6si11285635plt.98.2018.04.07.12.59.56; Sat, 07 Apr 2018 13:00:54 -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; dkim=fail header.i=@google.com header.s=20161025 header.b=euflMiQM; dkim=fail header.i=@chromium.org header.s=google header.b=mXmWn0mg; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752622AbeDGT4i (ORCPT + 99 others); Sat, 7 Apr 2018 15:56:38 -0400 Received: from mail-ua0-f195.google.com ([209.85.217.195]:46494 "EHLO mail-ua0-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752461AbeDGT4h (ORCPT ); Sat, 7 Apr 2018 15:56:37 -0400 Received: by mail-ua0-f195.google.com with SMTP id a17so2723855uaf.13 for ; Sat, 07 Apr 2018 12:56:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=V4LE1CiTkx9EIvRSlhDpkIZspb3GdA19M9eIGvgx4kI=; b=euflMiQMHsuLOW7++tyBYqxFqWEXitSgSXmSzz6JnIAYFZpMppOc3XXx9c+gYTjY8W Hr3cw1+d/+1d4Tax9HeTdoIJhEyU8BRDvY2D+6FVCgdaN5CsoX+fcrAkzdmNXL7Qg0a/ Xto+8pau+ezOjGR99YgpWqEfWYFHe7qSrcVjggfTJF5AbRoNH/OYTS5Te70eyoKIOMhT SDgc6SYAgcCkX9YVWTgeAxEl6hiJaBabDk2a9XVgwyd06yei0UmwOwxhoOa/TrJMlMyq m/nhHG6ncQtQNNpNQ6OhIryrYHYWFevvK7i604aeMj/7fl06gX/dqn0jipeLevUU2iov UIpA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=V4LE1CiTkx9EIvRSlhDpkIZspb3GdA19M9eIGvgx4kI=; b=mXmWn0mgl7MeAIHR5NfrkQKVFcyayoKUZZLYxm3VKNyttqm11t1WvNgRUXiMwxpOZM 9G4A8CzyMIJRUeEhxEDetrM3/XlIqfo8p5FO+snAb2w/npA5bKrWKk8rdhieBkLIMPFx Pw8siUfzr+CnQ/KlvX0ntFYASQG+PjxSM+e38= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=V4LE1CiTkx9EIvRSlhDpkIZspb3GdA19M9eIGvgx4kI=; b=KYJzX/xpjAEwQLHRvlXX2M0IcU/172DbihkcbqScDMbqvy0Ke9CqMnxsB2Zi+n5lpz X147DdnH4zGz655s8OQ7JtRftB+40ml9WK5CDiwKYadcEevKnJzJV1wBH8HhOfaQoRqM mDLKxa5HlJaO6FP8RQcF1JGohNzMhVAzA87dL4C6k4CCN9vnwGDTN8mym71XtUWd8oq5 Si/YjglawrpILw+Gq/1BqPo91epGMc1kQy0Bapgkm7crNMJ3CLkwPigEnoH08ik1oq8n La8UuQQ4Y3pk6Tehc+4IH0Q5wnCSmiEag5dYMZpSCgLk2EPf91V5jngFpZIEJJBkoZo5 FiKg== X-Gm-Message-State: ALQs6tA5YumWrZ52ZA/Ltm7cTNnuneRWyBTFQVhmTZM+Xa0xPNKlMoCQ ghzmSXOmP+tN2wIeHwVLpjGr8ZxWauI2HJMiNdkARA== X-Received: by 10.176.71.214 with SMTP id w22mr20360222uac.74.1523130996054; Sat, 07 Apr 2018 12:56:36 -0700 (PDT) MIME-Version: 1.0 Received: by 10.31.164.81 with HTTP; Sat, 7 Apr 2018 12:56:34 -0700 (PDT) In-Reply-To: <1523126303-23205-1-git-send-email-s.mesoraca16@gmail.com> References: <1523126303-23205-1-git-send-email-s.mesoraca16@gmail.com> From: Kees Cook Date: Sat, 7 Apr 2018 12:56:34 -0700 X-Google-Sender-Auth: Z6mpNoaWii-96O27GfckO9Pks_A Message-ID: Subject: Re: [PATCH 0/6] Remove several VLAs in the crypto subsystem To: Salvatore Mesoraca Cc: LKML , Kernel Hardening , linux-crypto , "David S. Miller" , Herbert Xu , Eric Biggers , Laura Abbott Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, Apr 7, 2018 at 11:38 AM, Salvatore Mesoraca wrote: > As suggested by Laura Abbott[2], I'm resending my patch with > MAX_BLOCKSIZE and MAX_ALIGNMASK defined in an header, so they > can be used in other places. > I take this opportuinuty to deal with some other VLAs not > handled in the old patch. > > [1] http://lkml.kernel.org/r/CA+55aFzCG-zNmZwX4A2FQpadafLfEzK6CC=qPXydAacU1RqZWA@mail.gmail.com > [2] http://lkml.kernel.org/r/4e536889-439a-49e6-dd95-2d4286913202@redhat.com > > Salvatore Mesoraca (6): > crypto: api - laying macros for statically allocated buffers > crypto: ctr - avoid VLA use > crypto: api - avoid VLA use > crypto: pcbc - avoid VLA use > crypto: cts - avoid VLA use > crypto: cfb - avoid VLA use > > crypto/cfb.c | 14 ++++++++++---- > crypto/cipher.c | 7 ++++++- > crypto/ctr.c | 13 +++++++++++-- > crypto/cts.c | 8 ++++++-- > crypto/internal.h | 8 ++++++++ > crypto/pcbc.c | 9 +++++++-- > 6 files changed, 48 insertions(+), 11 deletions(-) These all look good to me! Thanks for the refactoring. :) Reviewed-by: Kees Cook -Kees -- Kees Cook Pixel Security