Received: by 2002:a25:86ce:0:0:0:0:0 with SMTP id y14csp217964ybm; Wed, 22 May 2019 01:51:47 -0700 (PDT) X-Google-Smtp-Source: APXvYqzw0Iwhkuv9dXGqCgXxdY+XvVgpAjezRBinvbkLNFb1fS3DfFLPm4KornEhhykKDdoP8g1f X-Received: by 2002:aa7:8ec6:: with SMTP id b6mr94457168pfr.234.1558515107495; Wed, 22 May 2019 01:51:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1558515107; cv=none; d=google.com; s=arc-20160816; b=C3dz1F0XwKmkdwI1hR4DzibvcNX6cJz31EPGlfYYiWjc0EAKHy3st5H5FwjusEyxv1 TOsTNNJVNRvWYSYM9f6TV21Sa3is9C8ZGz4EgSi5y4I80vgDBn1el/nx2iILAMiQ55wq l698bAiyKPmM7gJcju/zaiqIdFNKwxW0fW0cOeQ3k/hHVbeYJSqvdavBkQLVsfMo4Q4e HyvHhHmvXUphqFnX7gZaKFDPi/3Wgkc25rNY7F9u57ptYrHtznsHTRZOACF832R7PyhU Ag0j+uKvY9Sr0elUIKv6/eYvyzlyeMc2NbINmNe4Xm9VbNWHtWQ9DiqZJun4V/GV4JRZ u6xw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=/mV9GiscZg2I4Sn/M4sO4XGjVtqE3HmAjNWXJmItBCc=; b=tVrEpalDGoYqMYFGKuXR8AbdnEcD95pQVJKqoWfmuOxGu4beWGdYthw6s64WDv1MeZ 3hTUwTbWEs7k6a3G13978qjWGS2063xL/SWKq0SS2Npq91U6kemYA4dZy+M1LMbwSD6d 0psm0JB9oTrn6UYNtWsOASDDeok1K8aIPJ/VG1qcpC59WVNddLUwk05WW+zhhWDLtmjo 5ehg79bkRG3cUcwSdXxGQwdp2G2WYRIzPx/DaUuF6cjxIBqIhpkAJ+cthJwG0WxzjfSu JVycRgTf2NUvFblM9JIxx5Vv3wV/4xNdOYUd00XK0EhqXoe1qoTzlknt7wmRCrHxoHW/ MAug== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f10si23610512pgm.425.2019.05.22.01.51.31; Wed, 22 May 2019 01:51:47 -0700 (PDT) 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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728743AbfEVIuA (ORCPT + 99 others); Wed, 22 May 2019 04:50:00 -0400 Received: from atrey.karlin.mff.cuni.cz ([195.113.26.193]:41991 "EHLO atrey.karlin.mff.cuni.cz" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728501AbfEVIt7 (ORCPT ); Wed, 22 May 2019 04:49:59 -0400 Received: by atrey.karlin.mff.cuni.cz (Postfix, from userid 512) id EAC9D80375; Wed, 22 May 2019 10:49:46 +0200 (CEST) Date: Wed, 22 May 2019 10:49:56 +0200 From: Pavel Machek To: Greg Kroah-Hartman Cc: linux-kernel@vger.kernel.org, stable@vger.kernel.org, Gilad Ben-Yossef , Herbert Xu Subject: Re: [PATCH 4.19 046/105] crypto: ccree - dont map MAC key on stack Message-ID: <20190522084956.GA8174@amd> References: <20190520115247.060821231@linuxfoundation.org> <20190520115250.198221588@linuxfoundation.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="6c2NcOVqGQ03X4Wi" Content-Disposition: inline In-Reply-To: <20190520115250.198221588@linuxfoundation.org> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --6c2NcOVqGQ03X4Wi Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hi! > The MAC hash key might be passed to us on stack. Copy it to > a slab buffer before mapping to gurantee proper DMA mapping. >=20 > Signed-off-by: Gilad Ben-Yossef > Cc: stable@vger.kernel.org # v4.19+ > Signed-off-by: Herbert Xu > Signed-off-by: Greg Kroah-Hartman >=20 > --- > drivers/crypto/ccree/cc_hash.c | 24 +++++++++++++++++++++--- > 1 file changed, 21 insertions(+), 3 deletions(-) >=20 > --- a/drivers/crypto/ccree/cc_hash.c > +++ b/drivers/crypto/ccree/cc_hash.c > @@ -64,6 +64,7 @@ struct cc_hash_alg { > struct hash_key_req_ctx { > u32 keylen; > dma_addr_t key_dma_addr; > + u8 *key; > }; > =20 > /* hash per-session context */ AFAICT, key is used just as a local variable in cc_hash_setkey() and cc_xcbc_setkey() functions. Could we make it local variable to save a bit of memory (and make code less confusing)? Thanks, Pavel --=20 (english) http://www.livejournal.com/~pavelmachek (cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blo= g.html --6c2NcOVqGQ03X4Wi Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iEYEARECAAYFAlzlDTQACgkQMOfwapXb+vIQ0QCcDSSdcT4Tv7b1+R4FFx0y7il2 IVsAnis8HV7aeF0xFoyRUiImbljnMOKD =UK2z -----END PGP SIGNATURE----- --6c2NcOVqGQ03X4Wi--