Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp1046724pxj; Wed, 2 Jun 2021 19:20:22 -0700 (PDT) X-Google-Smtp-Source: ABdhPJymr2ZAgd1X+rY2I9VVIaXMA6PsmzyyWFDGpFa7SxUsUvvi1B5FsSOke/ZDxw+01cX/bP1f X-Received: by 2002:a50:ff16:: with SMTP id a22mr41339306edu.143.1622686821864; Wed, 02 Jun 2021 19:20:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1622686821; cv=none; d=google.com; s=arc-20160816; b=O04SBjoKAhvoeEcO46GUNwpnXCDYgBo1z0bm4lP5oVOHBRwm3CI/tpRsnYjsGhm2cI Ti48EF22SlHUhTs2O0A3st8NVO+SS8DpPTDCgJ42vrqiMWKvvPwCxxllUxG3e1ECtdJS ECv7hGpC6RYtiWx4tfCwAOopbz2HExVGq3yh1P/q/BEXwh217CTLNE8tAnIbw+mzS0mu FiujQtEg5RCZ2MbbHsWCiUq/zTesAGpw0hCig/k8Bp0kI7vgMfknttJWr/BM8YS9Ay1/ 8ez655ND/+ev2dQtkD0cY79o2MyR9ZfFqQa691DSBz4uSID0ad4rT79a/i2n7t0IJvtp SvQg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-language:content-transfer-encoding :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject:ironport-sdr:ironport-sdr; bh=7BVTx19kwHixuoIu7mEt5rUW1CJa62F3i6IcNPwuMX0=; b=Irft0CgCn8fZw2ERakV/WJSiHb4ACgym0DoMyR9fb/ISA2iP9YzhYKVCE9nZXS/jaE RULk/E37T6wx/Yb3QRVXzeN7WMPQvA2r58gvCAOygWr/cjxF/gFAZC2LKFQehc0Ftkrs Ft3UPC+CqgFdAHsX4ACvz2/F1ImrTEhLaP0AipuwWte7JluY9yuVXEa4iaVUES2kPCwr M+LzCfdfSLwT8iE8tvHRCiBBWZVBXILQfU0NDgVc16DDGubqRaKxqk417rIyXMS9u2bS E7CRlp6X+ymzqzVOAiiFW5uHLiQ6gYr4vCVpKV2s+Xiqi1yU4vjHxxN2/eqoaSW3D5YL 156A== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id i8si1236511edv.287.2021.06.02.19.19.34; Wed, 02 Jun 2021 19:20:21 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229626AbhFCCUJ (ORCPT + 99 others); Wed, 2 Jun 2021 22:20:09 -0400 Received: from mga09.intel.com ([134.134.136.24]:51886 "EHLO mga09.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229541AbhFCCUI (ORCPT ); Wed, 2 Jun 2021 22:20:08 -0400 IronPort-SDR: 9Fe6yUzHp/t3G31d4O+3IAGifjumUfGeudE74bz/0S0n3cgF8+aCNUj5sFySZvaNPvZ84YryjG 4CGEEuNGNbpQ== X-IronPort-AV: E=McAfee;i="6200,9189,10003"; a="203937411" X-IronPort-AV: E=Sophos;i="5.83,244,1616482800"; d="scan'208";a="203937411" Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 02 Jun 2021 19:18:22 -0700 IronPort-SDR: aIgogudB/xgPovZkty4cGTTVDDPkaoIn4LK55UWXjGi7xxn4m2KSblfJrn5zToJE+9XWx2Tmjb bp5VXHB4Xb5Q== X-IronPort-AV: E=Sophos;i="5.83,244,1616482800"; d="scan'208";a="550525649" Received: from akleen-mobl1.amr.corp.intel.com (HELO [10.209.87.193]) ([10.209.87.193]) by fmsmga001-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 02 Jun 2021 19:18:21 -0700 Subject: Re: [PATCH v1 2/8] virtio: Add boundary checks to virtio ring To: Jason Wang , mst@redhat.com Cc: virtualization@lists.linux-foundation.org, hch@lst.de, m.szyprowski@samsung.com, robin.murphy@arm.com, iommu@lists.linux-foundation.org, x86@kernel.org, sathyanarayanan.kuppuswamy@linux.intel.com, jpoimboe@redhat.com, linux-kernel@vger.kernel.org References: <20210603004133.4079390-1-ak@linux.intel.com> <20210603004133.4079390-3-ak@linux.intel.com> <4be00b3a-a15f-7fee-317b-ddabed3c1347@redhat.com> From: Andi Kleen Message-ID: Date: Wed, 2 Jun 2021 19:18:20 -0700 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.10.2 MIME-Version: 1.0 In-Reply-To: <4be00b3a-a15f-7fee-317b-ddabed3c1347@redhat.com> Content-Type: text/plain; charset=gbk; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > It looks to me all the evils came from the fact that we depends on the > descriptor ring. > > So the checks in this patch could is unnecessary if we don't even read > from the descriptor ring which could be manipulated by the device. > > This is what my series tries to achieve: > > https://www.spinics.net/lists/kvm/msg241825.html I would argue that you should boundary check in any case. It was always a bug to not have boundary checks in such a data structure with multiple users, trust or not. But yes your patch series is interesting and definitely makes sense for TDX too. Best would be to have both I guess, and always check the boundaries everywhere. So what's the merge status of your series? -Andi