Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp2367572pxa; Fri, 7 Aug 2020 09:24:23 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx2xN+wZE0nvZiLs7B5+QpNpwIrCNTF6nrUWCGDPFZxsDoFLaJduHUd6w8Prf59/rR1wFmF X-Received: by 2002:aa7:ce90:: with SMTP id y16mr9702299edv.325.1596817462804; Fri, 07 Aug 2020 09:24:22 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1596817462; cv=pass; d=google.com; s=arc-20160816; b=FBiLuwjg804paCF5o042bNJdBzE/DgNsD+bbP0mDAejCkBnmwxatUuIJj4YxcT/QQn UyFmnJgJppQq/iDZkkFlaU7FxhIelSjEGev/l8wdPtHoJgYEoITuPOH4PHeE0bKTH7ap Ix25cXYYjHdpv7jgdf4NN1k6Chbpm4euGYDAFXZwLIyd309iMq3fXv7FCKwL76csZNJh Vg+lyWAgIhiUdAP/r51By3CeadYWG/Gtg/6hgWPxmFV0NbDvMXXYyneE7AhHiguVxSjJ 4QSpCHra8IXF/AegUAD2IxVLeXoCpSFyRZSXtF4FhXfhgD3tkkGBpTlKPpV8kuVnROjS w93Q== 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=wjSlTBIIU6v80akFULRYM9ogtPRvcvrubPeMrVm1zlY=; b=pNeO7RFw/oL+dx6dgqFeJKqD5lsFkcJqljXimjcMEVmjguIOq2CjMn8a6N/gcsYgyA OskOVWkbXa0wv2sv53GGmkw9L+WZ3O2mZQVJedPurNJS8+aTeZXHy+rE8wLD5qfGP8tI Pdmr6DdJQIu3b8S0hiEBxWCjayU56oFm+JapcJPbnrsCXp4sCyeKbZWua0iJuj7Fa2v5 HWs9+2rwrBAILSIHS9BMgRfKDLjzqqZyT5vsv3CJqk1ZMmuYsS/YCCzEF6MNaGThnpst XyPhHdVZinpDAmoeC3vB3DWQNhT0LZ5uuDhc9qZf7L+tgIN6jNUhHvE1kzSo61jznHw1 K/IA== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@NXP1.onmicrosoft.com header.s=selector2-NXP1-onmicrosoft-com header.b=OcztL4JL; 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 k27si4790251ejc.447.2020.08.07.09.23.59; Fri, 07 Aug 2020 09:24:22 -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=OcztL4JL; 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 S1726954AbgHGQW2 (ORCPT + 99 others); Fri, 7 Aug 2020 12:22:28 -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 S1726823AbgHGQWY (ORCPT ); Fri, 7 Aug 2020 12:22:24 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Sg5tCAPbskTxHXRcFI2IxpsbccuBWg4+DyIfw4XHQRsyUJ8ByD2IyiWIXu5z/D8Lb/2lM87KWYhQeJhGIeBsNx+q19Gf2+k9AX9fYxfv9pS8LKgKJRthtCKTKyVPtkzJ+hiZqOp2opQrUKmwdvwmbVBNXEYGSpWpL/2epSn2iBIJZ6lii69kuqe27oAohZ8MQYGRezt1sYC+1gmmCf5tcrm4uTVK4+RccOYeL4ilC7bXT+pHjKzgAugw9uPDjQqJVdWs3gMxIXVoUGKEUg+AI1kwkrmm/9+hqTYg/bpzRYjnCRDMKLLYNmyqNbmvIk2rbqr18B2Gwpuyn1sRn7pxYw== 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=wjSlTBIIU6v80akFULRYM9ogtPRvcvrubPeMrVm1zlY=; b=TEW4EZO4eCV2TyTw4oVn7E+eeGABzkZW3JpSOFeXFK2RY7dnS096Q6+laoYl0QQz3uM4NCh59Y9DS1FK5pBUJ3u+1DMKZXkIAowkETCdRUOkSvCn28/1Vtf+jHZTqk3OgCW1KnYSi8RIkRNHvdTk4xhSTK7iCvwIvetvMHu5ZzSbvQJYTi19fsRdk8gPej0WMxjl93eQI6Vx6RJklAeQ0+TQ6sb/jJGR4WOwDDyK45RtUiubifDqAIJ/5p8eFFd79w9Ms6xP84mAkvy/Eu877Qf9kDqpF2Y2QSkjHvCtZYKOTd2TgtUL5/N6ZfUMMZ2pVEp2QrVGe0TEEtazVqmW7Q== 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=wjSlTBIIU6v80akFULRYM9ogtPRvcvrubPeMrVm1zlY=; b=OcztL4JLuai4EJSflIa3WSM93yeRXif4mNhD0Won38o4eBOSaBm20z0D0BILQTzjvRobKvuWsmnIJDVzFJcOMTc31z30RR8ACC+SSpOKZ2owmrOKsOBdX5kSJJtW9bUk4mjayaqMWY5h/RL0FMY1f5wHaj+Q2sRNWeo1sdBK684= 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:11 +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:11 +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 , Tom Lendacky , John Allen Subject: [PATCH 15/22] crypto: ccp - add check for xts input length equal to zero Date: Fri, 7 Aug 2020 19:20:03 +0300 Message-Id: <20200807162010.18979-16-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:10 +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: 4c8aea55-aa12-4cc0-c174-08d83aee098d 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:2733; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: EOK+n5XPW2kbFHr0PjIzG8/ZrsoCyK2Uynv3LrD5ARVj3nsPGg47vJuiKVxr2Z/eVFq8Y+XfuTQOVGLZ4PNqooNOMKR7fxDIEw4bdcw6asCxJsAxFR1301bdNj1JlYfC+r0yva+gLx98ROyNB7eatZrClWu6ckFXNJRUKdCu3MBgbcEsqw65N7uh8FyFGQNBxpPoTFLnanPjLMtD9qcBABIk4z+vL1eyqyWFR5yD7q1FzUfTYwPEx7KFZkw7z9bXH2To539e5rRMbniXQNyS+tYa0InYiQ+UueIQ+aofeBqFKSQ27KBRR2+X486m7j6eIeck+9IjrmmEV4XanZlHjw== 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)(6666004)(6512007)(2906002)(8676002)(2616005)(52116002)(6486002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData: lpJGRnJqG2qClVfiihcs5b61Exz7Wnn4qOXnUs4FW6m23pe00clos6oT3aDjz6VY0CCcWA/i3ap8ja6ATOe9QpbACguiMbKvCKcFvRkypKrVK9bZ1FrUGFsGlyuxrQiOoj6UuRi2FpaZXYjEz8fdaHdao3tWk2pMc+Mdi6zdIFFJwhAyoYd6w1rXUxLPcCAgHH+CqQVzjfRxMJYeaMK3g6AUuWIM/2HXC0TmkOwmCRKkG5+X5Ls4miQseLpJf6TFfnra5asmf7tQsqTYfk6ocY6uyHIAV4n18TRshaCPcWWn+hGsKu7k8oYdr523sidl1g8n7wdB48lEKg6XRWiURni+g2rElTfgawNCTbuu+4H3SDx7VsOZDmuD0etfgQit2iX63c6qBeDEn8CNSDHLE753h6Cybw3Wl0V1mrsuL//K1vYei0DLxI4j2QzCDyKSev0Bm2qQHFylesasoKAQmYa4dSqnAfBnxqxVGSnrpLPKv+TyS56Foyy9Qnvi9IJZOyyUoZCxkQga9886Irk1uLUloEwmup5eGuz8zxoRUUWwoYvUQXQwvWy1sKPT/la5c87IIGt0mCPdBQ+nTuLiJqUIIuDKHy3l7o55P+4aR8fvL+nvomJcUdr1HPK5e7ciWQ8bfXXHtpIWasuWbIE1hw== X-OriginatorOrg: oss.nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 4c8aea55-aa12-4cc0-c174-08d83aee098d 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:11.1736 (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: EigcJqHnY4F2wXL97v4Eo4RB3trGiN4a+m8ANaUAUxjNl2juZQDJi95rfQyenyvJroXCf1hGDdVQUZ7PJJEHZg== 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: Tom Lendacky Cc: John Allen Signed-off-by: Andrei Botila --- drivers/crypto/ccp/ccp-crypto-aes-xts.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/crypto/ccp/ccp-crypto-aes-xts.c b/drivers/crypto/ccp/ccp-crypto-aes-xts.c index 6849261ca47d..6a93b54d388a 100644 --- a/drivers/crypto/ccp/ccp-crypto-aes-xts.c +++ b/drivers/crypto/ccp/ccp-crypto-aes-xts.c @@ -113,6 +113,9 @@ static int ccp_aes_xts_crypt(struct skcipher_request *req, u32 unit_size; int ret; + if (!req->cryptlen) + return 0; + if (!ctx->u.aes.key_len) return -EINVAL; -- 2.17.1