Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp3947381ybt; Sun, 5 Jul 2020 11:29:49 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwdO+d+SDRSYe/M1YhcttmtuFwrNk4Qx5LB1a8ahot7CK4nWSZ2heqF8JTsDo5MB+0F6uJK X-Received: by 2002:aa7:c98d:: with SMTP id c13mr42940724edt.188.1593973789803; Sun, 05 Jul 2020 11:29:49 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1593973789; cv=pass; d=google.com; s=arc-20160816; b=VcKzKGQeYl8gJbrr8XdH2P5G+VebMAzebSuDyHeUtBsdd2gaKaz/NB53rkw52627Tj hCFryVfegYxselvFkTZFfZN+/JZbBCj99g5TVAxcGP7tL4wE+jqq8/0v5XSCRPQsp/q8 +9ebZk9mK3csz6wDt3TBVDNv1l9u28MithKfSXS8xEvwYOdGt5rus9reFDQE7vooBhY/ ZYA0e5evO3rFzNYABsmIoRlbo363iloOPz989cxeSgho5UQ284n6GjI462SRInCVCNUF +nbLFcoKUQtN5PFtQAAqVHTFHZ8MLCfOCZ/XOhj2/q34SvwpBPdfNHXp3kG1W2HTVKpe 4a6g== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:content-transfer-encoding :content-language:in-reply-to:user-agent:date:message-id:from :references:cc:to:subject:dkim-signature; bh=OYd9nDEkesi4C1vItqF6aSA5s+BOUZQ7jPjHLpRJwmQ=; b=i2uDlK7cjvZdAq9MLwJ8lAkRJlTUdEzVmLi2Xp4jZ9+dDZKaniogWfdPzmCLI0Dy+j +lrD3EK7q4dFTeEHXe8AGZfX6GqLzIIVhsTTER0k35Zjajq9tvDQ0s5SdZuqcelyxSDo /93/LYv2BUQXmSy/5ONzXzweclkuqnukiRTIkYKk2XLqoPaVA8Za/bO2vAogaaPr8SJW YhtRvuBjLXEKFsopzhZvF32HzmXcvM5aELd9rDUz5qDsrFNaC+XRUQ9NgQjdSQ+fiis0 f/OPOXceq3WsWdfdabthr9msXvQXpTr/VsOUNizAHM14lIxTyfX9FXNbB+7GyyjUzMiJ 5DiQ== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@nxp.com header.s=selector2 header.b=BvoFyisT; arc=pass (i=1 spf=pass spfdomain=nxp.com dkim=pass dkdomain=nxp.com dmarc=pass fromdomain=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=pass (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 f12si12176149ejb.397.2020.07.05.11.29.14; Sun, 05 Jul 2020 11:29:49 -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=@nxp.com header.s=selector2 header.b=BvoFyisT; arc=pass (i=1 spf=pass spfdomain=nxp.com dkim=pass dkdomain=nxp.com dmarc=pass fromdomain=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=pass (p=NONE sp=NONE dis=NONE) header.from=nxp.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728050AbgGES2X (ORCPT + 99 others); Sun, 5 Jul 2020 14:28:23 -0400 Received: from mail-eopbgr80085.outbound.protection.outlook.com ([40.107.8.85]:61508 "EHLO EUR04-VI1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1728048AbgGES2W (ORCPT ); Sun, 5 Jul 2020 14:28:22 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Az6cUZGRNKFZH7CAmiJOHQoe6PKdnoYDqwJB15P1XFlQvDcQaz04HPQNXzAinVZvNGuqbR9aDD5u0mQ6zkAuZ3xNCaJ8z6XMUnzh9z0bixp58XEVMxuw2pa98u6fZwIORaJ7OqyF7hs6FAgRufehSSO/1NZOGxgFRkt2PqtWBtdgyO5M7rxN/sETvMkB0PBuF6/se46wuh3MAKkDhunpOhoYdlwyAp6tLA9Ml40kiMozEMsjsB2NSlLNUvnjaT25NXhSTF9SZK7Ke9BMta9lcHd2fRNYHeV+zork0ynh8lp/6I8YPD8SnA18vFon+LPrhv9zeC6nB7eY+Q99fYSQSw== 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=OYd9nDEkesi4C1vItqF6aSA5s+BOUZQ7jPjHLpRJwmQ=; b=Dd1CQv+zgPjQW/Hvxcx6mZxKGyTlSMvbhE48CIq4U6iSlGKMwDFWgaaQWO8c+LgGyEGgvKmb6a1tj3Jyxo7tEqSqU0ULjazfBUEj/3o37PaAmRdUd+GoYujrb+5WXsN9WWdyk9sLQq/UmdrAbj78pQFTmFFwYn1Tn0wgXpgnRfwqrXfdNRhCWTva/TUjrXxhuDuG2xRQ9HOs92BWwmcdFmbUZv2/aS6TACuGTdjwhiOFfdHk1lMpgz3goDf3XxaC1kQjs1oab18ArRfWJ8k3GA6u5d8a8MBbQ8xQR3aFMPfyxl29tpI5YAQ4+Gqs8miIq866H7ZeVNr4yK6zjZ0XFA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nxp.com; dmarc=pass action=none header.from=nxp.com; dkim=pass header.d=nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=OYd9nDEkesi4C1vItqF6aSA5s+BOUZQ7jPjHLpRJwmQ=; b=BvoFyisTOTq5qFVj1bOSZfgdeZOTSSrhj1FUmisPYnjTXbQ63bCUGmOV4kwciy8hK59hgmLOakMm9BY6nfxZrj8xdES60j/fOSfNtq34ZLvaVB4mgOgjCW91yrSuJ1cJHxZUwDvaqx0vRYl2CtCVpAH+MLdEMFjssIJS2xZykdo= Authentication-Results: gmail.com; dkim=none (message not signed) header.d=none;gmail.com; dmarc=none action=none header.from=nxp.com; Received: from VI1PR04MB4046.eurprd04.prod.outlook.com (2603:10a6:803:4d::29) by VI1PR04MB2973.eurprd04.prod.outlook.com (2603:10a6:802:10::31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3153.28; Sun, 5 Jul 2020 18:28:19 +0000 Received: from VI1PR04MB4046.eurprd04.prod.outlook.com ([fe80::8459:4be8:7034:7a81]) by VI1PR04MB4046.eurprd04.prod.outlook.com ([fe80::8459:4be8:7034:7a81%6]) with mapi id 15.20.3153.029; Sun, 5 Jul 2020 18:28:19 +0000 Subject: Re: [PATCH v3 09/13] crypto: mxs-dcp - permit asynchronous skcipher as fallback To: Ard Biesheuvel , "linux-crypto@vger.kernel.org" Cc: Corentin Labbe , Herbert Xu , "David S. Miller" , Maxime Ripard , Chen-Yu Tsai , Tom Lendacky , Ayush Sawal , Vinay Kumar Yadav , Rohit Maheshwari , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , dl-linux-imx , Jamie Iles , Eric Biggers , Tero Kristo , Matthias Brugger References: <20200630121907.24274-1-ardb@kernel.org> <20200630121907.24274-10-ardb@kernel.org> From: =?UTF-8?Q?Horia_Geant=c4=83?= Message-ID: Date: Sun, 5 Jul 2020 21:28:14 +0300 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:68.0) Gecko/20100101 Thunderbird/68.8.0 In-Reply-To: <20200630121907.24274-10-ardb@kernel.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit X-ClientProxiedBy: AM0PR10CA0052.EURPRD10.PROD.OUTLOOK.COM (2603:10a6:20b:150::32) To VI1PR04MB4046.eurprd04.prod.outlook.com (2603:10a6:803:4d::29) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from [192.168.0.129] (84.117.251.185) by AM0PR10CA0052.EURPRD10.PROD.OUTLOOK.COM (2603:10a6:20b:150::32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3153.21 via Frontend Transport; Sun, 5 Jul 2020 18:28:16 +0000 X-Originating-IP: [84.117.251.185] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 845d8487-0743-4bfd-ec2d-08d8211130b3 X-MS-TrafficTypeDiagnostic: VI1PR04MB2973: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:9508; X-Forefront-PRVS: 045584D28C X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: VP4eO4c1QkONbnTgngEj6ZDpzex/ksXSi6oWH6ABoeVfaTODBdBpoEUB/O7tMPTZgXaohR1Hx70/5lqPHgFBWsaJLgv/x5HnFu0EqMcoQUMLdFZF1y6APIoVTbPHSkTQqhBaWD4WGv/tPEfqB9IGGn6BsUO6Kgp2Bc7HCAT+BOQKZEXCFQuh44fYHraNQdoP5iKtCks23OPGPHzEovimXYAD/J7TEGHw4PGZuXKW9bITHTY5YT3Z9EBdpgWXnA5c5iGwC4K8D7jlto+qR3rdNczDGe9kjH0vL+T4ICfWuStMNAjTSCOCREsgHpjW+8+L1cZYjmj9B/fzz/AaueIlZ4UfW3TlgHFcJWwQvVO6sJrXQ7zrpbQFvdzEcCXscmpm X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:VI1PR04MB4046.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFTY:;SFS:(4636009)(366004)(396003)(376002)(39850400004)(136003)(346002)(110136005)(54906003)(36756003)(6486002)(52116002)(53546011)(8676002)(478600001)(7416002)(83380400001)(316002)(16576012)(2616005)(86362001)(5660300002)(31696002)(31686004)(66946007)(26005)(186003)(956004)(66556008)(66476007)(16526019)(2906002)(8936002)(4326008)(43740500002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData: k3bbKYFMPjrSiKL/KhU/xI/B41I0NutHxr/3C0zGZE4yB7ZO1MxxY1LLCgsYp2XBhdoGoymqF6qvK/yK9szU5IPODX5Gv8Xh5yLxsABhXBmxfYfnMyqgFWSNehrnbH14stbn6Era6sRFEhhhzOVLdGVdLhRT1rErFtxuDhWzVIeKlLs64lmYbRmk1AnIAalCMFlZdNDjAm094jY77ZF0vmHs93PWwAEbdgDm6tD793raGU8SmtKCqtnZ9Zkz8yAs5+F85SckcTtoTnkbln552yHcM0auNCje0jocynddGUppQK0Xz1Km87nerIyxSDh1fd+Gfwi+pKmK1r4kHR3hejZ3yzlnKe1TOYhHMe96c7nQNv9yJ7reXHu0MmTaqpZEZ2hpvAr6Xp5dPXn483EsB/VthgPO9cCBFRZDA8spNISJtfUoVxzx/jYRhJQSRpc9QPTwPgXN1A1E4DcA3y0jkUPC0mI2L8vNM7VukPHTrcla9jFoTqtIWeuXEGMhLaDO X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 845d8487-0743-4bfd-ec2d-08d8211130b3 X-MS-Exchange-CrossTenant-AuthSource: VI1PR04MB4046.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 Jul 2020 18:28:19.1831 (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: rMakduQAyqJzaUUSWRizqeJcDBarFLZcmk4v2ZF0CMloABb3DUI0fIjuJ+IfrPHOQJlKOq8CBynxiFRSOx5aXQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR04MB2973 Sender: linux-crypto-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org On 6/30/2020 3:20 PM, Ard Biesheuvel wrote: > Even though the mxs-dcp driver implements asynchronous versions of > ecb(aes) and cbc(aes), the fallbacks it allocates are required to be > synchronous. Given that SIMD based software implementations are usually > asynchronous as well, even though they rarely complete asynchronously > (this typically only happens in cases where the request was made from > softirq context, while SIMD was already in use in the task context that > it interrupted), these implementations are disregarded, and either the > generic C version or another table based version implemented in assembler > is selected instead. > > Since falling back to synchronous AES is not only a performance issue, but > potentially a security issue as well (due to the fact that table based AES > is not time invariant), let's fix this, by allocating an ordinary skcipher > as the fallback, and invoke it with the completion routine that was given > to the outer request. > > Signed-off-by: Ard Biesheuvel Reviewed-by: Horia Geantă Thanks, Horia