Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp1116110pxj; Sat, 15 May 2021 04:28:08 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy9qgQ7zjfTooySYg7xJ1bVnrynBjcEZnYx5QGofajcq9mRE5gkFilTPCxARHNdc7H2tdR0 X-Received: by 2002:a17:906:2dcd:: with SMTP id h13mr7093874eji.41.1621078087796; Sat, 15 May 2021 04:28:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621078087; cv=none; d=google.com; s=arc-20160816; b=VnhxauhAoz34wut6tirsak/1L21VvMa9IuBG44d0bCDCZ0N410LqaKgicGBVrScDGm bAbqk3iSJ1hO7nhb2rfSfBATYzA+iSJVMX7YWBrFSadev05wH5lHVW2pRmH1S5TUR9lG RK+FkMrUT9Cg71ih/Ri9UoF8NyApuB7SVd4EEge8qhCn0bMfnLeBOYNPDkvEH35lVUlG GVg9MydKzrjPsVtuR/TKJFkBkfnkQYq26k3bwAIr0zvXgPrZ7464Yrt21Eqt+bXXquOh AuuJP/gD/r5sh9+Av4C1gofUAvMGV8NhgQEnWjIpk/ZJDE1bNwt9yczyElHugjyAoPVc udiQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=AQlq6T8K5v991sN+1HLzPgvsy4RlTL5re9BD1hQ9EUU=; b=aiYzE3Egf/BtQIKMfNSkeE/vSBg/O1DHOPAOgsU+e8YDt9qH0jgJ/ApgbcSzII1t8U MlOrNMxx+nQiv114t7fuvTeWMM2kk5kONhUpsNolcolU9kCkbvjtF15DtbDlZcZnUNov VON+BK3a55hEagxQxlAW8iSDMS+P+M2gwoY12CVv2qT3H/7uu+XCcUkooHq8w/tBYy6M MH94pU3CqZuFM3RRmar+P1BgeW8P9m8H0LLVEt0i1E6OuJv5BP3M5kULqNVnQxzhcRh/ tq1Dg3aYJI5XDkge2Lfej+xIfq95DkdxhoNY/Krd+zTeM/VTNBI07elxjtfsimZW+CYn JAZw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id re15si5039282ejb.120.2021.05.15.04.27.44; Sat, 15 May 2021 04:28:07 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231858AbhEOIWn (ORCPT + 99 others); Sat, 15 May 2021 04:22:43 -0400 Received: from jabberwock.ucw.cz ([46.255.230.98]:49044 "EHLO jabberwock.ucw.cz" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230403AbhEOIWl (ORCPT ); Sat, 15 May 2021 04:22:41 -0400 Received: by jabberwock.ucw.cz (Postfix, from userid 1017) id 516C51C0B80; Sat, 15 May 2021 10:21:28 +0200 (CEST) Date: Sat, 15 May 2021 10:21:27 +0200 From: Pavel Machek To: Greg Kroah-Hartman Cc: linux-kernel@vger.kernel.org, stable@vger.kernel.org, James Bottomley , Jarkko Sakkinen , Sasha Levin Subject: Re: [PATCH 5.10 258/530] security: keys: trusted: fix TPM2 authorizations Message-ID: <20210515082127.GB30461@amd> References: <20210512144819.664462530@linuxfoundation.org> <20210512144828.313826968@linuxfoundation.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="eAbsdosE1cNLO4uF" Content-Disposition: inline In-Reply-To: <20210512144828.313826968@linuxfoundation.org> User-Agent: Mutt/1.5.23 (2014-03-12) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --eAbsdosE1cNLO4uF Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hi! > [ Upstream commit de66514d934d70ce73c302ce0644b54970fc7196 ] >=20 > In TPM 1.2 an authorization was a 20 byte number. The spec actually > recommended you to hash variable length passwords and use the sha1 > hash as the authorization. Because the spec doesn't require this > hashing, the current authorization for trusted keys is a 40 digit hex > number. For TPM 2.0 the spec allows the passing in of variable length > passwords and passphrases directly, so we should allow that in trusted > keys for ease of use. Update the 'blobauth' parameter to take this > into account, so we can now use plain text passwords for the keys. I guess break should now be deleted. If tools don't warn about this, they should. > + if (tpm2 && opt->blobauth_len <=3D sizeof(opt->blobauth)) { > + memcpy(opt->blobauth, args[0].from, > + opt->blobauth_len); > + break; > + } > + > + return -EINVAL; > + > break; > + Best regards, Pavel --=20 DENX Software Engineering GmbH, Managing Director: Wolfgang Denk HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany --eAbsdosE1cNLO4uF Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iEYEARECAAYFAmCfhIcACgkQMOfwapXb+vKm2ACggno1RliLzNtetFUyIS8ckHrV ehkAoMRtT8jnuTV6ppswHlCuIDqysQ7U =l6dO -----END PGP SIGNATURE----- --eAbsdosE1cNLO4uF--