Received: by 2002:a05:6358:4e97:b0:b3:742d:4702 with SMTP id ce23csp1448287rwb; Fri, 19 Aug 2022 04:03:09 -0700 (PDT) X-Google-Smtp-Source: AA6agR5T1t4lwH6a8KaodZYjdQF/A4o73ai5lBsEN3Y++Sf9AoxozZbEL1Sn7g5JHMzQauFiVGV+ X-Received: by 2002:a05:6402:51d1:b0:43e:f2d2:fa25 with SMTP id r17-20020a05640251d100b0043ef2d2fa25mr5652003edd.31.1660906989536; Fri, 19 Aug 2022 04:03:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660906989; cv=none; d=google.com; s=arc-20160816; b=lvHPt5t1HqBhnt/RRvIEKmuOihIWSYKp+Vol0RBqw/iKqbv+7UOZoJ0vNvGvmrOEq/ wpETfa1/kt9lREDha05utCRhZECIRxRnXCu7RR6XDFF0L0F970w9FoV40+45HpU79j0b Pqfbk2mF3r6f6XPR9O7oaGsNDS6puD3EOvLRy5y6zW4V7cMYxKPtB3J97yezTRnb9wVs ttFIh+uP06gFyp07DCWyK8iBVZr6c3f05DjXpxBfH/UR7SsaBhszkTEdV67UH+mCs0Rc 2gDPHVgUhV6Y1CggLZ0R6Yxxu1uEgAcrllXYOxHSPYcXiyt5pHfvwKjbBM1vcwZTMzKB MAhA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=ePFYcLzd/CKivL+VOKdubgbkGHMXYC6k1vjZRFtkPwo=; b=P56E+aCvsLgsOOg6g5Jfv9jWw99s9z/cqDAZ+KCN9phubIb0zARWpTx2Am6aNvKvJc FUOgNG5+HQvVFuE17WXd2ZQk5j3ul6A950WAOhNR4G/MFbUQODfduf+XpoIju+dw9pjD /u/hRKQczPNKFw9OCMsVsjLUcIcFxth4J8vNeag7tWQvwz38FmerG962QT1k1frlNBk+ 7y6Z7/d4Q6/1K3j6b9pzAnMsH2LSEb0xbi0bWDSKFmeBR6dGw32Ts36R/4jx/D6WDoED jdOfZm6F3h/xivN4gM1NmBF7qaJSSUnpDNGYV9a1pm1qzjLM2DrIMCZ7bfzjN34ym4cO hkgg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id mp41-20020a1709071b2900b0072efc11c532si2859946ejc.41.2022.08.19.04.02.20; Fri, 19 Aug 2022 04:03:09 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1347652AbiHSK7C (ORCPT + 99 others); Fri, 19 Aug 2022 06:59:02 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37690 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1347036AbiHSK7C (ORCPT ); Fri, 19 Aug 2022 06:59:02 -0400 Received: from fornost.hmeau.com (helcar.hmeau.com [216.24.177.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7ED54564C7 for ; Fri, 19 Aug 2022 03:59:00 -0700 (PDT) Received: from gwarestrin.arnor.me.apana.org.au ([192.168.103.7]) by fornost.hmeau.com with smtp (Exim 4.94.2 #2 (Debian)) id 1oOziI-00CpU8-Sq; Fri, 19 Aug 2022 20:58:55 +1000 Received: by gwarestrin.arnor.me.apana.org.au (sSMTP sendmail emulation); Fri, 19 Aug 2022 18:58:54 +0800 Date: Fri, 19 Aug 2022 18:58:54 +0800 From: Herbert Xu To: Srinivas Kerekare Cc: linux-crypto@vger.kernel.org, qat-linux@intel.com, Giovanni Cabiddu , Wojciech Ziemba Subject: Re: [PATCH RESEND] crypto: qat - add check to validate firmware images Message-ID: References: <20220725104009.76267-1-srinivas.kerekare@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220725104009.76267-1-srinivas.kerekare@intel.com> X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org On Mon, Jul 25, 2022 at 11:40:09AM +0100, Srinivas Kerekare wrote: > The function qat_uclo_check_image() validates the MMP and AE firmware > images. If the QAT device supports firmware authentication (indicated > by the handle to firmware loader), the input signed binary MMP and AE > images are validated by parsing the following information: > - Header length > - Full size of the binary > - Type of binary image (MMP or AE Firmware) > > Firmware binaries use RSA3K for signing and verification. > The header length for the RSA3k is 0x384 bytes. > > All the size field values in the binary are quantified > as DWORDS (1 DWORD = 4bytes). > > On an invalid value the function prints an error message and returns > with an error code "EINVAL". > > Signed-off-by: Srinivas Kerekare > Reviewed-by: Giovanni Cabiddu > Reviewed-by: Wojciech Ziemba > --- > drivers/crypto/qat/qat_common/icp_qat_uclo.h | 3 +- > drivers/crypto/qat/qat_common/qat_uclo.c | 56 +++++++++++++++++++- > 2 files changed, 57 insertions(+), 2 deletions(-) Patch applied. Thanks. -- Email: Herbert Xu Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt