Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp311703ybl; Wed, 29 Jan 2020 00:40:15 -0800 (PST) X-Google-Smtp-Source: APXvYqxC6BjyB5k4JxkD1+y6/cMxolS8Plqzg72gGaLP5+pJ+U6WEJEckMiVSzvi2tXheUlMQuu0 X-Received: by 2002:a05:6830:15a:: with SMTP id j26mr19099910otp.137.1580287215090; Wed, 29 Jan 2020 00:40:15 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1580287215; cv=none; d=google.com; s=arc-20160816; b=z6nSOk+oBTjRGAy8k74QlCgbMXAYDM9+vrQWPcdUoopAoy24ranz16RWYXpUwfyiYB f6cbeiGbiFZWEUAL+n516avfmw2qeolyupcboU/DtfLe3tzvyuXdzIm2G8Uj2Lhi/Xja BaoLzPlGiMq/UvvjLDm/tIvaNFuzak6zDfBZ0D+CwwPZXyIu/Ms/dWExV+6lXZT+9qxq bzJODhzXMpJ3NMUHfwmAJaQEIpXdbFXgc0lK/S2ta6z3692zmz6y3uKnNzXNx316wzlw Xqc4gwYr7oiE8xucT5D0XLqIZeyo3ssC5INt6T8rBI5I1YnfLl70S+GAEpJiMi9JR1vj pfsA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:reply-to:message-id :subject:cc:to:from:date; bh=E7ACceyc5hvmubAqY3ht4H4Z2WzFoOztEerFNcasv8I=; b=Y5OBvx5t3p+x2nu3zDPPOvNKVMW1bzW/k7pmNztQN6kfP2u7VgXGv4Q/oW1NL8TXE6 FP/KX/TazmZGraZMyTosDVW+ogNS1+LuJfK9g3eGs7I1gU4fCROwy8Y/ihH28gJXAlHw xlO7KjQhRret7+93QHczyjGFXNXAdId9Toz0ORh41GsUXynBZLgEGzPqFlMlSchioMhO myEmyozuFQ6u/n/5qQFnyLRD0VI06KPY4sDh65fY3YfdJRnj/EyFhGmbt7l8NLsqJERq 5Qpz/yAtL6Smm+Rq5haOyO5KLCw33V4auZc9Db1qLFLiFlcWhizgtxzSIqJLH0sJgoEA k7kg== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id r22si772993oic.93.2020.01.29.00.40.02; Wed, 29 Jan 2020 00:40:15 -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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726216AbgA2IjL (ORCPT + 99 others); Wed, 29 Jan 2020 03:39:11 -0500 Received: from mx2.suse.de ([195.135.220.15]:44528 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726068AbgA2IjL (ORCPT ); Wed, 29 Jan 2020 03:39:11 -0500 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id 05C5AAFB7; Wed, 29 Jan 2020 08:39:08 +0000 (UTC) Date: Wed, 29 Jan 2020 09:39:05 +0100 From: Petr Vorel To: Roberto Sassu Cc: zohar@linux.ibm.com, jarkko.sakkinen@linux.intel.com, james.bottomley@hansenpartnership.com, linux-integrity@vger.kernel.org, linux-security-module@vger.kernel.org, linux-kernel@vger.kernel.org, silviu.vlasceanu@huawei.com Subject: Re: [PATCH 1/8] tpm: initialize crypto_id of allocated_banks to HASH_ALGO__LAST Message-ID: <20200129083905.GB387@dell5510> Reply-To: Petr Vorel References: <20200127170443.21538-1-roberto.sassu@huawei.com> <20200127170443.21538-2-roberto.sassu@huawei.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200127170443.21538-2-roberto.sassu@huawei.com> User-Agent: Mutt/1.12.2 (2019-09-21) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Roberto, > 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. Make sense. Reviewed-by: Petr Vorel Kind regards, Petr