Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp2366928pxa; Fri, 7 Aug 2020 09:23:31 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzCJUvcPsXR4UsTCb+eovpBcYgQbNWB8nUloFRIBlR7V8C5vvLw883hKtrFcmJoRq1/e40a X-Received: by 2002:aa7:c395:: with SMTP id k21mr9802469edq.386.1596817411382; Fri, 07 Aug 2020 09:23:31 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1596817411; cv=pass; d=google.com; s=arc-20160816; b=sHitmai2B2ao0JPL6f4GuZenxeRLDP3b6h2rIrPG1ubF89wwWMdJE1v61mBIOcQO2g AkRqgct7JBhZ4K60L225p6B26VBww2dioD+39d1C1hu8rRWRq8cBsTbL/xxDrqKf72v/ ep5qyp5nCG6Es28W0rJ8Ny6CvoUZ8zWqpTfJRQTRcADCDo/2o7IaNi3+BMA6hVioMdIU KAVNlIvkKQ7vsUgVIeXB9XRbD+u6I3mtQuFrOcr6KXRdfTuoAZgnbnFUGpQQZUoz7YBj NgBBX5OI4IXU+estTeuNR7YvKDrPyFQfIcBgTkSB0tWsW1UiTm81tRn76PS3HUYnYpFe RSaw== 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=w9ehk/al5YldKkn6kPZlc7yCIC51d6sPnLi7zv7o5MQ=; b=I/3ou2RdDcoO2DjqUnPKMZuSedoIk5K17vFn3aioRI5bkmfaDcdrRGW9prRqO45rYS WbXgBCoBWdTuFbmST1uhvqr9wQ+1MEhRzcYVvwFOugbW9rc1PwHWGSdFEcNOmYwhz3se gLGoWLaPLozen8cI/Je78NzgnyasnD6RBqrfh+rnHdfb3Wb/SAfPURX70y4XfvL6rtS7 1s5pckzcD8+KCLzZe3Nta+ZVt0sU3ovuuGypgV850icKQAX4BY/A8K0w8URErNnv4brG w3rj6/YKCGTyM7rCf3FkHbdTUa4aiCV491ypMSrQRNnaAn6h7ycCAJDwyrIahPw7eBzG /L5w== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@NXP1.onmicrosoft.com header.s=selector2-NXP1-onmicrosoft-com header.b="ixO/4pj9"; 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-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-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 v8si6684990edl.307.2020.08.07.09.23.08; Fri, 07 Aug 2020 09:23:31 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-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="ixO/4pj9"; 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-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-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 S1726961AbgHGQWL (ORCPT + 99 others); Fri, 7 Aug 2020 12:22:11 -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 S1726891AbgHGQWE (ORCPT ); Fri, 7 Aug 2020 12:22:04 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=koRfX+ELIry8gzN36D4+VCbXKEK+oiebuagAJbFX5mS/TLfxfNn8djPyY7wAnbaNYj8znM8wFCN7fNi2gPngpKbaXsy0eTN/YHM+kAuVyOdX1IBkeZoebaPRyynD68PNR4Pj3X+dPO+9tuegMQ4Bnk3lg6uUgIBlxAFZjZ8ttsCC+4r8kdp+51ATuYpqeNOJrRADSdqQNmpNr++9m99VHeenQjtukvn3bcZNyaG9CaaDw6a7qd4p45RrZPh+eqtlJE9pmn99XwDdIejzpyNn/tUQa+2W//Lf6F+veGITpVOUrsViEVAXYjAgCiSDMZbtxfSncjiWmj0BeEycPOL1XQ== 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=w9ehk/al5YldKkn6kPZlc7yCIC51d6sPnLi7zv7o5MQ=; b=TA02ZiLu2kSNyppoqtiH1lTzU1Yg63++Sjz4bcIS0RreAnNd/6VcXjA2W55B9Ds0xOBs2g/Y3IIjuG5LfSIRiKsQ6VU+PUB7nE6THZHX35CO3Vnj08Jffw9z62+cltygdVI9TZF0ljhdzM50a0TCOffX2gBzmtuAoQw+MJznmgHlaTB7zpBJJPCm/hBPC1zNdfHNo3ND9TRvIDo15FnhwUH0cOpIqawfS5Ydbj/kqBCbQ/olLmmqRYsxy4NrBe1rWd54PKCk8rQOhDbTKm7iLd91Ie9EHfsX5hANZume9KOz3aDbxSj2+ZAhCGKQnzQWxAmZeZmYmykt7Nc8FWSGjg== 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=w9ehk/al5YldKkn6kPZlc7yCIC51d6sPnLi7zv7o5MQ=; b=ixO/4pj9sQPI/UVNiEnreOZN2kqwYPRnexa6eSvmasqSVojOKnlw2CAud9s67F48n9dUNCQxDxvUCilsKGU2eR3vUJpmHZVO2WaYWAlUhYZffGByMh0J7yec9uiw1gewPJcikybji/Sc68oFvcxqvGH1YGSvcpNHZiAGeqg9eiY= 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:53 +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:53 +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 , Heiko Carstens , Vasily Gorbik , Christian Borntraeger Subject: [PATCH 07/22] crypto: s390/paes - add check for xts input length equal to zero Date: Fri, 7 Aug 2020 19:19:55 +0300 Message-Id: <20200807162010.18979-8-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:52 +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: 9325de9d-1130-4bde-e6c0-08d83aedfee8 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: xwG8XlwbJs/hww0tE8xCdhTAO9ATvOBwD+x/Ojy0NW1xaY0tmtrIqaEec6F4GWHeQSdzMiqm1F0sruEFvs1fdLz5VhSLd8tm62ZMcELsGRIuT/nmIccXHIogmtoOfVFOequAwr9fIC3c3dict3uOgjdanmDrbVe4O3MYr08NyZ747WHrIKa2RKkscQ+IsIMLyydxJ2/wRL2YK5Qvf0heWbHc8HOU8KIsOgwKSy/GxXpJs1GnVS4LnoMDceVTJfZ5ZNL3F+t9l7RTb+6Q4M4whprg6OeMtEsx4Zm78qi+0oUUk34OXfxFDaMjZ7bj7NvkACiPyqerl7wL0QWGiQ3wow== 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: b0gRcUDAUPn9zlDJ+oJQOX1SY4FOixk8zoR6ynwWNhkSQosARDIOO3Xncp+xiFctcG3aHC6lXx04F4qYXrSn1u+saG589b4hx/QNFhs8T4AsJnw8vk5Xw7yuo+zl4MlFApisHiAcSj9f2kEbPf3CSuqiskenojvHgHmMiLCK72BCLIYeQ20R6EpT+zsxYOYauuYupiPgDCrRgedot97twK8+eJedcl0asvi1+Xu8U+hGUTPjLK6ucoZJZQ1uJWf5/EPTcV+x7PWhOfT0MHSHd5tvaZ/IxjiZjA4IAF7f0NIMSfDjOLugXgCvu7lHMYcr/9U/bhvMDKPdKjm+am7jzcHWZInbRg8hAZOkS6jI7/+iTViDf9rrhdV3oxibj5TqvlHHtDdRetdJim6pztry3gSAuoqSXcH/KC6i1ceKddlapXVmmHc+/afir73O0vpDIEJMVxIxtxVCPpDTYIBpQnvRwdfDFpmBPMWJ2ArBBU8rj5UIrERo0xTfe9cv5F51qIOtfd8pLg4VHnxgI0QYGRFMwqfSyfs/X82V25xdladQ75HMEAFQSlDWnF7/fgqv5kw2wsiGr08uXWvohLkE6VZFUCb2HfYSHEKxMuRLbkbZVgtUHshyCe8tW1HtZKdCH2F3ClJrmZ6/rxwm4RWIcQ== X-OriginatorOrg: oss.nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 9325de9d-1130-4bde-e6c0-08d83aedfee8 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:53.3300 (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: XyEk4SFo4p/DP/2GZhNfsFgmRZcR0ccOtJ/TExqOYb8JO1/ahBBlI+Z/1x+SfJeUb0R7y/jy4u73EJ1jjSHdlw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VE1PR04MB7359 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@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: Heiko Carstens Cc: Vasily Gorbik Cc: Christian Borntraeger Signed-off-by: Andrei Botila --- arch/s390/crypto/paes_s390.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/arch/s390/crypto/paes_s390.c b/arch/s390/crypto/paes_s390.c index f3caeb17c85b..7f0861c6f019 100644 --- a/arch/s390/crypto/paes_s390.c +++ b/arch/s390/crypto/paes_s390.c @@ -494,6 +494,9 @@ static int xts_paes_crypt(struct skcipher_request *req, unsigned long modifier) u8 init[16]; } xts_param; + if (!req->cryptlen) + return 0; + ret = skcipher_walk_virt(&walk, req, false); if (ret) return ret; -- 2.17.1