Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp1505201ybl; Thu, 30 Jan 2020 00:48:56 -0800 (PST) X-Google-Smtp-Source: APXvYqxAKjopMB6INRTX+frw+CRpsJVsJ8kgOobwVnsCd2DdbuabNjoX+ZRx8JQvx/n6fjE9TkYb X-Received: by 2002:a9d:831:: with SMTP id 46mr2774862oty.295.1580374136066; Thu, 30 Jan 2020 00:48:56 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1580374136; cv=none; d=google.com; s=arc-20160816; b=Kb8+GckemM1Grtq7J7k8dlRybKHUPwTgJ58Ch5+AjtAu0dr2rH+OTdNp9Zu03f2v0C WTNqDFahnKnVXJYdn5YszYwRFD40TyZewxWpuBeFxmvQw+A0fKJzLZ7MSZi90GWKoNK7 BjWXFeJlikeC/Fa8oGrVL4GQPJbBTUmKV3U7wTyoY6gdhNiz88Z/9j8owCCsNMPt/6CT 2gIvdwgDXnmjX2jaF4fH0zIfge8xARtIhVTgUH7MLIyYNXYbGzGSxMHLzKJxAm+ww0ze zKZmX6Y/IRxHvP51tigL8aAv7TszlQgFArRTWfOL31Nsvc9IczBjWUglJVrQsbAzWhvO 54+g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:organization:references:in-reply-to:date:cc:to:from :subject:message-id; bh=xwBDrB88owhKpYpaulj+dkoV7FhREhNX6QDxQAsjLrA=; b=QD97UMUyuCdKbFJi2m2/Plqckr7FRGZ8ZBBoAtNT3kHQ4SAat8TQEMltm/rT0P6adT mZQIkSfxgW+DhR8nrfN3J8w4BybOmdH5Cikm9g3lY3C2VVy3XyiRrfIwzcfOBtnKLvUi SlO2zrR87YebTmu8KjDxDXy/nnPApTUYj2u1X4rFtOUmCEXPvaElclSzDS88Ier8eGgn dlwsVF2Up22EyBG7ryt1rUJnR1p0b/eayh6Fx+LYlOjN1nI96X2ykeH15oIkpWvpZq78 xS5VD79Ez1kbDcwGSP5R19pI8stgerntGUiksq5vyp+x019C8mhAGfiY3treOHB9JacF GGcQ== 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 o66si2560334oig.193.2020.01.30.00.48.43; Thu, 30 Jan 2020 00:48:56 -0800 (PST) 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 S1726916AbgA3Iru (ORCPT + 99 others); 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: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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