Received: by 2002:a05:7412:cfc7:b0:fc:a2b0:25d7 with SMTP id by7csp2069335rdb; Tue, 20 Feb 2024 16:42:28 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCVswlSEZjWQ6Mla6DqguLx6wSnC06g3urktoY64QJuWQZpIdvA8UQcDOGjvR3Ad2xl96+AxI7+SvZgV64SSAEJ9GmBLxF8cfG0eZcxoKg== X-Google-Smtp-Source: AGHT+IFzFEHiybFc4nxov5r2AanFt3aq7aGwCqFAZ2RuTXp5wlykGM3svuwIf/l9eW18TvZOn0yf X-Received: by 2002:a05:6808:201a:b0:3c1:5fa3:ab8 with SMTP id q26-20020a056808201a00b003c15fa30ab8mr7124280oiw.39.1708476148299; Tue, 20 Feb 2024 16:42:28 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708476148; cv=pass; d=google.com; s=arc-20160816; b=FPj6W/yLatIQX3BbYD2YypKTLx7I019B8xi1Z/o3977n3SAluCWwtqssCWksNmS8W+ bioOxUpFYWnAsqaJM/xoUpRjRWn1f4osNdvGWHZ0jWwq297FRkbmwhbKYdc9FmIsel3/ tlnxz5QKww1jRoJ0AgsAjZ2jdhb79QKmHfafJSeqiBl+PR+T3LeyZ7QIqeuBmlaNCJEJ Il2MFQjxZ5NfxMmaRNfZDQQxlYtR8IGKWNFNdUmkBMvugJ5a86P1FjIP8a+Nf8NcQfwg nbzH7PBO3ZTAeJIDOmKc/qvZFrAqmDA3ilEvsPAIClxkUd4satEnJN25EkO3QuHNzHtx SlIQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:references:from:subject:cc:to:message-id:date :content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:dkim-signature; bh=JBQb1sMsoGkeddJqsEFbYc+H3thrjL5F2ctODi2FiXc=; fh=1esgbXzBI5S1YuKIuRfmI1pG/q5HH3r2Kfc+JLdWa5E=; b=V3la5SwLIRzBls05/i8gj0NniK60oCl6GZSjmY1r0vLqoB4nzLfs9FRZsrihavXY+2 gKdj++7cfdPozRZ5Dj0sAcNeLaeyj1H4A5iMKNHCbmzhQRBDcEbfEOwN4kIK8AjthoZ5 97nLHbPozm2Isc1vlce7udd51JLCfLQLjCoQd8aq54DOiYXDqMudbxU/VdliEwZtylWp pthpE0HqPWOZQ0RlUE0+CgnDICW8z1g0cy+Wk7QcQk+ahRBW16VA36fh8/nMa8CbOCRS ntlga31o3mGDWTYkS/XeYNj2AAqmXhMAncKTz6xnsV2HF/IDvMwZsW/cCrIiUE5pwjNs w2rg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=UD0dE66U; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-73872-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-73872-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id ck17-20020a056a02091100b005d8bb714e7csi7085169pgb.593.2024.02.20.16.42.28 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 20 Feb 2024 16:42:28 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-73872-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=UD0dE66U; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-73872-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-73872-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 02626284495 for ; Wed, 21 Feb 2024 00:42:28 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 1A5413D64; Wed, 21 Feb 2024 00:42:19 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="UD0dE66U" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 476F4259B; Wed, 21 Feb 2024 00:42:17 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708476138; cv=none; b=cKJU5NEox7fQi9RsPAVTFX1/LoGs7Zf9CRi+JxkgEmR6vWUxx89X3ZgGsCoMkj/gezV7Y8su8WddtT/IhSY+NYIkmQL2VUJh+3+L5IIuPo5H6GfYA+pcURdHxgK9+1Rv83GJirMrTT2laJenJg7zc9hi6K1a0+y+Sb6MYLP+VHo= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708476138; c=relaxed/simple; bh=Y3Wm7OwuVFt4aWjhjtNgPADfLE1yoIPV/Vl/eO3VRK0=; h=Mime-Version:Content-Type:Date:Message-Id:To:Cc:Subject:From: References:In-Reply-To; b=Y4xIC+2R0l06c+yCQV1JZ2Aha5L3AMTVfJo7WZwU1adXyd+OsePzphHqVMZRUvK3mFj8HA8nCAtPdYpItAHH3DANWWqG3CgTkC3HPqW5mjCEBLc/nhqI2lzAgiV7LMOfWQJAQUybdj++vh9Iony+NzFmW0HiBL8JpTf5vgAJB2I= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=UD0dE66U; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 76C38C433C7; Wed, 21 Feb 2024 00:42:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1708476137; bh=Y3Wm7OwuVFt4aWjhjtNgPADfLE1yoIPV/Vl/eO3VRK0=; h=Date:To:Cc:Subject:From:References:In-Reply-To:From; b=UD0dE66UmF+uiSs+1SjG/JUqr9qEaVSdd4Rdg/vl1XXX4RCvxr8NN3c5QQRk5l3w9 10M6Ia50KDodPYPJbctvmMH12v9hqMJk47QQTatxd2PIiRDFlfxYIJix3WAC1n7weF +XfimmmXutN4KUw5vkkiE+9xySK0UIfOYDMMZQhmFCgTPaIlFBMy/bedgz3w2w1N/1 nXq7IlHp8IAj0wHGZU51afuRKsmD5IVOhl53doczjW1KwVVX6i2qF9KBzQ7HoiBl7q 20D0tVWDPIpTsna1BYsi3kxSZbiskQJI8t5c2IuQKmLTWM+zCHluQyoYtNFuN5nAQe eRUzNlhdyQUZg== Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=UTF-8 Date: Wed, 21 Feb 2024 00:42:13 +0000 Message-Id: To: "Lino Sanfilippo" , "Alexander Steffen" , "Daniel P. Smith" , "Jason Gunthorpe" , "Sasha Levin" , , Cc: "Ross Philipson" , "Kanth Ghatraju" , "Peter Huewe" Subject: Re: [PATCH 1/3] tpm: protect against locality counter underflow From: "Jarkko Sakkinen" X-Mailer: aerc 0.15.2 References: <20240131170824.6183-1-dpsmith@apertussolutions.com> <20240131170824.6183-2-dpsmith@apertussolutions.com> <2ba9a96e-f93b-48e2-9ca0-48318af7f9b1@kunbus.com> <91f600ef-867b-4523-89be-1c0ba34f8a4c@kunbus.com> <9da1855b-eca2-4c11-a69d-e01494c985d1@kunbus.com> In-Reply-To: <9da1855b-eca2-4c11-a69d-e01494c985d1@kunbus.com> On Tue Feb 20, 2024 at 11:26 PM UTC, Lino Sanfilippo wrote: > > > On 20.02.24 23:31, Jarkko Sakkinen wrote: > > ATTENTION: This e-mail is from an external sender. Please check attachm= ents and links before opening e.g. with mouseover. > >=20 > >=20 > > On Tue Feb 20, 2024 at 10:26 PM UTC, Jarkko Sakkinen wrote: > >> On Tue Feb 20, 2024 at 8:54 PM UTC, Lino Sanfilippo wrote: > >>> for (i =3D 0; i <=3D MAX_LOCALITY; i++) > >>> __tpm_tis_relinquish_locality(priv, i); > >> > >> I'm pretty unfamiliar with Intel TXT so asking a dummy question: > >> if Intel TXT uses locality 2 I suppose we should not try to > >> relinquish it, or? > >> > >> AFAIK, we don't have a symbol called MAX_LOCALITY. > >=20 > > OK it was called TPM_MAX_LOCALITY :-) I had the patch set applied > > in one branch but looked up with wrong symbol name. > >=20 > > Sorry for the confusion. The code was just meant to sketch a solution, it= was=20 > written out of my head and I just remembered that Daniels patch set intro= duced > some define for the max number of the localities. I did not look up the c= orrect > name though. NP BR, Jarkko