Received: by 10.223.185.116 with SMTP id b49csp5885931wrg; Wed, 7 Mar 2018 21:02:36 -0800 (PST) X-Google-Smtp-Source: AG47ELut+mFekPfiazVrpqsot1z5i2GYRRb8WxCsjCXXIXsS1yX20J2R3i5EOhyfaScelVVY2QHT X-Received: by 10.99.126.14 with SMTP id z14mr20571871pgc.429.1520485356348; Wed, 07 Mar 2018 21:02:36 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1520485356; cv=none; d=google.com; s=arc-20160816; b=0txRl6zNfg8BtY7k0YWXgoC2V4V+c/i2jRFVsal9sdkb0L5anLte4lRatNdFgGsf/E kYMEyJowm0FlNbO3pqDYxa7ToRnh/D0Eb9WQGTAqkY3n1iZasCddcFcoTpoT8iLtp1OX YfgJWKrrwfqBuwcxdGzEZiK39v0epJGF29Q9l4ni71m+pJqcdr+ge6ZNuVbry/AE+05Y q9iNTNV5WCwdI41Q28+/MoiZP/9EOOZP2pba7HOtd+EKR7hJh8Ta9NdNMkuSQk63ESyM 46AwvgiUkQru+is47zaDRfkPeFdrE1Si/pofmZ2+/ODzFk4LUHnSAnjVgdROKNutGf+q XkJQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:content-transfer-encoding :spamdiagnosticmetadata:spamdiagnosticoutput:content-language :accept-language:in-reply-to:references:message-id:date:thread-index :thread-topic:subject:cc:to:from:dkim-signature :arc-authentication-results; bh=0QyUXLReqJH8BDAt623hJ+hSiSpvLDmEu06Bo0uTjdA=; b=iVXfzAAGae8iPwosCYsXc9/eTI1oZnOwsxhpLVOAjKktFsevukWVd/BaTU7rZ1gXUv iT0Vck4NwqE/nOFVw7DfnofIKgPGTXXRz6GiH3IejgdOZ7UV1PeqsJ1kouxXoc+v7iwk 6lkOA42fOapGgU5fU66vFT34kGckVv0zsQW+t0idS2xPuBxQgHGN3WljePn+fG3+dBcN bxGY/FTX0tNiTsdHtzy5D+mpHjCtgasWn0QSqLkas40kLlt+LmYPVCC3ua17IGPJMSNY 6/31edh8ZZ/EaatZxZf7qRYktNBZj+fuRIiySdFpUQjkM5f83tk34K28PgaexeaaLZL7 TDnw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@microsoft.com header.s=selector1 header.b=BkhCX5PN; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=microsoft.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id m6-v6si2695065pll.93.2018.03.07.21.02.22; Wed, 07 Mar 2018 21:02:36 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@microsoft.com header.s=selector1 header.b=BkhCX5PN; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=microsoft.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751173AbeCHFAH (ORCPT + 99 others); Thu, 8 Mar 2018 00:00:07 -0500 Received: from mail-bl2nam02on0092.outbound.protection.outlook.com ([104.47.38.92]:59552 "EHLO NAM02-BL2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S965475AbeCHE7w (ORCPT ); Wed, 7 Mar 2018 23:59:52 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=0QyUXLReqJH8BDAt623hJ+hSiSpvLDmEu06Bo0uTjdA=; b=BkhCX5PNIG3LV1PHlLLtiSBCweCw4Wk12Nv53ZuxkwPruz3iVxYhhJSVkKOY4FmGyVXhd8JdVou0K2UD69+7azRf6KuKcqLadl9UQFiclrROX96djCMAYFr1w4gVBAlO5XhsNXvLMMw2sgVa84BUeICNVlvh5/EbuI4aN51HeuU= Received: from DM5PR2101MB1032.namprd21.prod.outlook.com (52.132.128.13) by DM5PR2101MB0920.namprd21.prod.outlook.com (52.132.132.165) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.588.3; Thu, 8 Mar 2018 04:59:49 +0000 Received: from DM5PR2101MB1032.namprd21.prod.outlook.com ([fe80::8063:c68a:b210:7446]) by DM5PR2101MB1032.namprd21.prod.outlook.com ([fe80::8063:c68a:b210:7446%2]) with mapi id 15.20.0588.008; Thu, 8 Mar 2018 04:59:49 +0000 From: Sasha Levin To: "linux-kernel@vger.kernel.org" , "stable@vger.kernel.org" CC: Lars Persson , Lars Persson , Herbert Xu , Sasha Levin Subject: [PATCH AUTOSEL for 4.14 66/67] crypto: artpec6 - set correct iv size for gcm(aes) Thread-Topic: [PATCH AUTOSEL for 4.14 66/67] crypto: artpec6 - set correct iv size for gcm(aes) Thread-Index: AQHTtpoJ41qzNd/ymE2LVoKNI+1WWg== Date: Thu, 8 Mar 2018 04:58:02 +0000 Message-ID: <20180308045641.7814-66-alexander.levin@microsoft.com> References: <20180308045641.7814-1-alexander.levin@microsoft.com> In-Reply-To: <20180308045641.7814-1-alexander.levin@microsoft.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [52.168.54.252] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1;DM5PR2101MB0920;7:QXa7Gs8mcXe82d+/37aaqyk8I+IdPdAo06gs92mjgvklDxQutzYxjMwydZxnol86GPwm/oqjm5+7o4KueJtB47vzAA+DSluBzQ1k9tCldUCxTDD9V/U2uVsR02Tgnbkh0G2G0e51IMGvKXKt3Tv7bv5BnRskR3psxecRT0Efnv0lTVzZ8SrwKtUwESnoZVJT9ecBwPYtYpHrVMqc5EulaqySuxs2Thw8KA0CLOj+/qqoA2zhyJCujIWqaqbvBhG9;20:JqVA3bGOxiRR2zz3PNhrn+oGkm62n7HXfsE2+XeSaGnkDuBN/d5Tw5k5ZtR19MqEix7fjcOJIOyIRslHH1/mwc5wT2f+eJnQAuPRY1dYXiKpsBjo+aS0mfnV0vxgd9VylmrxzUaToNh4+Eml6oUnEbvhzE/ssldHPTb81E8iNWw= x-ms-office365-filtering-ht: Tenant x-ms-office365-filtering-correlation-id: 5c702e16-35ba-4912-5636-08d584b16bcd x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:(7020095)(4652020)(48565401081)(5600026)(4604075)(3008032)(4534165)(4627221)(201703031133081)(201702281549075)(2017052603328)(7193020);SRVR:DM5PR2101MB0920; x-ms-traffictypediagnostic: DM5PR2101MB0920: authentication-results: spf=none (sender IP is ) smtp.mailfrom=Alexander.Levin@microsoft.com; x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(28532068793085)(89211679590171); x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(8211001083)(61425038)(6040501)(2401047)(5005006)(8121501046)(3002001)(10201501046)(93006095)(93001095)(3231220)(944501244)(52105095)(6055026)(61426038)(61427038)(6041288)(20161123562045)(20161123564045)(20161123560045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123558120)(6072148)(201708071742011);SRVR:DM5PR2101MB0920;BCL:0;PCL:0;RULEID:;SRVR:DM5PR2101MB0920; x-forefront-prvs: 060503E79B x-forefront-antispam-report: SFV:NSPM;SFS:(10019020)(39860400002)(396003)(39380400002)(346002)(366004)(376002)(189003)(199004)(81156014)(81166006)(5250100002)(8936002)(54906003)(2501003)(305945005)(8676002)(107886003)(110136005)(97736004)(99286004)(6436002)(36756003)(316002)(72206003)(76176011)(14454004)(6486002)(7736002)(478600001)(10290500003)(186003)(22452003)(59450400001)(68736007)(105586002)(2950100002)(106356001)(102836004)(26005)(6506007)(86362001)(3660700001)(5660300001)(2906002)(10090500001)(1076002)(25786009)(2900100001)(53936002)(4326008)(66066001)(6512007)(6666003)(6116002)(3280700002)(3846002)(86612001)(22906009)(217873001);DIR:OUT;SFP:1102;SCL:1;SRVR:DM5PR2101MB0920;H:DM5PR2101MB1032.namprd21.prod.outlook.com;FPR:;SPF:None;PTR:InfoNoRecords;MX:1;A:1;LANG:en; received-spf: None (protection.outlook.com: microsoft.com does not designate permitted sender hosts) x-microsoft-antispam-message-info: iSPtrzsfT25FAt5u67lrVmh4eGzVFAQfa0MrBlCtu/ZXWN5aJplh3E8GDV8PfXlsx7txGTbZGYS/TuZxTJL3DN4i66f3roImELmieumG6zDrFCSFjFBuvJVlTANnJMXZsvCELbpmuzwTP+5HLyGI1LjsXFF7e8Dpes95b57txVi9ah3XD8b0mqDOLA8UYpEoLrpog1wSK8wBFsj29IcOBAF620siuSXHOn9pW1W9D8YCPD+P5/vQ9Mf87e4IbHlrAcoFC+OjMMeais6UTiyEdF9FLwoysRCCh8675xAV2gnEHwxq/YQ62833pEuingInpnv5zYfoWqV83bWXfv5Rgg== spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: microsoft.com X-MS-Exchange-CrossTenant-Network-Message-Id: 5c702e16-35ba-4912-5636-08d584b16bcd X-MS-Exchange-CrossTenant-originalarrivaltime: 08 Mar 2018 04:58:02.1232 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 72f988bf-86f1-41af-91ab-2d7cd011db47 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR2101MB0920 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Lars Persson [ Upstream commit 6d6e71feb183aa588c849e20e7baa47cb162928a ] The IV size should not include the 32 bit counter. Because we had the IV size set as 16 the transform only worked when the IV input was zero padded. Fixes: a21eb94fc4d3 ("crypto: axis - add ARTPEC-6/7 crypto accelerator driv= er") Signed-off-by: Lars Persson Signed-off-by: Herbert Xu Signed-off-by: Sasha Levin --- drivers/crypto/axis/artpec6_crypto.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/crypto/axis/artpec6_crypto.c b/drivers/crypto/axis/art= pec6_crypto.c index 0f9754e07719..6eb5cb92b986 100644 --- a/drivers/crypto/axis/artpec6_crypto.c +++ b/drivers/crypto/axis/artpec6_crypto.c @@ -22,6 +22,7 @@ #include =20 #include +#include #include #include #include @@ -1934,7 +1935,7 @@ static int artpec6_crypto_prepare_aead(struct aead_re= quest *areq) =20 memcpy(req_ctx->hw_ctx.J0, areq->iv, crypto_aead_ivsize(cipher)); // The HW omits the initial increment of the counter field. - crypto_inc(req_ctx->hw_ctx.J0+12, 4); + memcpy(req_ctx->hw_ctx.J0 + GCM_AES_IV_SIZE, "\x00\x00\x00\x01", 4); =20 ret =3D artpec6_crypto_setup_out_descr(common, &req_ctx->hw_ctx, sizeof(struct artpec6_crypto_aead_hw_ctx), false, false); @@ -2956,7 +2957,7 @@ static struct aead_alg aead_algos[] =3D { .setkey =3D artpec6_crypto_aead_set_key, .encrypt =3D artpec6_crypto_aead_encrypt, .decrypt =3D artpec6_crypto_aead_decrypt, - .ivsize =3D AES_BLOCK_SIZE, + .ivsize =3D GCM_AES_IV_SIZE, .maxauthsize =3D AES_BLOCK_SIZE, =20 .base =3D { --=20 2.14.1