Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp2367852pxa; Fri, 7 Aug 2020 09:24:44 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzcOqz/+poIssfW0eiizTK/MdYTuShCYBbMkFVxCkQfzw2NEz1fCH70g7T2HDVyXZXu0yZy X-Received: by 2002:a17:906:7f05:: with SMTP id d5mr9878620ejr.122.1596817484563; Fri, 07 Aug 2020 09:24:44 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1596817484; cv=pass; d=google.com; s=arc-20160816; b=js7HC9PMT5mJ9Pus1iRh1w+a/buXjwuP0mDaJqnRIoL5Af09MV977wx8a6Avbw1eLh Cov8v65Ja3hN1MJB1rUQfJo/SqVwG1bgvWSSNLRgSGmX7zbmAEiOQRkIzLUnYrPFcDJO /6Gc4P1iwzzbonwHtyq/GDaRTseTvBnH/MDEN93ypoUJnZKdlAPYC5JWilRdmD8qy27f MFWzaVm3X2PB6adbCiYEDuvYkcrp1iqz6GlY9iS2Wvn5w8qgTV1huvjDXYfPM7F7QXnr M3wVW2KhTmtp26sDsfMJbODeAza3eYWKgb+D6WHD5DLJintYFDRBDpbwJmKR3Vcm2Hxk 86OA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature; bh=L7FjjUWWehnnDflGEiGda3DXaSAdif7NU6dr7Lr/AJk=; b=i1inIIrzMJC9aMKlg9lCpKNla5IzQxduhckEkI0UZlIKGIkAGzidKeoFH3D09mDBlt /z3nu810JBJ3ZDvpBDyOiz12LhDFdaLt7+Mlh874paUQqF7yrCwcY/4GQJMrl0V7VAut 595TPZyEtpwM10uKbfwstvYsrsXBM8ZnwJr3iPvosIQMx+BWOo9eXf2WG/zJzylOYjtb TJMXdnLhMJpV0g0yyzB85raQdzxHeU735g3/6lzkYVHpnHB/2lNLj01sN4H5rzeqs8kr baftZuJvfVtkYTv+D2NPu/IJb2Ljj0CwN2nl6AgjAvAi3r5xqjsvBPSOWjVt82lxnBF3 7UeA== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@NXP1.onmicrosoft.com header.s=selector2-NXP1-onmicrosoft-com header.b=Cd0dPLXi; arc=pass (i=1 spf=pass spfdomain=oss.nxp.com dkim=pass dkdomain=oss.nxp.com dmarc=pass fromdomain=oss.nxp.com); spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id c18si5502289edr.134.2020.08.07.09.24.21; Fri, 07 Aug 2020 09:24:44 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@NXP1.onmicrosoft.com header.s=selector2-NXP1-onmicrosoft-com header.b=Cd0dPLXi; arc=pass (i=1 spf=pass spfdomain=oss.nxp.com dkim=pass dkdomain=oss.nxp.com dmarc=pass fromdomain=oss.nxp.com); spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727028AbgHGQWZ (ORCPT + 99 others); Fri, 7 Aug 2020 12:22:25 -0400 Received: from mail-eopbgr140070.outbound.protection.outlook.com ([40.107.14.70]:64918 "EHLO EUR01-VE1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726970AbgHGQWR (ORCPT ); Fri, 7 Aug 2020 12:22:17 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=fm6dviwwAf2PjOB+mj1d9s6J1T86JrwHmg9/mC8lNdxFIvh+L9YOAght/wlNtDiWzHRutdlGoQKi9kheE7s12hdv+JNRRhnTVUPv2DzRPqn4kErCS573HRK8/9Od7CNswrucK7/TPjDQibiddOnhQw/ENdyKYansUHmCf85LDMyM78c9SXcw32PLaT7WLTZSRq1sEFVzP3iIvoeOZNEZ7SaAVyZuARMUyA4/aYEzGRIL8qlELaV+3d/LCnBPRV7m6pmcp7cCLRhbO82Rw4kvr1kWWeA0y/3TYCL/iDeeAb4roWZ07BklEZEq1KCQRx5DTBURQnYyiRLJKS4oSq7OZg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=L7FjjUWWehnnDflGEiGda3DXaSAdif7NU6dr7Lr/AJk=; b=BggAoPc1XhHVXPOWhS/DXxmbWZLWRZewKNFM7crWGdxOU0kSvt9VEoSXhBL2WBOU4dyZfHNRBCNgbVQhcvM+owrnlj2f57ImhyJBLYcl4L6Zm42uX1J18jo5B0MHblUjOREIaDivl3vyh7kQVwzatTrgWULgjzun/4DfYwnit/kdO2NbUAyR/eWVINqN3cNNC59wh8XLNAil/4pxCDuABtxgg3ys1M7uJW7sVf7OfhvMWbp0oKIIFu0LU70zLVo0y34iwDpn4PwcTXN30F8+Uu5E4ikU2FgeyHnfZWLMy90+aZ0WS0sdU/Ez6MHsGvDYgKUes1PFZeRm2uhIHGwasg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oss.nxp.com; dmarc=pass action=none header.from=oss.nxp.com; dkim=pass header.d=oss.nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=NXP1.onmicrosoft.com; s=selector2-NXP1-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=L7FjjUWWehnnDflGEiGda3DXaSAdif7NU6dr7Lr/AJk=; b=Cd0dPLXigtW0eK7CVynIeYSAV5ePimIL3dnWJ6ICBpKffXbkmfoj3H3zZMnBMpt5Wn5B/UUm9FgqRjkHkSkYxv80AsT3ibK2flWZT2cuLLH9vjKgJOA7AgKkG41IfEy4EKPhRIB+h/7JeHrM5bLyy9LCvteHSDSR3YO2Ct0V8wU= Authentication-Results: gondor.apana.org.au; dkim=none (message not signed) header.d=none;gondor.apana.org.au; dmarc=none action=none header.from=oss.nxp.com; Received: from VE1PR04MB6608.eurprd04.prod.outlook.com (2603:10a6:803:125::12) by VE1PR04MB7359.eurprd04.prod.outlook.com (2603:10a6:800:1a0::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3261.18; Fri, 7 Aug 2020 16:22:04 +0000 Received: from VE1PR04MB6608.eurprd04.prod.outlook.com ([fe80::a856:c104:11c7:258d]) by VE1PR04MB6608.eurprd04.prod.outlook.com ([fe80::a856:c104:11c7:258d%6]) with mapi id 15.20.3261.019; Fri, 7 Aug 2020 16:22:04 +0000 From: Andrei Botila To: Herbert Xu , "David S. Miller" Cc: linux-crypto@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, linux-s390@vger.kernel.org, x86@kernel.org, linux-arm-kernel@axis.com, Andrei Botila , Zhang Shengju , Tang Bin Subject: [PATCH 12/22] crypto: bcm - add check for xts input length equal to zero Date: Fri, 7 Aug 2020 19:20:00 +0300 Message-Id: <20200807162010.18979-13-andrei.botila@oss.nxp.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200807162010.18979-1-andrei.botila@oss.nxp.com> References: <20200807162010.18979-1-andrei.botila@oss.nxp.com> Content-Type: text/plain X-ClientProxiedBy: AM0PR04CA0075.eurprd04.prod.outlook.com (2603:10a6:208:be::16) To VE1PR04MB6608.eurprd04.prod.outlook.com (2603:10a6:803:125::12) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from lsv15007.swis.ro-buh01.nxp.com (83.217.231.2) by AM0PR04CA0075.eurprd04.prod.outlook.com (2603:10a6:208:be::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3261.15 via Frontend Transport; Fri, 7 Aug 2020 16:22:03 +0000 X-Mailer: git-send-email 2.17.1 X-Originating-IP: [83.217.231.2] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: bcd8064f-e894-43b4-82e5-08d83aee05ae X-MS-TrafficTypeDiagnostic: VE1PR04MB7359: X-MS-Exchange-SharedMailbox-RoutingAgent-Processed: True X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:5797; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: GYKwBFf/wr0EZZ4HND7bVGK/8n88Ut2NxifFN3OIzcItBnreE3+9t3JML2rJfvX477CHf/l0Z4rsojXnfBmOh0V8xYaSpJZyNMvAI96lXfhkBQMBHJ7GWueWs5nN9XE5uEGafByn7tSalgnq97M4CkcSBvlUC3ksbpgpdDlG4X/sP6U8vAvSR5p1N/Vl8CNN9+kJUslKE+g1WUjpHReUnAsOM/RJ09vzq4BlwYSVCl9EM/mbUKm0fPjRkvZa+w/Bk1jW5jf1pwmxmcH0l2TlPgRKiA6cYqP5F/cmrzjyU4DKk3Cs8rsVwYV++qSvlWSKibbfP28xxTP+R7IzC//3SQ== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:VE1PR04MB6608.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFTY:;SFS:(4636009)(39860400002)(366004)(136003)(346002)(396003)(376002)(44832011)(66556008)(66476007)(110136005)(7416002)(54906003)(1076003)(6506007)(4326008)(66946007)(83380400001)(8936002)(316002)(26005)(956004)(186003)(16526019)(478600001)(4744005)(86362001)(5660300002)(6512007)(2906002)(8676002)(2616005)(52116002)(6486002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData: hdHLo9wY47r5JM2hO7BQ4IakkKwJxVz8OsWlwFyjcMwE9euD8IN8jQSckfVi9S/vxU0G9vKujh+3YaOC9Q3I0wDb7+7eC/U4t6eh5I5s0Hu4JHUU6fAYiRDutsd0rsbwPIflf6M6qOyuDqQL/RTZ0J80xTd8tyapvTQA8/6rXIQ8SoNxYNz1v/SXtxX5UY7RCKhvSAuuSCgW7ngrrRhfhzKLLEL3M5q9w5UrePlnz0yyd9MpKOnCwQN3zQ3cMEhg6S5sE8Htxsp3tDoiuN4nlW2AIzG0meWjslgRSdu4bBYLAriGzaxSVzNNFD317uvFtjd50Ja8RQ7rI+XgDa5RtDrXH1ia4qPMS+eclYQNubsbsQMiAwtsfLHAHyVovzYntPIyPTpttdr0a0NyJm4OgWK4YH7tTWFdKkD5ljR3U6EFR7DxCSHp9em6Eji9Bm97qSaKJ15PliU1O6GK4LbLLT71mZIfN3c4gXahtXVqBMRvGieKaDfe73Fw+6MSxbzw+zs9g10ZT8mkfPBbfdS1T9q0ewSh9h9qij+UgSVcSQFNP2qhxf7XA3IijdfmFbsQfTs1RoYnT1F2MY9XqyNwyYbIHdKCsP+rlif+Ha0m8Ca0WirXsTi/Hai9as7V7kfOeaTaUxe8oO1RrTmpsBfnAQ== X-OriginatorOrg: oss.nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: bcd8064f-e894-43b4-82e5-08d83aee05ae X-MS-Exchange-CrossTenant-AuthSource: VE1PR04MB6608.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Aug 2020 16:22:04.7314 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: x5IyhQrkTWoKKjiYoM0xUQxeYOlUNCmuVcwXU6x1yA7JJ+M0X6hWnRA5vN/idIYliipCPuA8GsGJydlVWIspVQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VE1PR04MB7359 Sender: linux-crypto-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org From: Andrei Botila Standardize the way input lengths equal to 0 are handled in all skcipher algorithms. All the algorithms return 0 for input lengths equal to zero. Cc: Zhang Shengju Cc: Tang Bin Signed-off-by: Andrei Botila --- drivers/crypto/bcm/cipher.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/crypto/bcm/cipher.c b/drivers/crypto/bcm/cipher.c index 8a7fa1ae1ade..8a6f225f4db7 100644 --- a/drivers/crypto/bcm/cipher.c +++ b/drivers/crypto/bcm/cipher.c @@ -1754,6 +1754,9 @@ static int skcipher_enqueue(struct skcipher_request *req, bool encrypt) crypto_skcipher_ctx(crypto_skcipher_reqtfm(req)); int err; + if (!req->cryptlen && ctx->cipher.mode == CIPHER_MODE_XTS) + return 0; + flow_log("%s() enc:%u\n", __func__, encrypt); rctx->gfp = (req->base.flags & (CRYPTO_TFM_REQ_MAY_BACKLOG | -- 2.17.1