@samitouri / QOSamiQemu / commits / ff5a9eb13c

hw/uefi: remove debug function

This was never meant to be present in production builds. It's a code path not hit on a normal boot (OVMF wouldn't try variable updates which are not allowed), so this went unnoticed. Remove the function. If needed for debugging the git log is your friend. Fixes: CVE-2026-58582 Resolves: https://gitlab.com/qemu-project/qemu/-/work_items/3615 Acked-by: Luigi Leonardi <leonardi@redhat.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Message-ID: <20260720143244.821889-3-kraxel@redhat.com>

Gerd Hoffmann committed Jul 20, 2026 at 16:32 UTC ff5a9eb13c862ed274ea0d0682a6573411e31543
1 file changed -32
hw/uefi/var-service-policy.c
-32
@@ -37,37 +37,6 @@ const VMStateDescription vmstate_uefi_var_policy = {
37 },
38 };
39
40 -static void print_policy_entry(variable_policy_entry *pe)
41 -{
42 - uint16_t *name = (void *)pe + pe->offset_to_name;
43 -
44 - fprintf(stderr, "%s:\n", __func__);
45 -
46 - fprintf(stderr, " name ´");
47 - while (*name) {
48 - fprintf(stderr, "%c", *name);
49 - name++;
50 - }
51 - fprintf(stderr, "', version=%d.%d, size=%d\n",
52 - pe->version >> 16, pe->version & 0xffff, pe->size);
53 -
54 - if (pe->min_size) {
55 - fprintf(stderr, " size min=%d\n", pe->min_size);
56 - }
57 - if (pe->max_size != UINT32_MAX) {
58 - fprintf(stderr, " size max=%u\n", pe->max_size);
59 - }
60 - if (pe->attributes_must_have) {
61 - fprintf(stderr, " attr must=0x%x\n", pe->attributes_must_have);
62 - }
63 - if (pe->attributes_cant_have) {
64 - fprintf(stderr, " attr cant=0x%x\n", pe->attributes_cant_have);
65 - }
66 - if (pe->lock_policy_type) {
67 - fprintf(stderr, " lock policy type %d\n", pe->lock_policy_type);
68 - }
69 -}
70 -
40 static gboolean wildcard_str_equal(uefi_var_policy *pol,
41 uefi_variable *var)
42 {
@@ -173,7 +142,6 @@ efi_status uefi_vars_policy_check(uefi_vars_state *uv,
142 pe = pol->entry;
143
144 uefi_trace_variable(__func__, var->guid, var->name, var->name_size);
176 - print_policy_entry(pe);
145
146 if ((var->attributes & pe->attributes_must_have) != pe->attributes_must_have) {
147 trace_uefi_vars_policy_deny("must-have-attr");