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=-3.8 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS autolearn=no 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 2A232C33C9E for ; Thu, 30 Jan 2020 08:47:51 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id EF82E206D5 for ; Thu, 30 Jan 2020 08:47:50 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726871AbgA3Iru (ORCPT ); Thu, 30 Jan 2020 03:47:50 -0500 Received: from mga04.intel.com ([192.55.52.120]:25438 "EHLO mga04.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726757AbgA3Iru (ORCPT ); Thu, 30 Jan 2020 03:47:50 -0500 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga006.jf.intel.com ([10.7.209.51]) by fmsmga104.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 30 Jan 2020 00:47:49 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.70,381,1574150400"; d="scan'208";a="232840310" Received: from kvehmane-mobl.ger.corp.intel.com (HELO jsakkine-mobl1) ([10.237.50.119]) by orsmga006.jf.intel.com with ESMTP; 30 Jan 2020 00:47:45 -0800 Message-ID: <50afe1f50297b02af52621b6738ffff0c24f1bdf.camel@linux.intel.com> Subject: Re: [PATCH 1/8] tpm: initialize crypto_id of allocated_banks to HASH_ALGO__LAST From: Jarkko Sakkinen To: Roberto Sassu , zohar@linux.ibm.com, james.bottomley@hansenpartnership.com, linux-integrity@vger.kernel.org Cc: linux-security-module@vger.kernel.org, linux-kernel@vger.kernel.org, silviu.vlasceanu@huawei.com Date: Thu, 30 Jan 2020 10:47:44 +0200 In-Reply-To: <20200127170443.21538-2-roberto.sassu@huawei.com> References: <20200127170443.21538-1-roberto.sassu@huawei.com> <20200127170443.21538-2-roberto.sassu@huawei.com> Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.34.1-2 MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: owner-linux-security-module@vger.kernel.org Precedence: bulk List-ID: On Mon, 2020-01-27 at 18:04 +0100, Roberto Sassu wrote: > chip->allocated_banks contains the list of TPM algorithm IDs of allocated > PCR banks. It also contains the corresponding ID of the crypto subsystem, > so that users of the TPM driver can calculate a digest for a PCR extend > operation. > > However, if there is no mapping between TPM algorithm ID and crypto ID, the > crypto_id field in chip->allocated_banks remains set to zero (the array is > allocated and initialized with kcalloc() in tpm2_get_pcr_allocation()). > Zero should not be used as value for unknown mappings, as it is a valid > crypto ID (HASH_ALGO_MD4). > > This patch initializes crypto_id to HASH_ALGO__LAST. > > Signed-off-by: Roberto Sassu --- Remarks: * After the subsystem tag, short summary starts with a capital lettter. * Missing fixes tag and cc tag to stable. * A struct called allocated_banks does not exist. * Please prefer using an imperative sentence when describing the action to take e.g. "Thus, initialize crypto_id to HASH_ALGO__LAST". /Jarkko