Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp4734963iob; Sun, 8 May 2022 23:41:38 -0700 (PDT) X-Google-Smtp-Source: ABdhPJywVMBJN81+25FCIAzsu2BQcnDfjxBOoiAWvZl1RjNpzFGji7hF3BSYF4CH4arcg0MNZTm7 X-Received: by 2002:a17:902:f682:b0:15e:951b:8091 with SMTP id l2-20020a170902f68200b0015e951b8091mr14848445plg.106.1652078498751; Sun, 08 May 2022 23:41:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1652078498; cv=none; d=google.com; s=arc-20160816; b=aOLg4xHH0w7HtT7dUME8yr1aCu5rHBIgcQHFEIUoEr0lJPma/+74afbTS+TPInuPYN gS2QPYWpxSJyPqh6JxPpvL3KNt2ex0lK6gWghfdCpJ51M/DXCDTzYRTJtMx/+F34rH1H jzfmo1K9LXsXLHl3+NxzTspn8h6gjvn9Gcmc6odbXackATGcLrj10qzs/twbIuSYBo+I BNuMlPTyJNtl4DtsrO74Gf5TpVug9bv4ijgewZlsQSRYUh36cMATm8OCu9yEbo+4b4bN 81V0pd5PX6kN+kDIL/xc94VM47UXCF5OPIPTghwrlapM9vqSZkHR0+KIwlGvtZVhGdSD SMwg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=uJkCoRH8ets+/OqoSv+HJ24CgQ+5BLSY57CVtZK4eVo=; b=tMjT4kKt0wMLL/Udf4h2a8IQ2ihPfntu/VXJg0sutXou4zdnS4ajGcIP3+/MizbTFf brJ8Endqm70/9+AVd7jCmukMOO9vNoJ20KWaysVKG/Oe1F+WYJfwR/dPrMP0DS1xx0xu HoPiNgK+dT6mCOzBpeXUrMR/xjbvIgh66xlhnqG3//2G28+PuPHi2bFekRot7i3lJQXP 4KK126UKclrGscFzG35GeVznrKTTiJ0Ho7GCyC5p0bH3eY3wDEJ+atOa7UgBLDxoW8kl FQtbhB2D2LhMIrfCIPi+Rrw5YOioFaVrbCe7IHzrVV7dQNhPVFL4939dZDKEthIZba+K qBRw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=XbxIYqvP; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id z19-20020aa791d3000000b0050a73701075si12436723pfa.159.2022.05.08.23.41.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 08 May 2022 23:41:38 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=XbxIYqvP; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 720AD18E87E; Sun, 8 May 2022 23:38:53 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1387092AbiEGTpi (ORCPT + 99 others); Sat, 7 May 2022 15:45:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54072 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235918AbiEGTph (ORCPT ); Sat, 7 May 2022 15:45:37 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BC24D2B275; Sat, 7 May 2022 12:41:49 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 839F8B8068C; Sat, 7 May 2022 19:41:48 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id B2B4AC385AC; Sat, 7 May 2022 19:41:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1651952507; bh=Uocodj44OGa6wP2CSv2SNJwnjTs5eandl68Fm7eawW4=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=XbxIYqvP0FujJLy2tyKS4lgKGymjgLyjU+YcEvaOHSlD5XI0lzD7cNJ6K7XVpBHup oLP3RQW1sP03R1GiGq+IOqkhjet9rEjhXfDP9rT+Knya+9fgPZduJTbBpzOZa+wZjU OdP9Wdsb3riEoNGxy4lQN9h9NNJxeZlwH/+86AikTLicFtS2TilvMIh43bvib+DVgT sCguIv+2NbTZYbcJO7/Y/xtDq1ovaMyEZ5qLtfxs4FVokOLy4KvicLmEaNkVo8QoAx 99p4nKRljzC99l5ZoGuL1hkNEviXZtWevi/xcKmFLSoAcSck3D+VbMRHqei+SoiFxw NIexdsqNGc13w== Date: Sat, 7 May 2022 22:43:21 +0300 From: Jarkko Sakkinen To: Stefan Mahnke-Hartmann Cc: linux-integrity@vger.kernel.org, linux-kernel@vger.kernel.org, Marten.Lindahl@axis.com, martenli@axis.com, jgg@ziepe.ca, jsnitsel@redhat.com, nayna@linux.vnet.ibm.com, johannes.holland@infineon.com, peterhuewe@gmx.de, stable@vger.kernel.org Subject: Re: [PATCH 1/2] tpm: Fix buffer access in tpm2_get_tpm_pt() Message-ID: References: <20220506123145.229058-1-stefan.mahnke-hartmann@infineon.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220506123145.229058-1-stefan.mahnke-hartmann@infineon.com> X-Spam-Status: No, score=-2.9 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, May 06, 2022 at 02:31:46PM +0200, Stefan Mahnke-Hartmann wrote: > Under certain conditions uninitialized memory will be accessed. > As described by TCG Trusted Platform Module Library Specification, > rev. 1.59 (Part 3: Commands), if a TPM2_GetCapability is received, > requesting a capability, the TPM in Field Upgrade mode may return a ~~~~~~~~~~~~~~~~~~ Looks like random picks for casing: two words with upper case letter and one with lowe case. > zero length list. > Check the property count in tpm2_get_tpm_pt(). > > Fixes: 2ab3241161b3 ("tpm: migrate tpm2_get_tpm_pt() to use struct tpm_buf") > Cc: stable@vger.kernel.org > Signed-off-by: Stefan Mahnke-Hartmann Which section is this in that specification documented? I looked into section 30.2 but could not find the part that documents this behaviour, i.e. returning success in FW upgrade mode. Why it wouldn't just return TPM_RC_UPGRADE? BR, Jarkko