Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp1299828imu; Wed, 16 Jan 2019 16:42:55 -0800 (PST) X-Google-Smtp-Source: ALg8bN5jD82BFU7CjcQw3Wk5TPlFrhDgzq2ZRUeXkak2eH9bsGN8r3+bg+NhkPCUs/+jwqO9hYX9 X-Received: by 2002:aa7:84d3:: with SMTP id x19mr12655053pfn.220.1547685775121; Wed, 16 Jan 2019 16:42:55 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1547685775; cv=none; d=google.com; s=arc-20160816; b=Tgkj8HWnDZTPFss3PKM7Dy140mCZTU/6VYteq7ajEUG9NXFqmsGfMBQ6YBvGv4mmBP uK1/Y3oEaKATNnGfPX6A8yioREa5utTdG8fyAPjU97fXK0/WUEZ324QoduGS6nGm92Eq fgklSjEPi1czXhptgcr1v8j3IBGeOTSkShqTjBBYX3baj/+LWexUsBGixH/AkLbluRFJ N99hBV28QcUQrV9dTHmjlizhX+9ZvSmgAW9T5w1nzkdd9Fz/iznNVrsuVXczKYP/hXT7 iwo2fnM3OG8nj2OVwVmLQJaO+fc0/kOijUu2wtzlnQH+5A76JaZ6lEm02ruQHygtmRtp QRgQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:organization:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=U0Bv46vRBsl8evtuQaRmmtHELkRs0mUy/rql3C3FAjw=; b=RQ0xlC2GPpvwoHffziKUTFNNH6QEwwJUPESGv1vn4rNRMeojXXyKTOHhD9P6ta69Bv KGZl6CqjTtA5HpuwdA10nw2ik7LCKysAW3EqZ3xMKt4Eay/e/QTe2KG7070XnaCHQs3T X20hNK85HkdetaTO8zRI9aBXnENsdnNbAZsU7U2d/zJz6JKlUUCZhRfzcS92tvdbPxA2 B69ew/mehRehPH0M29k8bsiomC5bVNnYcCV1aJGJwrHLjT3XEyHQFfDdq9Ut4zw+Bksl QWU6HePcmEDGkx6s/tamA38Te3gT/JKDTGJC0KGhdZyVY29uMMKsy+YH8vHWRmw4/kth 8vDQ== 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 127si7736303pfg.173.2019.01.16.16.42.39; Wed, 16 Jan 2019 16:42:55 -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 S1731046AbfAPWKA (ORCPT + 99 others); Wed, 16 Jan 2019 17:10:00 -0500 Received: from mga12.intel.com ([192.55.52.136]:17250 "EHLO mga12.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727935AbfAPWJ7 (ORCPT ); Wed, 16 Jan 2019 17:09:59 -0500 X-Amp-Result: UNKNOWN X-Amp-Original-Verdict: FILE UNKNOWN X-Amp-File-Uploaded: False Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by fmsmga106.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 16 Jan 2019 14:09:59 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.56,487,1539673200"; d="scan'208";a="126429381" Received: from lhaqq1-mobl2.amr.corp.intel.com (HELO localhost) ([10.249.254.231]) by FMSMGA003.fm.intel.com with ESMTP; 16 Jan 2019 14:09:55 -0800 Date: Thu, 17 Jan 2019 00:09:52 +0200 From: Jarkko Sakkinen To: Jia Zhang Cc: peterhuewe@gmx.de, jgg@ziepe.ca, tweek@google.com, linux-integrity@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 1/2] tpm/eventlog/tpm1: Simplify walking over *pos measurements Message-ID: <20190116220952.GH25803@linux.intel.com> References: <1547197173-52826-1-git-send-email-zhang.jia@linux.alibaba.com> <1547197173-52826-2-git-send-email-zhang.jia@linux.alibaba.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1547197173-52826-2-git-send-email-zhang.jia@linux.alibaba.com> Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Please use "tpm:" tag for commits, not "tpm/eventlog/tpm1". On Fri, Jan 11, 2019 at 04:59:32PM +0800, Jia Zhang wrote: > The responsibility of tpm1_bios_measurements_start() is to walk > over the first *pos measurements, ensuring the skipped and > to-be-read measurements are not out-of-boundary. > > Current logic is complicated a bit. Just employ a do-while loop > with necessary sanity check, and then get the goal. > > Signed-off-by: Jia Zhang What does this fix? Even if the current logic is "complicated", it is still a pretty simple functiion. Applying clean ups for fun has the side-effect of making backporting more difficult. And swapping implementation randomly has the side-effect of potentially introducing regressions. The current code might be messy but it is still field tested. I'm sorry but I have to reject this patch. /Jarkko