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=-5.3 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=unavailable 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 490C5C4CEC7 for ; Mon, 16 Sep 2019 07:47:08 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 28F1620650 for ; Mon, 16 Sep 2019 07:47:08 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729197AbfIPHrE (ORCPT ); Mon, 16 Sep 2019 03:47:04 -0400 Received: from mga18.intel.com ([134.134.136.126]:15975 "EHLO mga18.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726316AbfIPHrE (ORCPT ); Mon, 16 Sep 2019 03:47:04 -0400 X-Amp-Result: UNKNOWN X-Amp-Original-Verdict: FILE UNKNOWN X-Amp-File-Uploaded: False Received: from orsmga005.jf.intel.com ([10.7.209.41]) by orsmga106.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 16 Sep 2019 00:47:03 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.64,510,1559545200"; d="scan'208";a="361450315" Received: from sshkruni-mobl.ccr.corp.intel.com (HELO localhost) ([10.249.38.138]) by orsmga005.jf.intel.com with ESMTP; 16 Sep 2019 00:46:59 -0700 Date: Mon, 16 Sep 2019 10:46:57 +0300 From: Jarkko Sakkinen To: linux-integrity@vger.kernel.org Cc: Mimi Zohar , stable@vger.kernel.org, Peter Huewe , Jason Gunthorpe , Arnd Bergmann , Greg Kroah-Hartman , open list Subject: Re: [PATCH] tpm: Fix tpm_send() length calculation Message-ID: <20190916074657.GA26795@linux.intel.com> References: <20190916073535.25117-1-jarkko.sakkinen@linux.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190916073535.25117-1-jarkko.sakkinen@linux.intel.com> Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-integrity-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-integrity@vger.kernel.org On Mon, Sep 16, 2019 at 10:35:35AM +0300, Jarkko Sakkinen wrote: > Set the size of the tpm_buf correctly. Now it is set to the header > length by tpm_buf_init(). > > Reported-by: Mimi Zohar > Cc: stable@vger.kernel.org > Fixes: 412eb585587a ("use tpm_buf in tpm_transmit_cmd() as the IO parameter") > Signed-off-by: Jarkko Sakkinen This is all wrong in all possible ways :-( My excuse is the overnight flight last night (no sleep). Mimi, I think what you first proposed as the fix is the right way tho fix it. I'll take some sleep and after that I'll make a legit commit with fix and a commit message explaining the root cause. Please try to ignore this. /Jarkko