From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=209.85.167.41 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796047252; b=asl7QQnUt6cD7z9nAs+csya2iNx80qiL+6pMRwli2olJ9AU31NPE4NL9e9kFKvm1hUtl o2LNGAQd/GbuwpjE+ha5tqY2DLuGZwXKte9fAv+vb3qxor3Od4MLJIMttQoJ+02iQBjtW Clvh/VFiv1KzwELX6wx41gAH1FyfcYZBUr7SQiO36eNZmzBzUOIwEK5JQJo2DIYKT2vOk QIyImR3AHDF0oKMeC5DrqpOLyzQ4Bk5BwtG9hs3wyVAHEQGOl4D1RKgiQZVOPzcsPbABN r1RIwvBeIxkqokfK+NaaLkArJyFaNwMcORXOBuMqeeRtdGU3nWH3hiKkMa2Ky4nQIkQ== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796047252; h=DMARC-Filter:Received:DKIM-Signature:X-Google-DKIM-Signature: X-Forwarded-Encrypted:X-Gm-Message-State:X-Gm-Gg:X-Received:Received: Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; bh=hy4/oI3ySaB85XdRkuZNz/jATFZltjkt8o1uB0Hl8dU=; b=IP0lke9JzdnbpPwrvUogNJTU8iguIhEkFsmBSGLUiP86iWprS+dvy16MXeO5V6GgFRk2 lJ/Ob1Wn15eHDKGeThcTia55iIdHJ8tnqk5tw+wa9caLm43Hv6zTa4ce1OTiPA079v27O 2Rvh8gRipmlMbon9tbsIEDNWgKWXTAj8PqPLyOexLBwI1v2eIH7+IsvqzrY/E7k4CSFib iKDZiXJHeR1Sr+ohk/TvjU/1H3yv7MerUE/KfnFuSiaodZnzTS0tWj+Ipw4pJwuPQn1Zc x8aG67bhwOVzFDEb6SFYVsTIRLtsrttlPxbcxpk0kd99Pl+0VEALDmT8lw+qm9oM0jg== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=resnulli.us; spf=pass smtp.mailfrom=resnulli.us; dkim=pass header.d=resnulli.us header.i=@resnulli.us header.a=rsa-sha256 header.s=google header.b=orDRl8t5; arc=none smtp.remote-ip=209.85.167.41 Received: from mail-lf1-f41.google.com (mail-lf1-f41.google.com [209.85.167.41]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id ADE07606A327 for ; Mon, 30 Nov 2026 14:00:46 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org ADE07606A327 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=resnulli.us Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=resnulli.us Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key, unprotected) header.d=resnulli.us header.i=@resnulli.us header.a=rsa-sha256 header.s=google header.b=orDRl8t5 Received: by mail-lf1-f41.google.com with SMTP id 2adb3069b0e04-5c10dc41270so10775617e87.2 for ; Mon, 30 Nov 2026 06:00:46 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=resnulli.us; s=google; t=1796047245; x=1796652045; darn=vger.kernel.org; h=in-reply-to:content-disposition:content-type:mime-version :references:message-id:subject:cc:to:from:date:from:to:cc:subject :date:message-id:reply-to:content-type; bh=hy4/oI3ySaB85XdRkuZNz/jATFZltjkt8o1uB0Hl8dU=; b=orDRl8t5PU2XlKt1yd6xW9ExBpV0vJH+X8cjNJOGoamKUNLFflyK9RT0sX9I9TdpQk D88B+FwDN9U2G7K4JCDz+5N2txiBkc+uZpXyiacKuGLW46xnRRiqSWyBsF89W4Gj/JB+ yV1DUMxHkYPt6TK8IQiJK7M4PveFmc/hkR/Q6zQwWYdjSnL/HzI2tvAGzU7ln9/MtZ3P dFJZ2LU/yZ/1AZAFSiHQZIaUUI1bWhtIAOtBzBji947nDsHnrubFjzenf57iO0KwJDMC YyQGJ1olQYtM6j1EwjzRL6qY2Q8iYUJH7Hc7AYnGM3Gp/VlO3hwpW4WOWWAQ5ciC28uA LHIw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1796047245; x=1796652045; h=in-reply-to:content-disposition:content-type:mime-version :references:message-id:subject:cc:to:from:date:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=hy4/oI3ySaB85XdRkuZNz/jATFZltjkt8o1uB0Hl8dU=; b=Rn0IdKOIZsroJ0GVCohGz3T/64h+pKEG8RTCxtmhLK7fcs/b0638Ju7PGFfBjfNFwP Au8AwDgqW4R3dLnmCgodQ+miz3s9EYOMVhfiNiDlUqaJ+fwJBZqMTR9JOCa2Xjhp1ryN yxtsDTHKZlLAeUaWw8MhiFJ+vfRS+R9LZE5/GhTYetj7knHzAdptMEDep2kT/R4zGZvl YdiA6COKhGElVC+k4dTuoV1xEfP0Ql5Ud1gn7C9Xj6R9WthUAkxHDpazZWX53jAKUuEl cuOk9hlXb3Hzy30i7XpwPe5uhCzx0jPcA5oM/q2vF/HYtJYmhu//Gx/2Tk/cJ1ggEWLp HmlA== X-Forwarded-Encrypted: i=1; AL+hErHv0FyTUg8B4hunshmK7/PpEMkS6uIIM9aFHhrVBJtr1btqUyDXU1xd+F9g5khZBNvmB67Z8yntmbpAXuQ=@vger.kernel.org X-Gm-Message-State: APuU4Z9hopzlNvoPboUG0VJE5jnwuLiZSpUEPibJJC20SgtvZEtnBIqb qRr9YDje+bpVD187UaAz6Cr1dNipRv0DvL5PgAarX/QJLJsT9at5iB9OUicWmDe7lEc= X-Gm-Gg: AZFdTZe87if6vprW8NFpsJvVoSlRi2erizB+KjsDQJo+6Yj2Zp6CSbgp9O7QUPMWvC6 mqCksxdzUcjeyFDyjBF4/VDFgKEiNvKypEeWPJJI6qMqaoLlEHI7l9orMxZh3kSf/dWvjrV0C3c VG/H24eOuyQXPYe9lsi5P8IOjaIA9Wthf3EhNztvegPLDhey7qe+Wi88ebPLugp3R7BO6YXsWQY 7ck971mwOLowNBx3JL/1jpMzMupXQd5L5NrtNi/aOnsfZWmBIBx+eg+JG0TML41kxD81klE1ON4 kXtBXu+HgEKBq0J5HbPl6kV2ioKnp+zEZDkGokrE/0izOvvy23+qJcTkn1foUR59ABTdzoO4V5c L+XKmX3t6RE/XlZ21LvRa9iAcbngUuNGNjIxZ9a0UHudbnM1rMW4fQnanw9El8hfP5XqU9K8qCe +YLoHOW37wl7SkgDE9v8MH254IN+8EDVReuourIOfzPGOeaeU3ligZIlZKk2GubFetYehZ9Q8iY gVLvPiDvKvghzp8knWYa/+M7w/IpsGLIiXiaNOFvRsl+Lj0lpKuxvR32Us7sEoXhm10KKZqpaRH tsbrLBn6lD0m6SNK7VBw6p3thB47ta9pagSLw4XJ X-Received: by 2002:a05:6512:b91:b0:5bf:ce1f:674d with SMTP id 2adb3069b0e04-5c1bc7b5b0amr10194378e87.15.1796047244374; Mon, 30 Nov 2026 06:00:44 -0800 (PST) Received: from localhost ([140.209.217.212]) by smtp.gmail.com with ESMTPSA id 38308e7fff4ca-3afd7653359sm314311fa.16.2026.11.30.06.00.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 30 Nov 2026 06:00:43 -0800 (PST) Date: Mon, 30 Nov 2026 15:00:38 +0100 From: Jiri Pirko To: Jason Gunthorpe Cc: linux-coco@lists.linux.dev, linux-kernel@vger.kernel.org, linux-api@vger.kernel.org, x86@kernel.org, kvm@vger.kernel.org, linux-doc@vger.kernel.org, jgg@ziepe.ca, david.quigley@intel.com, lukas@wunner.de, ksinyuk@kernel.org, rodrigo.vivi@intel.com, cedric.xing@intel.com, sameo@meta.com, drdeeglaze@gmail.com, James.Bottomley@hansenpartnership.com, aik@amd.com, jpiotrowski@nvidia.com, qinkun@google.com, pgonda@google.com, jic23@kernel.org, alistair.francis@wdc.com, ankita@nvidia.com, suzuki.poulose@arm.com, kas@kernel.org, rick.p.edgecombe@intel.com, elena.reshetova@intel.com, dave.hansen@linux.intel.com, sathyanarayanan.kuppuswamy@linux.intel.com, peter.fang@intel.com, jarkko@kernel.org, zohar@linux.ibm.com, yeoreum.yun@arm.com, aneesh.kumar@kernel.org, dave.jiang@intel.com, nik.borisov@suse.com, sergii.dmytruk@3mdeb.com Subject: Re: [PATCH RFC v2 1/9] attestation: Add the base family specification and generated files Message-ID: References: <20261113160838.2512652-1-jiri@resnulli.us> <20261113160838.2512652-2-jiri@resnulli.us> <179573913907.519186.8407997114208887089.b4-review@b4> X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <179573913907.519186.8407997114208887089.b4-review@b4> Fri, Nov 27, 2026 at 01:25:39AM +0100, jgg@nvidia.com wrote: [...] >> +ops: >> + # What the device can do, and its family's fields. >> + device-get: >> + type: action >> + fd-access: read >> + reply: >> + # What the device supports, fixed for its life. >> + caps: >> + # Present when the device produces evidence. >> + evidence?: >> + # One per object evidence-get can produce. >> + objects[16]: >> + # The device's handle for the object in requests. >> + id: uint(..15) >> + # What the object is. >> + class: evidence-class >> + # The layouts a standard defines that the object may have. At >> + # least one of formats and vendor-formats is present. >> + formats[4]?: evidence-format >> + # The layouts its vendor defines that the object may have. >> + vendor-formats[4]?: evidence-vendor-format > >How do we want to fit AMD's unique GUID scheme into this? > >I'm not sure we should be passing a GUID from userspace to select an >opaque blob. If not then the kernel could have the GUID list and >report the correct evidence formats as options here? > >But then this is maybe a bit limiting because the format is supposed >to be the basic envelope, but the AMD version uses almost the same >format but they are still different. Though I suppose the difference >in the nonce calculation warrants a second format. > >And then how does generic userspace even know which one to pick? List >them all? Should kernel give some 'default signed evidence' ID ? Nothing in this series takes a GUID. The referenced github all_2 branch does, for now: its evidence-get carries over configfs-tsm's three attributes as optional request fields, service-provider?: string(1..128) service-guid?: binary(16) service-manifest-version?: uint(..u32-max) all three or none, taken only by a device whose evidence caps have the service flag. That is the GUID from userspace selecting an opaque blob that you doubt. Perhaps we can do this differently: As I understand the SVSM side, a guest under an SVSM has two reports. The PSP's has the challenge as REPORT_DATA. The SVSM's has SHA-512(challenge || manifest) there, the manifest being either the table of all services or one service's own, which is what the GUID selects. Same structure, different binding, so two formats, as you say. For a guest under an SVSM that has a vTPM, device-get would list: id class 0 signed the PSP's report 1 signed the SVSM's report over all services 2 auxiliary the services manifest, which 1 binds 3 signed the SVSM's report over the vTPM 4 auxiliary the vTPM's manifest, its EK public area, which 3 binds 5 cert-chain the certificate table each with its format; the last two classes are on the branch, not in this series. The caller names a report and its manifest by ID in one evidence-get. The kernel maps GUIDs to formats and learns which services are there from the services manifest, so no GUID crosses the uAPI and a new service is a line in the kernel's table. For the default I'd say the objects come in the provider's order of preference, so generic userspace takes the first signed one whose format it knows. Would that do, or do you want it explicit? > >So many questions :( > >> + # The longest the object gets; a blob this long always holds it. >> + max-length: uint >> + # A signed object's challenge lengths: each entry is one length, >> + # or a range from min-length to max-length. >> + challenge-lengths[8]?: >> + # A single length. >> + length?: uint(1..4K, bytes) >> + # The shortest of a range. >> + min-length?: uint(1..4K, bytes) >> + # The longest of a range. >> + max-length?: uint(1..4K, bytes) > >The comments should be more prescriptive on how userspace has to >handle this. I guess if length appears then that length must be used, >otherwise within the range described by min/max length > >But I wonder if this is worth some additional schema support to define >a tagged union? What if we just simply drop length and just have min-length and max-length? Then min-length==max-length is just a special case. > >> + # Present when the device has MRs. >> + mr?: >> + # The MR operations the device provides. >> + flags: mr-device-caps >> + # The device's family's fields. >> + info: extension device-info >> + >> + # Evidence objects, written into the caller's blobs. A signed object is made >> + # by the call, over the challenge, and never reused; the others are read as >> + # they stand at the call. >> + evidence-get: >> + type: action >> + fd-access: read-write >> + availability: dynamic >> + optional: true >> + request: >> + # Bound into each signed object named: pass a verifier's nonce, or a hash >> + # binding one to your context, never data a peer chose. Present exactly >> + # when a signed object is named, and of a length each of them takes. >> + challenge?: binary(1..4K) >> + # The objects to produce, each named once. >> + objects[16]: >> + # The object, by the ID device-get lists. >> + id: uint(..15) >> + # Where the object is written. One too short for it fails the op with >> + # EMSGSIZE, and error-info's required-length says how long it has to >> + # be. >> + data: blob(out, va) > >What will this be like when we add memfd later? The field lists more backings: blob(out, va memfd dma-buf). It's on github branch all_2. > >> + reply: >> + # One per object, in request order. >> + results[16]: >> + # The layout it came in, where a standard defines it. Exactly one of >> + # format and vendor-format is present. >> + format?: evidence-format >> + # The layout it came in, where its vendor defines it. >> + vendor-format?: evidence-vendor-format >> + # The bytes written to its blob. >> + length: uint >> + # Present when the evidence depends on the MRs. >> + mr-generation?: record > >Later we will need to add 'tsm controlled challenge' meaning the challenge is >an output not an input, That fits later without breaking anything: the request's challenge is optional already, a result would carry the challenge the TSM chose, and device-get would say per object which of the two it is. > >> + >> + # The MRs' IDs and descriptions, which do not change; mr-read returns >> + # values, which change with every extension and are read from the hardware. >> + mr-get: >> + type: query >> + fd-access: read >> + optional: true >> + suggested-reply-length: 4K >> + request: >> + # Only this MR; every MR without it. >> + id?: uint(..u32-max) >> + reply: >> + # One per MR, ordered by ID. >> + items[]: >> + # The device's handle for the MR in requests. >> + id: uint(..u32-max) >> + $include: mr-desc >> + >> + # One MR's values, and the MR generation they belong to. >> + mr-read: >> + type: query >> + fd-access: read >> + optional: true >> + suggested-reply-length: 4K >> + request: >> + # The MR to read, by the ID mr-get lists. >> + id: uint(..u32-max) >> + reply: >> + mr-generation: record >> + mr-values: record > >Can we leave the generation for a followup with more understanding >what it will be used for and how it is computed? Okay. Will move that to journal follow-up. > >> + >> + # Extends banks of the MR by digests, as TPM2_PCR_Extend. >> + mr-extend: >> + type: action >> + fd-access: read-write >> + optional: true >> + request: >> + # The MR to extend, by the ID mr-get lists. >> + id: uint(..u32-max) >> + # For the banks to extend, each once, in any order. >> + mr-values: record >> + reply: >> + mr-generation: record > >The comment should say that mr-values must include exactly every bank >inside the MR, not more or less. A subset is meant. v1 wanted every bank, and review of it brought up DRTM, which may extend only one bank while several are active: https://lore.kernel.org/all/auOVbGYJjIQTN53z@MjU3Nj/ So a bank that is not named is not extended, as with TPM2_PCR_Extend, and a bank the MR does not have is refused. The comment says neither, I'll fix it. > >If we want to later add something like a log entry as an option this >is easy to extend for that, right? Yes, a request can gain optional fields. The all_2 branch does that: mr-extend takes the data to hash instead of digests, and what to record in the journal with it. > >This API eventually needs certificates. I expect that Intel is >including the certificates embedded within the EAT returned here as >signed evidence. AFAIK ARM does the same > >But AMD seems to pass them through 'auxblob' in tsm_report, so there >should be a certificates API here to get them. SPDM also has them >detached from the evidence. I'd not add an op for them. An evidence object has a class, and the full branch adds cert-chain beside signed and event-log, so certificates could be listed by device-get and read by evidence-get like the log is. Thanks for the review!