Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp610130ybz; Wed, 15 Apr 2020 15:05:54 -0700 (PDT) X-Google-Smtp-Source: APiQypKD36J4YFb8PiCv7u/vTgWxPZF34WpcCfDDmiQEXSW6B0xaf500FXZBL/3nyjS7b3EZER11 X-Received: by 2002:aa7:c2c3:: with SMTP id m3mr20324723edp.10.1586988354349; Wed, 15 Apr 2020 15:05:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1586988354; cv=none; d=google.com; s=arc-20160816; b=y5XyI/+OyXN7/8Z+lv04A1QxbVBm7Ycvtlxyqo4MnfV8XhPLOFRURSsGz7tIunUUz6 kBrbGdAAyEmqRcvO3VEkyCqrWMEceUIXf2PnFfy4I0FgH8LfIWhCwyzDX3gbwp2Fy8Jf foi1IWfqd86vTFBedpWG28NAU/C0qj8542+pBhiDL6JDdopYAbolILabONU85QHqmW0r 5zZhOnM21hyIPL/brjFE35s+LoYlFiwL6VUibpvYfwGvFhilEdd57AqwIJoyg+5HG2go ovi4JQxugclThSovJBy+GAKkj5XDlN3Tn8E7q5XsrdwuS2o8iD3I+FcpHH9BqzW3dzcN zuaw== 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:in-reply-to :mime-version:user-agent:date:message-id:from:references:cc:to :subject; bh=YhMnB4nr8a4+ewZ8boX4XNlZXuJH9Vz2PvrRkNePcVw=; b=CCE6ekqX1NhfcPDPvMDLkW4YNgPGtK8puXEsBbM0OpBPNbFb8X87nnpoc9IaBFzDmq QqHFMpl/oDDWGoDVkbICy5w7kVTgI5Zg5SxyeESVevnIhcRwyeuGSOhXp6ok/QaagvgT WUH+zFDRXVE/VdjbSN9Q7X6E2Ha879effZCIIaH4R6Q/LMw4cbKqIATf3xMcTKeB6gzA ub3AAu7hYKrelpDKLpumR0Izl+Y1US/I6ZL5haE5BZuzesfkqusPICv92rkvr88jJY6g M6y34pm7j2qVT/gxD1696LOrWIRc2yCdX3CIo69O9MCj5Sn+a0O2y5s3JN5QEAsk2pTU u9YA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=alibaba.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id e16si10800006ejr.309.2020.04.15.15.05.31; Wed, 15 Apr 2020 15:05:54 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=alibaba.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2393013AbgDOCxR (ORCPT + 99 others); Tue, 14 Apr 2020 22:53:17 -0400 Received: from out30-45.freemail.mail.aliyun.com ([115.124.30.45]:34352 "EHLO out30-45.freemail.mail.aliyun.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727839AbgDOCxO (ORCPT ); Tue, 14 Apr 2020 22:53:14 -0400 X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R171e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=e01e07425;MF=tianjia.zhang@linux.alibaba.com;NM=1;PH=DS;RN=10;SR=0;TI=SMTPD_---0Tva36kW_1586919187; Received: from 30.27.118.45(mailfrom:tianjia.zhang@linux.alibaba.com fp:SMTPD_---0Tva36kW_1586919187) by smtp.aliyun-inc.com(127.0.0.1); Wed, 15 Apr 2020 10:53:08 +0800 Subject: Re: [PATCH] ima: optimize ima_pcr_extend function by asynchronous To: Ken Goldman , zohar@linux.ibm.com, dmitry.kasatkin@gmail.com, jmorris@namei.org, serge@hallyn.com, zhangliguang@linux.alibaba.com, zhang.jia@linux.alibaba.com Cc: linux-integrity@vger.kernel.org, linux-security-module@vger.kernel.org, linux-kernel@vger.kernel.org References: <20200414115020.99288-1-tianjia.zhang@linux.alibaba.com> <0fdd1c13-51c6-e65c-1ca5-38621fa21f53@linux.ibm.com> From: Tianjia Zhang Message-ID: <7335613b-0a18-1c28-9b65-687d0b44d01f@linux.alibaba.com> Date: Wed, 15 Apr 2020 10:53:06 +0800 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:68.0) Gecko/20100101 Thunderbird/68.7.0 MIME-Version: 1.0 In-Reply-To: <0fdd1c13-51c6-e65c-1ca5-38621fa21f53@linux.ibm.com> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2020/4/15 2:07, Ken Goldman wrote: > I wonder if there's a different issue?? I just ran selftest with > fullTest = yes in two different TPM vendors. > > One took 230 msec, the other 320 msec. > > I've never seen anything near 10 seconds. > > Note that this is worse than the worst case because it's forcing a full > retest.? The TPM typically starts its self test immediately at power up > and could be complete by the time the OS starts to boot. > > When I run selftest with fullTest = no, I get 30 msec, probably > because it's not doing anything. > > On 4/14/2020 7:50 AM, Tianjia Zhang wrote: >> Because ima_pcr_extend() to operate the TPM chip, this process is >> very time-consuming, for IMA, this is a blocking action, especially >> when the TPM is in self test state, this process will block for up >> to ten seconds. > Ten seconds is an extreme scenario, and I haven't seen this worst case, but the TPM driver will fail to return in this scenario. Thanks and best, Tianjia