Received: by 2002:a25:b794:0:0:0:0:0 with SMTP id n20csp709094ybh; Sat, 3 Aug 2019 08:10:43 -0700 (PDT) X-Google-Smtp-Source: APXvYqxbMmbsSZ7J3YlIVh4s73qVPijzBbJcxBS8cnz9olR9IXZFvLcOZlFNIwIFsD+M5CtVuU42 X-Received: by 2002:a65:6102:: with SMTP id z2mr128070641pgu.391.1564845043534; Sat, 03 Aug 2019 08:10:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1564845043; cv=none; d=google.com; s=arc-20160816; b=UbWYwVhywRMFvAL8JK07S1m1sK3OpM+361aGOtWWKlQASS+HgewBqtiJo6waDEmvkx C6s6T4jpAJdR7ZkT+FFSA9apUeor0WsEw7h58+35I5ctswApj8czaOCsi7JWc9htIrWw eVg3bLkqvNvrGltnTMLK6wGwnRD6FI/ioOAueIcihNNjWAcXU5f6tceA+7YU2YdM8mtS 0LDe5oO72RKIXmijVtw5xLBcoygdaTjveOtZuAX7/RUVxMs415TkoDhDWTH4qH83to5z 5PWAU0mZSgDV99OeZwE1+V4TEJ3VepK2/AKjjhIov6/k2Srmp54X8u93CjJ2W1zjIZU7 KuWg== 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 :content-language:in-reply-to:mime-version:user-agent:date :message-id:references:cc:to:from:subject; bh=3oxcKLfvJrlecjkfvQn1XJjPYmDkf8JI4mAmkt30cdY=; b=SPqxdpBi2NEqUY97cvEJsx8xqq96WkX9f9BbUTQKARXWRuR/XI0Azmbcoz8T5MZWuz txaFAg4D8C2HHmOXiU2nwm+XEnr0S/KP4NBpJ11E5BYVvOq4yur9zFF49wOmkpHrjsKa yLrcLxk+Bag6N1WSufTOuD4vTv1nnaygM0kp11cemv1F9Y01mrKB2bskDrNq4yiH7gv7 jH9GC5zcdsgT5rmCMs6n+Sm+/LtlFep32vQE8oRcyMSEI77wy4azdwafZrV4o4SWbjQh dOP3rndhGBcfM3gFxmnfqVKyg65enFz1GbRVRxFHdoLAeU8r5QmBsToiX5w9rrAkqA7F 7oMA== 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 o61si39273611plb.0.2019.08.03.08.10.28; Sat, 03 Aug 2019 08:10:43 -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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2390172AbfHBQLM (ORCPT + 99 others); Fri, 2 Aug 2019 12:11:12 -0400 Received: from lhrrgout.huawei.com ([185.176.76.210]:33111 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1732543AbfHBQLL (ORCPT ); Fri, 2 Aug 2019 12:11:11 -0400 Received: from LHREML714-CAH.china.huawei.com (unknown [172.18.7.107]) by Forcepoint Email with ESMTP id C1C8DC64785C6836DBC4; Fri, 2 Aug 2019 17:11:09 +0100 (IST) Received: from [10.220.135.74] (10.220.135.74) by smtpsuk.huawei.com (10.201.108.37) with Microsoft SMTP Server (TLS) id 14.3.408.0; Fri, 2 Aug 2019 17:11:03 +0100 Subject: Re: [PATCH v2] KEYS: trusted: allow module init if TPM is inactive or deactivated From: Roberto Sassu To: Tyler Hicks CC: , , , , , , , , , , References: <20190802150733.1972-1-roberto.sassu@huawei.com> <20190802153030.GB26616@elm> <3222714a-a280-0708-f4c0-5db6d342d8dc@huawei.com> Message-ID: <8baf1c39-ad04-5cd6-bc67-341e7411db16@huawei.com> Date: Fri, 2 Aug 2019 18:11:09 +0200 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.3.0 MIME-Version: 1.0 In-Reply-To: <3222714a-a280-0708-f4c0-5db6d342d8dc@huawei.com> Content-Type: text/plain; charset="utf-8"; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit X-Originating-IP: [10.220.135.74] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 8/2/2019 5:34 PM, Roberto Sassu wrote: > On 8/2/2019 5:30 PM, Tyler Hicks wrote: >> On 2019-08-02 17:07:33, Roberto Sassu wrote: >>> Commit c78719203fc6 ("KEYS: trusted: allow trusted.ko to initialize >>> w/o a >>> TPM") allows the trusted module to be loaded even a TPM is not found to >>                                                     ^ if >> >>> avoid module dependency problems. >>> >>> However, trusted module initialization can still fail if the TPM is >>> inactive or deactivated. This patch ignores tpm_get_random() errors in >>> init_digests() and returns -EFAULT in pcrlock() if the TPM didn't return >>> random data. >>> >>> Signed-off-by: Roberto Sassu >> >> The code changes look correct to me. >> >>    Reviewed-by: Tyler Hicks >> >> For whoever takes this patch through their tree, I think that adding the >> following Fixes tag would be useful (as well as cc'ing stable): >> >>    Fixes: 240730437deb ("KEYS: trusted: explicitly use tpm_chip >> structure...") >> >> I think it is also worth leaving a short note, in the commit message, >> for backporters that commit 782779b60faa ("tpm: Actually fail on TPM >> errors during "get random"") should be included with any backports of >> this patch. > > Right, thanks. I wait for Jarkko's comments and I add both the Fixes tag > and the short note in the next version of the patch. Uhm, I was thinking that maybe it is not necessary to mention commit 782779b60faa. This patch would still return 0 even if that commit is not backported (TPM_ERR_DISABLED < TPM_MAX_DIGEST_SIZE). Roberto -- HUAWEI TECHNOLOGIES Duesseldorf GmbH, HRB 56063 Managing Director: Li Peng, Li Jian, Shi Yanli