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=-2.2 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_PASS,URIBL_BLOCKED,USER_AGENT_MUTT autolearn=ham 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 58852C433F5 for ; Wed, 5 Sep 2018 11:14:30 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id E35D72077C for ; Wed, 5 Sep 2018 11:14:29 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org E35D72077C Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linux.intel.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727257AbeIEPoN (ORCPT ); Wed, 5 Sep 2018 11:44:13 -0400 Received: from mga01.intel.com ([192.55.52.88]:19279 "EHLO mga01.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726189AbeIEPoN (ORCPT ); Wed, 5 Sep 2018 11:44:13 -0400 X-Amp-Result: UNKNOWN X-Amp-Original-Verdict: FILE UNKNOWN X-Amp-File-Uploaded: False Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga101.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 05 Sep 2018 04:14:27 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.53,333,1531810800"; d="scan'208";a="83203401" Received: from kfitzx-mobl.ger.corp.intel.com (HELO localhost) ([10.252.37.75]) by fmsmga002.fm.intel.com with ESMTP; 05 Sep 2018 04:12:57 -0700 Date: Wed, 5 Sep 2018 14:12:56 +0300 From: Jarkko Sakkinen To: linux-integrity@vger.kernel.org Cc: Stefan Berger , linux-security-module@vger.kernel.org, stable@vger.kernel.org, Peter Huewe , Jason Gunthorpe , Arnd Bergmann , Greg Kroah-Hartman , open list Subject: Re: [PATCH] tpm: fix response size validation in tpm_get_random() Message-ID: <20180905111256.GA9696@linux.intel.com> References: <20180903011004.12161-1-jarkko.sakkinen@linux.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180903011004.12161-1-jarkko.sakkinen@linux.intel.com> Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo User-Agent: Mutt/1.9.4 (2018-02-28) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Sep 03, 2018 at 04:10:04AM +0300, Jarkko Sakkinen wrote: > When checking whether the response is large enough to be able to contain > the received random bytes in tpm_get_random() and tpm2_get_random(), > they fail to take account the header size, which should be added to the > minimum size. This commit fixes this issue. > > Cc: stable@vger.kernel.org > Fixes: c659af78eb7b ("tpm: Check size of response before accessing data") > Signed-off-by: Jarkko Sakkinen Stefan, you did the original commit. Does this look right to you? /Jarkko