From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.3 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_PASS,USER_AGENT_MUTT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1FE14C43143 for ; Tue, 2 Oct 2018 00:58:45 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id E0DC221471 for ; Tue, 2 Oct 2018 00:58:44 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org E0DC221471 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linux.intel.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726862AbeJBHjN (ORCPT ); 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