From patchwork Tue Sep 4 18:16:27 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kees Cook X-Patchwork-Id: 10587743 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 8C45514E0 for ; Tue, 4 Sep 2018 18:16:44 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 77B312985D for ; Tue, 4 Sep 2018 18:16:44 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6937329C1F; Tue, 4 Sep 2018 18:16:44 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1C5AC2985D for ; Tue, 4 Sep 2018 18:16:44 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727695AbeIDWmv (ORCPT ); Tue, 4 Sep 2018 18:42:51 -0400 Received: from mail-pl1-f196.google.com ([209.85.214.196]:40564 "EHLO mail-pl1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727682AbeIDWmu (ORCPT ); Tue, 4 Sep 2018 18:42:50 -0400 Received: by mail-pl1-f196.google.com with SMTP id s17-v6so2001926plp.7 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=Txgq3p74sbsMt9GUMp2fMCt8B57Dk/derwJlLfeLaOXZP57keSXPJuuk4bUuY3lydv AdKqjGXiB2mt4SOIUNUwrK6wyKZUto5S4mUuy8RcIwDKYK3q6wEansJpv6MTt1swwG7c t1e1O2UIAyz80QG436rArpJj/WSKmUeniKpJ2ACwASjBRBz8uIvXH/pEqcGS9K4ICUMV xThEomBTPqwIZlhN4EZvSm8nj7NTDTEZ4ZUxcpWh1lyWbJP+8W+IYESKoAj0AyboqBAj Ksf335Smc3Sq1zpON5r1taxB+fZWUFPzxLOxahMN9s+Vw+l2whir+V031tuxI8NJkZXy 0a5w== X-Gm-Message-State: APzg51ALgDUfYKWct4f29BW83ctVSRJxFcmNQQtp/HVwLlUz1EdVIdB8 QM9i92ohgyjBOLdpunR6J/kTvA== X-Google-Smtp-Source: ANB0VdavgS5ocT6H+3NEB+OYua214T+VVG9/eA+J9QLvwQca1iUhm6dbqllPqeJdd/yoXlpSt+A/aw== 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-crypto-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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(-)