From: Markus Armbruster <armbru@redhat.com>
To: Gerd Hoffmann <kraxel@redhat.com>
Cc: qemu-devel@nongnu.org,
"Philippe Mathieu-Daudé" <philmd@linaro.org>,
"Eduardo Habkost" <eduardo@habkost.net>,
qemu-arm@nongnu.org, "Ard Biesheuvel" <ardb@kernel.org>,
"Marc-André Lureau" <marcandre.lureau@redhat.com>,
"Thomas Huth" <thuth@redhat.com>,
"Michael S. Tsirkin" <mst@redhat.com>,
"Marcel Apfelbaum" <marcel.apfelbaum@gmail.com>,
"Peter Maydell" <peter.maydell@linaro.org>,
graf@amazon.com, "Eric Blake" <eblake@redhat.com>,
"Michael Roth" <michael.roth@amd.com>,
"Richard Henderson" <richard.henderson@linaro.org>,
"Daniel P. Berrangé" <berrange@redhat.com>,
"Paolo Bonzini" <pbonzini@redhat.com>
Subject: Re: [PATCH v5 14/24] hw/uefi: add var-service-json.c + qapi for NV vars.
Date: Wed, 26 Feb 2025 09:30:21 +0100 [thread overview]
Message-ID: <87bjup3y76.fsf@pond.sub.org> (raw)
In-Reply-To: <wyrnw2ur2xp7e6yr7f7hdbn3zbvolnvjojjrlaoax7hb2psxzo@xw7arzdtroer> (Gerd Hoffmann's message of "Wed, 26 Feb 2025 08:47:57 +0100")
Gerd Hoffmann <kraxel@redhat.com> writes:
> Hi,
>
>> > +# @data: variable value, encoded as hex string.
>>
>> I understand this is a blob. We commonly use base64 for that. Why not
>> here?
>
> It's an existing format already supported by other tools.
Having a second format for blobs is unfortunate.
I can't judge whether the convenience of sharing the format with other
tools is worth the additional interface complexity and code. It could
be if it avoids having to re-encode from hex to base64 in multiple
places.
Got to trust your judgement here.
> Guess I
> should add that to the preamble.
Commit messages are usually a good home for rationale.
>> > +# @digest: variable certificate digest. Used to verify the signature
>> > +# of updates for authenticated variables.
>>
>> How to create and verify these digests will be obvious enough to users
>> of this interface?
>
> Well, no. It's a somewhat complicated story ...
>
> UEFI has two kinds of authenticated variables. First, the secure boot
> variables (PK, KEK, db, dbx). These have hard-coded rules, the rule
> most relevant in practice is that signed update requests for the 'db'
> and 'dbx' variables are checked against the 'KEK' certificate database.
>
> For other authenticated variables UEFI essentially remembers the
> certificate when the variable is created, and any update / delete
> requests need a signature from the same certificate (simplified a
> bit to keep it short, the actual rules are more complicated, details
> are in the UEFI spec).
>
> This digest handles the "remembers the certificate" part.
>
> In practice the second kind of authenticated variables is rarely used.
> I have yet to see a piece of software actually using that in practice
> (other than the test case I have written).
>
>
> Also note that this is *not* part of the QMP interface. The driver uses
> this to store the efi variable store in json format on disk (see
> var-service-json.c in this patch).
>
> Adding support for reading/writing uefi variables is something we might
> add to the monitor in the future. Should that happen it is not clear
> whenever such an interface would actually use the raw 'UefiVariable'
> struct or if higher-level interfaces would be more useful. For example
> a command to query whenever the guest has secure boot turned on.
I wonder how much of this, if anything, should be worked into the doc
comment. You decide :)
With the typo I pointed out fixed:
Acked-by: Markus Armbruster <armbru@redhat.com>
next prev parent reply other threads:[~2025-02-26 8:31 UTC|newest]
Thread overview: 34+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-02-25 16:30 [PATCH v5 00/24] hw/uefi: add uefi variable service Gerd Hoffmann
2025-02-25 16:30 ` [PATCH v5 01/24] Add support for etc/hardware-info fw_cfg file Gerd Hoffmann
2025-02-25 16:30 ` [PATCH v5 02/24] hw/uefi: add include/hw/uefi/var-service-api.h Gerd Hoffmann
2025-02-25 16:30 ` [PATCH v5 03/24] hw/uefi: add include/hw/uefi/var-service-edk2.h Gerd Hoffmann
2025-02-25 16:30 ` [PATCH v5 04/24] hw/uefi: add include/hw/uefi/var-service.h Gerd Hoffmann
2025-02-25 16:30 ` [PATCH v5 05/24] hw/uefi: add var-service-guid.c Gerd Hoffmann
2025-02-25 16:30 ` [PATCH v5 06/24] hw/uefi: add var-service-utils.c Gerd Hoffmann
2025-02-25 16:30 ` [PATCH v5 07/24] hw/uefi: add var-service-vars.c Gerd Hoffmann
2025-02-25 16:30 ` [PATCH v5 08/24] hw/uefi: add var-service-auth.c Gerd Hoffmann
2025-02-25 16:30 ` [PATCH v5 09/24] hw/uefi: add var-service-policy.c Gerd Hoffmann
2025-02-25 16:30 ` [PATCH v5 10/24] hw/uefi: add var-service-core.c Gerd Hoffmann
2025-02-25 16:30 ` [PATCH v5 11/24] hw/uefi: add var-service-pkcs7.c Gerd Hoffmann
2025-02-25 16:30 ` [PATCH v5 12/24] hw/uefi: add var-service-pkcs7-stub.c Gerd Hoffmann
2025-02-25 16:30 ` [PATCH v5 13/24] hw/uefi: add var-service-siglist.c Gerd Hoffmann
2025-02-25 16:30 ` [PATCH v5 14/24] hw/uefi: add var-service-json.c + qapi for NV vars Gerd Hoffmann
2025-02-26 5:43 ` Markus Armbruster
2025-02-26 7:47 ` Gerd Hoffmann
2025-02-26 8:30 ` Markus Armbruster [this message]
2025-02-26 9:12 ` Gerd Hoffmann
2025-02-26 9:49 ` Markus Armbruster
2025-02-25 16:30 ` [PATCH v5 15/24] hw/uefi: add trace-events Gerd Hoffmann
2025-02-25 16:30 ` [PATCH v5 16/24] hw/uefi: add UEFI_VARS to Kconfig Gerd Hoffmann
2025-02-25 16:30 ` [PATCH v5 17/24] hw/uefi: add to meson Gerd Hoffmann
2025-03-20 5:40 ` Michael Tokarev
2025-02-25 16:30 ` [PATCH v5 18/24] hw/uefi: add uefi-vars-sysbus device Gerd Hoffmann
2025-02-25 16:30 ` [PATCH v5 19/24] hw/uefi-vars-sysbus: qemu platform bus support Gerd Hoffmann
2025-02-25 16:30 ` [PATCH v5 20/24] hw/uefi-vars-sysbus: add x64 variant Gerd Hoffmann
2025-02-25 16:30 ` [PATCH v5 21/24] hw/uefi-vars-sysbus: allow for arm virt Gerd Hoffmann
2025-02-25 16:30 ` [PATCH v5 22/24] hw/uefi-vars-sysbus: allow for pc and q35 Gerd Hoffmann
2025-02-25 16:30 ` [PATCH v5 23/24] hw/uefi: add MAINTAINERS entry Gerd Hoffmann
2025-03-20 7:42 ` Philippe Mathieu-Daudé
2025-02-25 16:30 ` [PATCH v5 24/24] docs: add uefi variable service documentation Gerd Hoffmann
2025-03-20 7:41 ` Philippe Mathieu-Daudé
2025-09-16 11:41 ` Peter Maydell
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87bjup3y76.fsf@pond.sub.org \
--to=armbru@redhat.com \
--cc=ardb@kernel.org \
--cc=berrange@redhat.com \
--cc=eblake@redhat.com \
--cc=eduardo@habkost.net \
--cc=graf@amazon.com \
--cc=kraxel@redhat.com \
--cc=marcandre.lureau@redhat.com \
--cc=marcel.apfelbaum@gmail.com \
--cc=michael.roth@amd.com \
--cc=mst@redhat.com \
--cc=pbonzini@redhat.com \
--cc=peter.maydell@linaro.org \
--cc=philmd@linaro.org \
--cc=qemu-arm@nongnu.org \
--cc=qemu-devel@nongnu.org \
--cc=richard.henderson@linaro.org \
--cc=thuth@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.