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: 10587749 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 8D78516B1 for ; Tue, 4 Sep 2018 18:17:29 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 78A252985D for ; Tue, 4 Sep 2018 18:17:29 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6C0E829C1F; Tue, 4 Sep 2018 18:17:29 +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=-2.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 0A0862985D for ; Tue, 4 Sep 2018 18:17:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:Message-Id:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To: References:List-Owner; bh=4UI3hPSXHSQQRvVWSY/Lx0nEvz0yA68uStHZUdru9sQ=; b=SoK 62VWIRWzONW9hSfW+1DKtN9XHiBuFxb/PcRKjD5mLzV67BYpCFVs7aDvCUmMc/6/1co6mpz1lKcgx pdA9QqwLRw+Nnyg46UKKLo+s8DdJftUg1e5KXffjVCQuKgquwHOxLYpsRxIx2onpasprAsvo57+zB CCySiDwGvZgxoyI+3g2vgKCqwD7PtYmBLqKDSRGxvGFywmVn4hrI1zJRXSSvoIvxwUmb6HMe9E6jv dvAYDhDSuINwRm04oyCAvkRWu+H49pxUrGFTzRYxlFx1vXuGdYGVjiYOUbETtZHnCuiNbeaJrL36Z +QUw+XMEvXSIT/Yx2Sz2dRz6KE+/d5g==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1fxFt7-0001Aj-V4; Tue, 04 Sep 2018 18:17:17 +0000 Received: from mail-pl1-x644.google.com ([2607:f8b0:4864:20::644]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1fxFsb-0000kC-Sm for linux-arm-kernel@lists.infradead.org; Tue, 04 Sep 2018 18:16:47 +0000 Received: by mail-pl1-x644.google.com with SMTP id u11-v6so2010540plq.5 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=BQ+kkmBH7zZJnwd87sWIstvj8YBmyXrDPiAwSvs6n4QGG688czxGXTD9ceaEyrxyrZ nGzIxkWiHkVNKIsg196kXVMY5fUtTU/f/V70J4VGt+jpaO80duo0cyX5oQSxwUhYjGSl Pk+7qn5hAlmtGOQQr6zvcEXBy9IRY9fdMU+/HarUA5f/ZYKN3ScelD5w1rfHmO2tZMS2 B+JvWn+7PCKJBByw6rp00rLlgS1RaOQLqKX4bKd6f7vVXTWCym7Alo3qrlAZHo03Z2J6 PDOMtoOibUa3QbFRC785RizAu7IGLLrt6OITM7tD8SiTqWqSk4pViybTd1QlynrAE7Ls v/Ag== X-Gm-Message-State: APzg51DDhTtqS55dSzg2tYlOEyMRUr+LLsNO8g+xrP/L5NM0x5ieJMWb xX/M+fOVy84pO6hHq2UgfY/JoQ== 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 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 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180904_111645_954991_DFAF7754 X-CRM114-Status: UNSURE ( 9.50 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Maxime Ripard , Arnaud Ebalard , Kees Cook , Boris Brezillon , Antoine Tenart , Ard Biesheuvel , linux-kernel@vger.kernel.org, Gilad Ben-Yossef , Chen-Yu Tsai , Eric Biggers , linux-crypto@vger.kernel.org, Jonathan Cameron , Philippe Ombredanne , Corentin Labbe , linux-arm-kernel@lists.infradead.org, Christian Lamparter MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.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(-)