From patchwork Fri Jun 23 08:54:30 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Raveendra Padasalagi X-Patchwork-Id: 9805951 X-Patchwork-Delegate: herbert@gondor.apana.org.au Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id F15756086C for ; Fri, 23 Jun 2017 08:55:02 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E36DB2872A for ; Fri, 23 Jun 2017 08:55:02 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D719E2872F; Fri, 23 Jun 2017 08:55:02 +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=-7.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, 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 7B80A2872A for ; Fri, 23 Jun 2017 08:55:02 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754361AbdFWIyx (ORCPT ); Fri, 23 Jun 2017 04:54:53 -0400 Received: from mail-wr0-f171.google.com ([209.85.128.171]:35532 "EHLO mail-wr0-f171.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754353AbdFWIyu (ORCPT ); Fri, 23 Jun 2017 04:54:50 -0400 Received: by mail-wr0-f171.google.com with SMTP id k67so56116235wrc.2 for ; Fri, 23 Jun 2017 01:54:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadcom.com; s=google; h=from:to:cc:subject:date:message-id; bh=l+MCEtDvvFNXxVh/s10eStz38nDRaloHkwhqsOOlbbI=; b=Ve40E00nKSrouFdEicfH//OrilZPnD+U3Ek4tEMox/lVg1CkdY1kQP4uBYJwjWOIF2 hXSkHkekzTqqVcVsFXi831MMPocj4ueydPrd3QoXwyridemNJeUHQpS4vukJ5TlnAs1K wNIJBFIvl+lto7rK/FF1FdOszxTkTR5l+VyPk= 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=l+MCEtDvvFNXxVh/s10eStz38nDRaloHkwhqsOOlbbI=; b=gOH8qT/YVcWQT/0FZ9PE+KOctRbpDZtgXEvfNdyReGAf54Dg0mj/bLFDua4O3+QlM1 ygwE2oraRGiY2F51uUMP2B6nSm5r7TI+Lgj8iR/6VlkLfz4nl1cH/f/0oMDDopwhXfOW S/F24XPH5SJ+6DWe4lLtuVZJg3TS910tUkc1iDKu7NMSjZPNhjR0xLFsAvYglFS9rfND F8i/Ko4U3SgKkIKl2TlWuvA8NzvGPobpsMAIwQbCuyR18THDjg3hoH+r4kv7GBAw3jgm y/Q2WRPPb6gOJwGu5KEQRQxiA7AOOT75/Pb4LLZuxZ5pZ2lDSZ4ew9iZdDODZX7Oz/iX E5cQ== X-Gm-Message-State: AKS2vOwutU63xk35S8SIOP8RjRGZPMqLobHaEutjr/PFHbpBgZcsNWB3 O3D7Ws86GNdvBjHu X-Received: by 10.223.131.66 with SMTP id 60mr5266805wrd.54.1498208089406; Fri, 23 Jun 2017 01:54:49 -0700 (PDT) Received: from rpadasal-OptiPlex-7010.dhcp.avagotech.net ([192.19.237.250]) by smtp.gmail.com with ESMTPSA id z194sm2820393wmc.31.2017.06.23.01.54.43 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 23 Jun 2017 01:54:48 -0700 (PDT) From: Raveendra Padasalagi To: Herbert Xu , "David S. Miller" , Rob Rice , Scott Branden , Ray Jui , Steve Lin , linux-crypto@vger.kernel.org Cc: bcm-kernel-feedback-list@broadcom.com, linux-kernel@vger.kernel.org, stable@vger.kernel.org, Raveendra Padasalagi Subject: [PATCH v1] crypto: brcm - software fallback for cryptlen zero Date: Fri, 23 Jun 2017 14:24:30 +0530 Message-Id: <1498208070-15584-1-git-send-email-raveendra.padasalagi@broadcom.com> X-Mailer: git-send-email 1.9.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 Zero length payload requests are not handled in Broadcom SPU2 engine, so this patch adds conditional check to fallback to software implementation for AES-GCM and AES-CCM algorithms. Fixes: 9d12ba86f818 ("crypto: brcm - Add Broadcom SPU driver") Signed-off-by: Raveendra Padasalagi Reviewed-by: Ray Jui Reviewed-by: Scott Branden Cc: stable@vger.kernel.org --- Changes in v1: - Added Cc tag in the Signed-off area to send the patch to stable kernel drivers/crypto/bcm/cipher.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/crypto/bcm/cipher.c b/drivers/crypto/bcm/cipher.c index cc0d5b9..6c80863 100644 --- a/drivers/crypto/bcm/cipher.c +++ b/drivers/crypto/bcm/cipher.c @@ -2625,7 +2625,7 @@ static int aead_need_fallback(struct aead_request *req) */ if (((ctx->cipher.mode == CIPHER_MODE_GCM) || (ctx->cipher.mode == CIPHER_MODE_CCM)) && - (req->assoclen == 0)) { + ((req->assoclen == 0) || (req->cryptlen == 0))) { if ((rctx->is_encrypt && (req->cryptlen == 0)) || (!rctx->is_encrypt && (req->cryptlen == ctx->digestsize))) { flow_log("AES GCM/CCM needs fallback for 0 len req\n");