From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.8 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id B33FCC3F2D1 for ; Thu, 5 Mar 2020 11:21:06 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 9061D2166E for ; Thu, 5 Mar 2020 11:21:06 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726101AbgCELVG (ORCPT ); Thu, 5 Mar 2020 06:21:06 -0500 Received: from mga03.intel.com ([134.134.136.65]:13005 "EHLO mga03.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725953AbgCELVG (ORCPT ); Thu, 5 Mar 2020 06:21:06 -0500 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga008.jf.intel.com ([10.7.209.65]) by orsmga103.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 05 Mar 2020 03:21:05 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.70,517,1574150400"; d="scan'208";a="234385081" Received: from unknown (HELO jsakkine-mobl1) ([10.237.50.161]) by orsmga008.jf.intel.com with ESMTP; 05 Mar 2020 03:21:02 -0800 Message-ID: Subject: Re: [PATCH v6 2/3] tpm: ibmvtpm: Wait for buffer to be set before proceeding From: Jarkko Sakkinen To: Stefan Berger , linux-integrity@vger.kernel.org Cc: aik@ozlabs.ru, david@gibson.dropbear.id.au, linux-kernel@vger.kernel.org, nayna@linux.vnet.ibm.com, gcwilson@linux.ibm.com, jgg@ziepe.ca, Stefan Berger Date: Thu, 05 Mar 2020 13:21:03 +0200 In-Reply-To: <20200304132243.179402-3-stefanb@linux.vnet.ibm.com> References: <20200304132243.179402-1-stefanb@linux.vnet.ibm.com> <20200304132243.179402-3-stefanb@linux.vnet.ibm.com> Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.35.92-1 MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: linux-integrity-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-integrity@vger.kernel.org On Wed, 2020-03-04 at 08:22 -0500, Stefan Berger wrote: > From: Stefan Berger > > Synchronize with the results from the CRQs before continuing with > the initialization. This avoids trying to send TPM commands while > the rtce buffer has not been allocated, yet. > > This patch fixes an existing race condition that may occurr if the > hypervisor does not quickly respond to the VTPM_GET_RTCE_BUFFER_SIZE > request sent during initialization and therefore the ibmvtpm->rtce_buf > has not been allocated at the time the first TPM command is sent. > > Fixes: 132f76294744 ("Add new device driver to support IBM vTPM") > Signed-off-by: Stefan Berger Reviewed-by: Jarkko Sakkinen /Jarkko