Received: by 2002:a05:6358:489b:b0:bb:da1:e618 with SMTP id x27csp166974rwn; Wed, 7 Sep 2022 22:42:40 -0700 (PDT) X-Google-Smtp-Source: AA6agR7iFtuH/GSkTNUpaZji7vER7CaeTXLDcwuWoTNOVDtcn9buvW970Eb40LTzoAXXxf95Opnp X-Received: by 2002:a17:907:2cd4:b0:772:39b6:b77d with SMTP id hg20-20020a1709072cd400b0077239b6b77dmr2247106ejc.572.1662615759873; Wed, 07 Sep 2022 22:42:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1662615759; cv=none; d=google.com; s=arc-20160816; b=oqDbmUCb1K2p31JaMfTE+Ir4oumpAsUl78mU4Jfd3yJZNg2jMj/iBnJzDcfa3RRT4M Xo+4DQrfLgI7b/QlkaE5Ii6+feyDN1e3fC5Xf1GfKER5ZLNO1fp5GPNZcOXGd0Xml6Nz mh4ERsYrGyL8SqfiBwQsqfE/Eb026Y4vCVgfLzsD5/grHw3CzwZILx+voKlWYfj9bSim Q2NcBJCg8RasBtWv06QBQcmqqJI0rjIHTZHFoilvuj4ETheDZ3WDw41KhcE97V+cUBu0 FZrCqLSb3bhotm4E2Q4CAP+nEGI6o0MgG1nTkmRl797/vGwc467HTJekU+Wq/msYp2Qw 4b6A== 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=Hcai9EzFN6d32bQ5stRYM4AX7gYLBnrMNLsO8dkm1fc=; b=02vNPsXzuONldRh2yA9M4qqyuxceseOC9FRnimCuXG3pHpKcjEo0XXe0iA8Khl9WM0 +uq8PA/WFoy6vMIYiLaVpXAmNNb8sd7faNAIjwTkHrw2ZLW72IBaeJ0cSehknI4J3PHw h1tpO3xmkDJlIf2U1CdV0D/miAU44/uwN+Iubq4Ex9JVekHpa/PsaocZH286n4MDNx4Z 6ZWI8LmAGq8pIYlpZJVJU8z5qxzvfpF4Ck69Q6Tq9VZXR+/1o8e+HwzSBPgwDH7nTy/u gUUN2Wh2YzEyeDFeLVFmeRqgXmJ+uyxK5aRJVoqouAK2g8TFW8/wJJ/l9OGVOgikAzo6 29zg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=LPmK5FNx; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id nc26-20020a1709071c1a00b007765c1da9cbsi211056ejc.719.2022.09.07.22.42.14; Wed, 07 Sep 2022 22:42:39 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=LPmK5FNx; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230056AbiIHFbX (ORCPT + 99 others); Thu, 8 Sep 2022 01:31:23 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47402 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229477AbiIHFbV (ORCPT ); Thu, 8 Sep 2022 01:31:21 -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 D409B6B642; Wed, 7 Sep 2022 22:31:20 -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 8C577B81F05; Thu, 8 Sep 2022 05:31:19 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id B5F29C433D6; Thu, 8 Sep 2022 05:31:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1662615078; bh=993P6P5uXUu3gMFdwZ6bKw95vMR8jDKZUPI8ijKD64Y=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=LPmK5FNxEtNNpbGCkMIWknBOvFfca0Gn5VRehRES829d1issxJtdRujj/76bPTft5 pF1+HRBk3NDLgnNDUNlCBHGRvKHftiyeRfbtYsujNgab7cjrtSZbMdk6TQb8jpzCU0 YSliZe8vhr/40UEXi2AbPhsCUt23CANxyFm/oH0o= Date: Thu, 8 Sep 2022 07:31:40 +0200 From: Greg Kroah-Hartman To: Kuppuswamy Sathyanarayanan 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 Subject: Re: [PATCH v12 1/3] x86/tdx: Add TDX Guest attestation interface driver Message-ID: References: <20220908002723.923241-1-sathyanarayanan.kuppuswamy@linux.intel.com> <20220908002723.923241-2-sathyanarayanan.kuppuswamy@linux.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220908002723.923241-2-sathyanarayanan.kuppuswamy@linux.intel.com> X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham 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 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. greg k-h