From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796409399; b=PqkN+pIZn/llibfzKTTyjjnLGymUHNzM5jNlSnrokconNLlU77uxWRNot7S047seOZvF YD/Va1seT5A6J2Ma6Ql2ajMSndPEeO8evIZM6ykWFaXOT1laDXQoHukKfPLSgBmk12UXT F6EGSx0MaU/x21HBdSA23AuYXfMEmSI0xrPfIVWTdhDpZCIaCN7LzUlsKwWQQHAonF/Zw VNRcxZBhlZuden/9o8i2KTa6Xa280V08P0QAIX60trhDFVHuabAQ4LdUb+RqqWMWBTfxP aKOlRlJc+7DwFtY9k+/stQrmZdEUVt1J/PnHPtNQ0xh4b181dxSBWelwEyLMQhc4OkA== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796409399; h=Received:DKIM-Signature:Message-ID:From:Subject:Reply-To:To:Cc: In-Reply-To:References:Content-Type:Content-Transfer-Encoding:Date; bh=mL1HWj59xuRl6IMK2AkXUsP0Kqmw1UUGHfdqIxZoPU8=; b=mm0gar9VdnohN5Sf2stmZdrz04VCUHSRNQc+eYepqHVpvNKiFb1jJpXcdvdPmKzCJIfs oB2mTaun0eWlq2b0lQNw2mDkZFvIpefF3a7oJGXdEUU7wJmChUWnpzNa83RQtuVve5LMJ +dglY1lsU9ZB21Nx14xewEUldZ+AmJ06Ytunlep5ZtCNcaEsGHNkxZ8vcitNqGiHmqGHp HU8hUTH1vo0ufkWKf9KgWbK8a559lhQSg/vroG1TEYGInpGxLSguvg6K0EuhlT/t8jfkZ 8eb5r3HGzARGc8yPjn6/zsCLuIT2UFVzVW+z6Z8w3AT485cA7XCOObjHPUTkx8xj62w== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=ldnTttEs; arc=none smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C4C61606A32F for ; Fri, 4 Dec 2026 18:36:39 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=ldnTttEs Received: by smtp.kernel.org (Postfix) with ESMTPSA id 8BEFC1F00A06; Fri, 4 Dec 2026 18:36:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796409399; bh=mL1HWj59xuRl6IMK2AkXUsP0Kqmw1UUGHfdqIxZoPU8=; h=From:Subject:Reply-To:To:Cc:In-Reply-To:References:Date; b=ldnTttEs2R0VF3PAIyOYIFNtwZbZpKP+Dl4R5Leq+Wx94bBQ7mqlfv6H1T6e+Zb4z w0570QZYFJWXLGEio1D1p9JtZVxF9p3yXa6hggF46PXKIGQBdEZo00pLt+jXIbygmH TVXbYG6Rs+kKyPGTEbC6MbvOMErB5WWf7IgRt84wRKhGaQcgQCblCIw2+8jDUXZX53 ybwACmSxwG1jxR4SQvi4tj+XBECfGlqoRlNjls1ybGYQlwGHAn9wV0wpY8/JJ8hfrA 5Yp5idoCvj1ZuGAl2xxSuFhQ/tmP4HD4DETCoqZkQa59N+WmH62Ln2mFOpeSdB4ioO jxVAvrgcQ7VLg== Message-ID: From: sashiko-bot@kernel.org Subject: Re: [PATCH v3 6/8] KVM: TDX: Document KVM_TDX_GET_QUOTE Reply-To: sashiko-reviews@lists.linux.dev To: "Peter Fang" Cc: kvm@vger.kernel.org In-Reply-To: <20261204182022.324230-7-peter.fang@intel.com> References: <20261204182022.324230-1-peter.fang@intel.com> <20261204182022.324230-7-peter.fang@intel.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Date: Fri, 04 Dec 2026 18:36:39 +0000 X-Mailing-List: kvm@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list Thank you for your contribution! Sashiko AI review found 2 potential issues to consider: - [Low] KVM: TDX: KVM_TDX_GET_QUOTE misdocuments hw_error as must be 0 (out) - [Low] KVM: TDX: KVM_TDX_GET_QUOTE quote_buf_size minimum not enforced in code -- commit 42ca18a6ac06953778ef9347240a920d55d409db Author: Peter Fang KVM: TDX: Document KVM_TDX_GET_QUOTE This commit documents the KVM_TDX_GET_QUOTE VM ioctl and its quote_max_size capability field in Documentation/virt/kvm/x86/intel-tdx.rst, and updates the TDVMCALL_GET_QUOTE description in Documentation/virt/kvm/api.rst. > diff --git a/Documentation/virt/kvm/x86/intel-tdx.rst b/Documentation/vir= t/kvm/x86/intel-tdx.rst > index d8d9409120e61..1bd95f6df49d6 100644 > --- a/Documentation/virt/kvm/x86/intel-tdx.rst > +++ b/Documentation/virt/kvm/x86/intel-tdx.rst [ ... ] > @@ -197,6 +203,45 @@ Complete measurement of the initial TD contents and = mark it ready to run. > - hw_error: must be 0 > =20 > =20 > +KVM_TDX_GET_QUOTE > +----------------- > +:Type: vm ioctl > +:Returns: 0 on success, <0 on error > + > +Generate a DICE-based Quote from a TD Report. @report_uaddr points to t= he > +TD Report, and @report_size is its size. @quote_buf_uaddr points to the > +buffer for the Quote, and @quote_buf_size is its size. On success, KVM > +writes the Quote to the buffer, and the size of the Quote to @quote_size. > +This needs to be called after KVM_TDX_FINALIZE_VM succeeds. > + > +@report_uaddr and @quote_buf_uaddr must be page-aligned, and @report_size > +must not exceed the size of a page. @quote_buf_size must be at least the > +quote_max_size reported by KVM_TDX_CAPABILITIES. [Severity: Low] Does tdx_td_get_quote() actually enforce that quote_buf_size is at least quote_max_size? tdx_td_get_quote() clamps quote_buf_size to max_quote_size with umin() and only returns -EINVAL when it is zero. A smaller non-zero buffer is passed to tdx_quote_generate() and may succeed or fail with -EIO, while larger values are silently capped. Either tdx_td_get_quote() should reject quote_buf_size < max_quote_size, or the documentation should state that quote_buf_size must be non-zero, should be at least quote_max_size to guarantee the Quote fits, and is capped at quote_max_size. Also, tdx_td_get_quote() rejects non-zero reserved[27] in struct kvm_tdx_get_quote with -EINVAL, which is not mentioned here. [ ... ] > +- id: KVM_TDX_GET_QUOTE > +- flags: must be 0 > +- data: pointer to struct kvm_tdx_get_quote (in/out) > +- hw_error: must be 0 (out) [Severity: Low] Should hw_error be documented as an in/out field that must be 0 on input and returns the TDX SEAMCALL status code on output? tdx_get_cmd() returns -EINVAL if cmd->hw_error is non-zero on input. tdx_td_get_quote() -> tdx_quote_generate() then writes the TDH.QUOTE.GET SEAMCALL status code to cmd->hw_error (returning -EIO on failure), and tdx_vm_ioctl() copies it back to userspace. Documenting it as "must be 0 (out)" could mislead userspace into not zeroing hw_error on input or ignoring the returned SEAMCALL status on -EIO. --=20 Sashiko AI review =C2=B7 https://sashiko.dev/#/patchset/20261204182022.3242= 30-1-peter.fang@intel.com?part=3D6