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 Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0104EC6FA82 for ; Thu, 8 Sep 2022 23:53:22 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229622AbiIHXxV (ORCPT ); Thu, 8 Sep 2022 19:53:21 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45328 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229566AbiIHXxU (ORCPT ); Thu, 8 Sep 2022 19:53:20 -0400 Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 24D04AB1AB; Thu, 8 Sep 2022 16:53:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1662681199; x=1694217199; h=message-id:date:mime-version:subject:to:cc:references: from:in-reply-to:content-transfer-encoding; bh=T283FVBX95jJVUVJfhotCzb7jPZ3g0V6CxJ2ND8P1Xo=; b=aqFvPstsjpwf/OsJeCQs8kht7C6+5zNKuF6HNb5dPDhdKegl2Weis97K MZ2oEmqF11JlcKyCHBTgQVg8X7S022SgpWavsp3p8WOq2zcVbqBL4vzsB zTU82WiSD5PQCPwC4M9cSejUCcowqI9UR66Ew4JxZabJvHrV8tlmvlZHZ J2NyJJm2mXHa5QKx+fghmZznwFyG13HXKEBnWe9FZV7dbKTz3QIqXL7QS WHkwhahANlpYQwMPjTtd9B7DkU4gD3guvMyg3bQ8FY83jJfx4rKrytxuJ PjeiaXlM8t3+9gQ+LkwyLt0baqATTTnLC+3Pgzqk7EnUMzt9xIqdTyH/X Q==; X-IronPort-AV: E=McAfee;i="6500,9779,10464"; a="284372755" X-IronPort-AV: E=Sophos;i="5.93,300,1654585200"; d="scan'208";a="284372755" Received: from orsmga004.jf.intel.com ([10.7.209.38]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 08 Sep 2022 16:53:18 -0700 X-IronPort-AV: E=Sophos;i="5.93,300,1654585200"; d="scan'208";a="740864197" Received: from duttamou-mobl1.amr.corp.intel.com (HELO [10.209.109.184]) ([10.209.109.184]) by orsmga004-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 08 Sep 2022 16:53:18 -0700 Message-ID: <49f7bb67-2f4f-8e06-5420-5b279fdf3199@linux.intel.com> Date: Thu, 8 Sep 2022 16:53:18 -0700 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Firefox/91.0 Thunderbird/91.11.0 Subject: Re: [PATCH v12 1/3] x86/tdx: Add TDX Guest attestation interface driver Content-Language: en-US To: Greg Kroah-Hartman Cc: Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , x86@kernel.org, Shuah Khan , "H . Peter Anvin" , "Kirill A . Shutemov" , Tony Luck , Andi Kleen , Kai Huang , Wander Lairson Costa , Isaku Yamahata , marcelo.cerri@canonical.com, tim.gardner@canonical.com, khalid.elmously@canonical.com, philip.cox@canonical.com, linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org, linux-doc@vger.kernel.org References: <20220908002723.923241-1-sathyanarayanan.kuppuswamy@linux.intel.com> <20220908002723.923241-2-sathyanarayanan.kuppuswamy@linux.intel.com> From: Sathyanarayanan Kuppuswamy In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kselftest@vger.kernel.org Hi Dave/Greg, On 9/7/22 10:31 PM, Greg Kroah-Hartman wrote: > On Wed, Sep 07, 2022 at 05:27:20PM -0700, Kuppuswamy Sathyanarayanan wrote: >> + /* >> + * Per TDX Module 1.0 specification, section titled >> + * "TDG.MR.REPORT", REPORTDATA length is fixed as >> + * TDX_REPORTDATA_LEN, TDREPORT length is fixed as >> + * TDX_REPORT_LEN, and TDREPORT subtype is fixed as >> + * 0. Also check for valid user pointers. >> + */ >> + if (!req.reportdata || !req.tdreport || req.subtype || >> + req.rpd_len != TDX_REPORTDATA_LEN || >> + req.tdr_len != TDX_REPORT_LEN) >> + return -EINVAL; > > You never verify that your reserved[7] fields are actually set to 0, > which means you can never use them in the future :( > > Please fix that up, thanks. Would you prefer a new posting (v12.1 or v13) with this change, or do you want to continue the review in the same version? > > greg k-h -- Sathyanarayanan Kuppuswamy Linux Kernel Developer