Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp2870481imm; Tue, 4 Sep 2018 11:18:00 -0700 (PDT) X-Google-Smtp-Source: ANB0VdZT8VS5pLfJe9rB+cG9WVaZ2xmTPxiYVJp0Xgaq9fIThX/fm7KN71xxOK8s8X7ILg/3g8Zc X-Received: by 2002:a62:280a:: with SMTP id o10-v6mr35917879pfo.129.1536085079951; Tue, 04 Sep 2018 11:17:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1536085079; cv=none; d=google.com; s=arc-20160816; b=R9qTdZZNOcYxS4w997jOmhVwE5MswrRhgO0KpkDXPruJxZk2lI4W8LoFjrEkfEWSO9 YLBmD6rhhmg+Bkszyoedd1bjmCQxzoIgJdCwm2sbwmnPwX1bRaObuTORC3wb/+cVxuyz qF7I8+lbTeaLtjoxcjhOyrFeEBI/4e2FA81dv0QmgWw1OAvJGY61DBrjrMNgu4G5Z/pY ZFpxS8N2XDksf48dINPbUIVEmVTiFt8fu2xSAuebshiob1F2s3WrdkwOmx3WKTlTbAWj hoqA+uxqQevnKN/zRpWDJuOtynZn+f/LcMGQj3aauKYnlunvTZUnl+vytCNk0EN8jdgb vzVQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature:arc-authentication-results; bh=kBZ5Nc08uuOZ1+ex7PLIdfqPnNSMA5EyZHFudIbyO4A=; b=gQkwUnuTyQplC0LbJ/GrgrRqCNQRVtdNRNtKn+zs3nyuwzpjOZXDN7DQ+ZdwvsqI8R b2sWGvQ5gVqejVU4/d6IIirH016qQIg1AvIUosumpxBebWBHS4eHOBCFAlqGBvszK30u gLmDYVb5nKL2YK6+zGInhC1DcRDepLpKAktpyrwO+xhjxIv11wCIaxo39C0xcjutYBo0 zFyWBEoJ/QNHjWBS8kqn4BrszrdCeGxOhQovkbsexAeiB/FmEyix7ZTwPnOtInQEuWDX fZ8Pmax9nIVhS+IVE2LzubTdtBVoD+r4+Aj5dMvDM6T3DaYHeLPgdMfgb/sxP4nH1wGs 6vlQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=kjkifWd4; 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=pass (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 y5-v6si19669882pll.89.2018.09.04.11.17.43; Tue, 04 Sep 2018 11:17:59 -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=pass header.i=@chromium.org header.s=google header.b=kjkifWd4; 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=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727770AbeIDWmw (ORCPT + 99 others); Tue, 4 Sep 2018 18:42:52 -0400 Received: from mail-pl1-f195.google.com ([209.85.214.195]:43099 "EHLO mail-pl1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727688AbeIDWmv (ORCPT ); Tue, 4 Sep 2018 18:42:51 -0400 Received: by mail-pl1-f195.google.com with SMTP id x6-v6so2000178plv.10 for ; Tue, 04 Sep 2018 11:16:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id; bh=kBZ5Nc08uuOZ1+ex7PLIdfqPnNSMA5EyZHFudIbyO4A=; b=kjkifWd4UBgW+U8+Iup6H/H9VifYogpOmP3ntRKpVgiuXfNXLeiDQx5x+v2krl+lgU FBnfpBqverfFLePWSZYSNUgxCSvEtJMO3TLprvVPzEjE48cLmk5Ez/Cqu2qGPOdVWiCg lYMsqEuFmiTjwGC/2IbLUbjCbalM0/jaYIqYI= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=kBZ5Nc08uuOZ1+ex7PLIdfqPnNSMA5EyZHFudIbyO4A=; b=R6ije8l7jelMIzZNN87tWwPofqQcrN2oEIQ50zVSMZqaCTAW4YqE6e8Fz0Q/TxV/u5 DzZuTkXmNhV3Ec2WsiOxQggbQtFF55si3WRMthYDtX2HBo0nPQBLaaL/rZWa27ysbCPB jz2jVFRNmh/naaqUEGyLaxmNx8dj5HKr5V++6pGjxLzD0QJzUJdBVmkmG+J3Dh6sNjfg ml6EJYNmc/IhFawGOAA3mAnImel8qLsC1/JE/2m8uta5byxju771HacWaQOafOg6LYKL Wdy9BJswxuySBMOLWgaW/IQcg3yTiqRWG+kwaCE5+JjcUewBITlLaEJ6aVT0/+Njz6S/ mXXQ== X-Gm-Message-State: APzg51Afi8KkfxGTC5W6lejbQZPqapAAlW/tJURGzMzgMXAL3eumtofC 2X9uUvv0M5oHo8nIn1gHKXTDdg== X-Received: by 2002:a17:902:904c:: with SMTP id w12-v6mr34900947plz.95.1536084994987; Tue, 04 Sep 2018 11:16:34 -0700 (PDT) Received: from www.outflux.net (173-164-112-133-Oregon.hfc.comcastbusiness.net. [173.164.112.133]) by smtp.gmail.com with ESMTPSA id p19-v6sm30484529pgh.60.2018.09.04.11.16.32 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 04 Sep 2018 11:16:32 -0700 (PDT) From: Kees Cook To: Herbert Xu Cc: Kees Cook , Eric Biggers , Ard Biesheuvel , Gilad Ben-Yossef , Antoine Tenart , Boris Brezillon , Arnaud Ebalard , Corentin Labbe , Maxime Ripard , Chen-Yu Tsai , Christian Lamparter , Philippe Ombredanne , Jonathan Cameron , linux-crypto@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: [PATCH 0/2] crypto: Remove VLA usage from skcipher Date: Tue, 4 Sep 2018 11:16:27 -0700 Message-Id: <20180904181629.20712-1-keescook@chromium.org> X-Mailer: git-send-email 2.17.1 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This removes VLAs[1] from SKCIPHER_REQUEST_ON_STACK by making it possible for crypto_skcipher_set_reqsize() to fail. Callers are updated to handle the error condition. -Kees [1] https://lkml.kernel.org/r/CA+55aFzCG-zNmZwX4A2FQpadafLfEzK6CC=qPXydAacU1RqZWA@mail.gmail.com Kees Cook (2): crypto: skcipher: Allow crypto_skcipher_set_reqsize() to fail crypto: skcipher: Remove VLA usage for SKCIPHER_REQUEST_ON_STACK crypto/cryptd.c | 7 +++++-- crypto/ctr.c | 7 +++++-- crypto/cts.c | 7 +++++-- crypto/lrw.c | 9 ++++++--- crypto/simd.c | 7 +++++-- crypto/xts.c | 11 ++++++++--- drivers/crypto/amcc/crypto4xx_core.c | 8 +++++++- drivers/crypto/cavium/nitrox/nitrox_algs.c | 9 +++++++-- drivers/crypto/ccree/cc_cipher.c | 6 ++++-- drivers/crypto/hisilicon/sec/sec_algs.c | 5 ++++- drivers/crypto/inside-secure/safexcel_cipher.c | 5 ++++- drivers/crypto/marvell/cipher.c | 4 +--- drivers/crypto/sunxi-ss/sun4i-ss-cipher.c | 4 +--- include/crypto/internal/skcipher.h | 7 ++++++- include/crypto/skcipher.h | 4 +++- 15 files changed, 71 insertions(+), 29 deletions(-) -- 2.17.1