Received: by 2002:ac0:a582:0:0:0:0:0 with SMTP id m2-v6csp720648imm; Mon, 1 Oct 2018 17:59:04 -0700 (PDT) X-Google-Smtp-Source: ACcGV61vqV5q0BZp45h3SB+SO8vSwCj2kse9FcEi/3bGh4nzFF5n1t6j9qcfq6iD1B7CBmAJyalN X-Received: by 2002:a62:d286:: with SMTP id c128-v6mr13937497pfg.14.1538441944168; Mon, 01 Oct 2018 17:59:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1538441944; cv=none; d=google.com; s=arc-20160816; b=R5vUcl7GDFOzbbGbmlUNygPuIcxu3Cu96ugSBxK5WfzNubxFn4NXVT5yff6SUi//47 hTHBDrd6bMQKMvybFGrbnJLkGxmi6j+WIuJ5Xq7gnxyfyNCHPb2PXQMUItaqWtJlgNDh D/rF/S8Y8A6wRa6izNDCweqf8ltOo1dxHIk6gDFgN3tfWMCkn6Bu6rmnepooyohj/HhC 42bxJfF5HEeiUjhbnlERPWRuY0yVCSLSvZuSK2TII9Qm7U8cLxTl2s+ikflA7kAy0ecF OqS0wc1x7Vg8B/9WPk6gxu2Wcatga6OHFFaUqjW4NK+obNrDf5SIYAn1fqvpfdHRRZGi oyLg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:organization:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=+Ps1NS+2688MKV6dKSv/TFOpw5GBLtfRg83xw28G/Z4=; b=afSV5oxouSRD04wlbqyUi8sOUlnCEq4n8tAMx34vzhqU/2xP9wXO7MfAZG0W1mvALE pHmSQeCkORqjN3GuTQFkNiUUeyFwRiNHDSiVwULVzljjXjv/sj5f0B71nhiG9ViNDitc KvIOqFPecRzNI4bWlkeOgx48cVaL9S+91/HtljfUCcoo+IqUFo4YKtF3qT4iTWGM7ZUT 1JkU81iDC5g358G+v5btFKfKnug3fsqF9KcgFGKcGaOEnJcdRtXc2CEoLjUsgD5V1Iaj dtraG2J8ZcA4J7MqjKw5Mr3cfRKqqrWynsP9sCQmETE8VpIt0F/nTZKUlfV4gmjHqidj QZdw== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f8-v6si12796258pgg.60.2018.10.01.17.58.49; Mon, 01 Oct 2018 17:59:04 -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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726836AbeJBHjN (ORCPT + 99 others); Tue, 2 Oct 2018 03:39:13 -0400 Received: from mga01.intel.com ([192.55.52.88]:28276 "EHLO mga01.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726748AbeJBHjM (ORCPT ); Tue, 2 Oct 2018 03:39:12 -0400 X-Amp-Result: UNKNOWN X-Amp-Original-Verdict: FILE UNKNOWN X-Amp-File-Uploaded: False Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by fmsmga101.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 01 Oct 2018 17:58:43 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.54,329,1534834800"; d="scan'208";a="267604488" Received: from hubermic-mobl.ger.corp.intel.com (HELO localhost) ([10.252.54.31]) by fmsmga005.fm.intel.com with ESMTP; 01 Oct 2018 17:58:38 -0700 Date: Tue, 2 Oct 2018 03:58:37 +0300 From: Jarkko Sakkinen To: Tomas Winkler Cc: Jason Gunthorpe , Nayna Jain , Alexander Usyskin , Tadeusz Struk , linux-integrity@vger.kernel.org, linux-security-module@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v5 21/21] tpm: use u32 instead of int for PCR index Message-ID: <20181002005837.GJ23753@linux.intel.com> References: <20180928223035.14471-1-tomas.winkler@intel.com> <20180928223035.14471-22-tomas.winkler@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180928223035.14471-22-tomas.winkler@intel.com> Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo User-Agent: Mutt/1.9.4 (2018-02-28) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, Sep 29, 2018 at 01:30:35AM +0300, Tomas Winkler wrote: > The TPM specs defines PCR index as a positive number, and there is > no reason to use a signed number. It is also a possible security > issue as currently no functions check for a negative index, > which may become a large number when converted to u32. > > Adjust the API to use u32 instead of int in all PCR related > functions. > > Signed-off-by: Tomas Winkler > Reviewed-by: Jarkko Sakkinen Tested-by: Jarkko Sakkinen /Jarkko