Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp2366887pxa; Fri, 7 Aug 2020 09:23:28 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy2XHBe/7vjW+OWtBYwPwiBx/TTeZ7G4UdyfCq8sz26ar2eaAzRRq9qIqouvqqQmyVd8JtX X-Received: by 2002:a17:906:d8ca:: with SMTP id re10mr9728588ejb.382.1596817408651; Fri, 07 Aug 2020 09:23:28 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1596817408; cv=pass; d=google.com; s=arc-20160816; b=rfkhTT9GhLuEsvP7txe/W9Rz9wIoUGJ0oN2GZGeveol2xGW+HtGaTeKF8jlsOfmz7v v2Hy7E+x04pBsO2uBnRQplz+KWTAI7Ao8b0k9nC1f8An5JkijB1a/ExyyeTF0I5RRP4r kcLGwF1a1Jrzxd9QYWZyUtvbqdnk3d/y/xX8kmVo3RwaVTQuR8JTjTFa4pZskJwx2p0E R/MVe6WH6mu2wV5z8qDUNKX5pgQayEEBckzdYEvcIR8Z3+bjZWRkEtymHZ53K+aikTBF 0TzISUBTJwyMe2m2mVd12gETcGnpS9ZDPsxGfUDL1cDSm8Yl09/C1EUZfirPHVfx5lHD yiJw== 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=nrZKNq9DZSJg/8lM9Akg9mQ7matGo6hu9ue2IJwmlwg=; b=XtDhHsJAxMW7ZT5Om5CZWnNvUr12Ln5YImodrdqbB3dFKsg2VNInh2/g8eUnNaeVN6 X++1Cl4+efy6fiz8LURIT7Fa8tqry+X/IF9/zD/gq/EUmBl13h6KmirZEiq83XdHoPxh GLIwzkMRv1F21Dk/ApYl+pXSLn4NrgU7P9TkoqPyOUGxy4nt+7Koq2oGxbV9VQHTcUHF T4FrF4QNG3V0rgw5ZID/OInROmMRvXvracsv6n/L5ekLyJYF6IWijyXHeL7f3Y9gH/8M 5mwNpj0vHHPQ5vsC2mbZUEZ5RB6krm2e4BNgXLthK2cgprsMQYEhg1kvf7uSWZ/T3uww nIMw== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@NXP1.onmicrosoft.com header.s=selector2-NXP1-onmicrosoft-com header.b=csn46IjW; 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 a13si5374985edy.381.2020.08.07.09.23.04; Fri, 07 Aug 2020 09:23:28 -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=csn46IjW; 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 S1727044AbgHGQW1 (ORCPT + 99 others); Fri, 7 Aug 2020 12:22:27 -0400 Received: from mail-eopbgr140057.outbound.protection.outlook.com ([40.107.14.57]:4231 "EHLO EUR01-VE1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726929AbgHGQWI (ORCPT ); Fri, 7 Aug 2020 12:22:08 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Uj+bl0hWv38k+Ko7q3PtXnFHFlTM+6Pi/3rGdH3EgRnU7mWYcQ4xwhxZ7idaJUoUntO8kQet4j8LnqF1YnuudvP1pYxm04xHFpvwhByXeuaMi6MvXcDLU+YjI1QycwHHGZ0eSp/uds0WZYbl2dsvZcvuajItrIAhZrTXwOPu+Vcr/QBA0h3ATiG2ywJOtesBWPMdSx4gHaUkMcp1mbAncpFB9kFqjtFFP6fzIOia4y4EnFccK9GQpphOJXQnBBvdFJtcrz9yikg3AjgD8uDiHBFWg7cCyqoKaTqZ9ZoLIV/0bEECKniy8PCDPEZR9SSunTUzA9hXl44exiN2mXTGNQ== 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=nrZKNq9DZSJg/8lM9Akg9mQ7matGo6hu9ue2IJwmlwg=; b=KAiNYwoOf4OQM0giUwHEgjsIKSFi7775UWb6JGQMTWtSHZqc9pg0wzxm7o80qrX9Hj5XV39i+waC2++YeQnA6OPbbWeFcZs3KmEOjvtxWOcIWQrEdTWVB4ufjaJkP+Kyn+COugN871nQYRMi1WuYpN4Am9T5D3WNaAaVch2yevq4WICn9vnMspPPVJGtW/C0G+6/JsZW8O1l0Pr3RKz5xOFJ0hPLB7MP33cyEnn8hCdYs6w7MZvE9nuLncnPpSHz/wWOYhsTw/eP0vyOhFQALWJRzo2Dz/DnTh/8wgxoKHn6CeJSOw1VL0SKncmq6eAum5SwXHB1QrL8zJI/tzLLCQ== 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=nrZKNq9DZSJg/8lM9Akg9mQ7matGo6hu9ue2IJwmlwg=; b=csn46IjWEujcEbNld5nMqlkVNJ1oRIdmHT1Pcu1mdzEUkLY48jA5vQjZS8QNNzJlbkYPjCgK3NjVk2bBEa8GAknHwml9BVNxjwyimhmAY3kE1HB+wHRo9Trg1vV3KQ6f0VYoi0ebWIWwftGWnLuSLwrm4CYBVxAu+eOphiZtYiI= 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:21:56 +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:21:56 +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 , Thomas Gleixner , Ingo Molnar , Borislav Petkov , "H. Peter Anvin" Subject: [PATCH 08/22] crypto: x86/glue_helper - add check for xts input length equal to zero Date: Fri, 7 Aug 2020 19:19:56 +0300 Message-Id: <20200807162010.18979-9-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:21:54 +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: ff60be81-d101-48d1-24e0-08d83aee0078 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:4941; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: IpXISqCWvOq/6h5skve1p7RYEqqimRYuIlBZJ+qWWMqP6om7+SHLPGPpv/Xlc02yjDGo3Ad8gEdyDR+dFJU6cKG1I8RvS7IwMedZmCfoKqHVpNG0A+Qpzp6MXaeukSUBCKYTOpPegJu0IAFYHDKKwWGXk+50AMFuVnkAIMATh6WbyYS9lR2bVBoesSh78kBMM+RUSB17vuKXnRM9Ds9jTMFsINdbLqyvdAPSpM4IC4VL9JpNOPUcMgQ4c9/bfJ5BInrIO4L0nKLdRLWjDqGMlbMl7LuT9QdJ+GCprfY2UJzYhHgCqqxDfyhOwAMkNI6mtOSWmltpb1p42UEDi6xOBg== 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: AwEDIqsj/ePUA4tBWZ3fzM+HhVyebB2vAqoKm2BJkPXmxF5ylcbxTIhap1rU4X1q+P0xnZeWZT1j211lkKC4kmlTuJmT4/SmylprVpDTcsokySyBsFvswsHcGfT4XHNQkVqs9eQdDc/E6punaZk14GxLo1x6wZRYZaF+o5J0lh5rfJ7Imvk8lD/P9Gkgb4QtaMD9TCARXA1XLvHe/ec6MJHjmRCHpErKbU32TX/FVaOJdKzlcfDKxt6h7zQLLzgir9CEt6x6fN14PGqitCTxdzhe2jkI4Cm2epY3x2KT3PHWHJl/6pDSYoq/OzK7sNqOk7BnAWlj68+0LiQDaODK0nga5PeJq59qUmA+WmT5lf27JPT+Yhl5gALMmP/YWB53eVZW0waOB2mmq7vG9w2jl/zA8VUoUoN/JT0p5ucPJNoXKQNWaDVMWzPt43IF8q9zpd6XetG3XTaRYaTCNNudDGzARWxgJ5S3qi6UOU8tZdcX+ZI6d/S8RdxqWqalSHVuEVG1SKJ9IBYVFFedYuv/4l0NI2RiiSPPCCcZHw13kmwIjW0YzqiPkFSv0y64+q/VdO8OB4aD7Vu4N3rGP9jYvceBNmMaznZgt45YGhXs8+qX4EbNqRxBAdIkSGg2iS/lKTeuSDvXqiBm6+QzVuc58w== X-OriginatorOrg: oss.nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: ff60be81-d101-48d1-24e0-08d83aee0078 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:21:55.9415 (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: rsD9cH37+giH3iLqApQdOeVUQIXillRiUWeJTvAfCoYQXlMaNgyNbIXcr3exZWYjhBNfTn61d/3vzpUy28UyVg== 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: Thomas Gleixner Cc: Ingo Molnar Cc: Borislav Petkov Cc: "H. Peter Anvin" Signed-off-by: Andrei Botila --- arch/x86/crypto/glue_helper.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/arch/x86/crypto/glue_helper.c b/arch/x86/crypto/glue_helper.c index d3d91a0abf88..cc5042c72910 100644 --- a/arch/x86/crypto/glue_helper.c +++ b/arch/x86/crypto/glue_helper.c @@ -275,6 +275,9 @@ int glue_xts_req_128bit(const struct common_glue_ctx *gctx, unsigned int nbytes, tail; int err; + if (!req->cryptlen) + return 0; + if (req->cryptlen < XTS_BLOCK_SIZE) return -EINVAL; -- 2.17.1