diff options
| author | Gerd Hoffmann <kraxel@redhat.com> | 2025-08-11 15:01:09 +0200 |
|---|---|---|
| committer | Gerd Hoffmann <kraxel@redhat.com> | 2025-08-12 08:03:16 +0200 |
| commit | fc8ee8fe58ad410f27fca64e4ad212c5a3eabe00 (patch) | |
| tree | 18efe978f184c4c0efa73233f28945204cdf5344 /hw/uefi | |
| parent | 88e5a28d5aabb57f44c1805fbba0a458023f5106 (diff) | |
| download | focaccia-qemu-fc8ee8fe58ad410f27fca64e4ad212c5a3eabe00.tar.gz focaccia-qemu-fc8ee8fe58ad410f27fca64e4ad212c5a3eabe00.zip | |
hw/uefi: check access for first variable
When listing variables (via get-next-variable-name) only the names of variables which can be accessed will be returned. That check was missing for the first variable though. Add it. Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Message-ID: <20250811130110.820958-3-kraxel@redhat.com>
Diffstat (limited to 'hw/uefi')
| -rw-r--r-- | hw/uefi/var-service-vars.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/hw/uefi/var-service-vars.c b/hw/uefi/var-service-vars.c index cbeccdbd26..8533533ea5 100644 --- a/hw/uefi/var-service-vars.c +++ b/hw/uefi/var-service-vars.c @@ -357,6 +357,9 @@ uefi_vars_mm_get_next_variable(uefi_vars_state *uv, mm_header *mhdr, if (uefi_strlen(name, nv->name_size) == 0) { /* empty string -> first */ var = QTAILQ_FIRST(&uv->variables); + while (var && !check_access(uv, var)) { + var = QTAILQ_NEXT(var, next); + } if (!var) { return uefi_vars_mm_error(mhdr, mvar, EFI_NOT_FOUND); } |