Aristo Chen and Heinrich Schuchardt
7a63ea5889
cmd: nvedit_efi: use efi_auth_var_get_guid() for the default GUID
...
do_env_set_efi() hand rolls the mapping from well known variable names
to their default vendor GUID and has already drifted from the canonical
name_type[] table in efi_var_common.c: it does not know "dbr", so
"env set -e dbr" operates on the variable under EFI_GLOBAL_VARIABLE_GUID
instead of the image security database GUID, silently creating a
variable that nothing will ever consume.
Convert the variable name to UTF-16 before selecting the GUID and let
efi_auth_var_get_guid() do the lookup. That function knows all
authenticated variables including "dbr" and falls back to
EFI_GLOBAL_VARIABLE_GUID for any other name, so behaviour is unchanged
for "db", "dbx", "dbt" and non-authenticated variables. Future
additions to the table now apply to the shell command automatically.
Since the conversion now happens before the value parsing loop, free
the UTF-16 name at the common exit label so the error path there does
not leak it.
Also drop the unmap_sysmem() call right after efi_set_variable_int():
the common exit path already unmaps the value for the -i case and frees
it otherwise, so the value was unmapped twice. On sandbox the second
call triggers a spurious "Address not mapped" warning for addresses
that get a tagged mapping.
Signed-off-by: Aristo Chen <aristo.chen@canonical.com >
Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de >
2026-07-27 18:50:28 +02:00
..
2024-06-26 13:17:51 -06:00
2025-05-29 08:29:16 -06:00
2026-06-23 13:13:16 +02:00
2026-02-06 16:37:31 +01:00
2025-02-03 11:33:04 +08:00
2025-05-29 08:29:16 -06:00
2026-06-25 14:13:34 -06:00
2026-07-10 15:52:59 -06:00
2025-05-29 08:29:16 -06:00
2026-01-15 14:00:55 +01:00
2025-04-03 11:43:22 -06:00
2025-05-29 08:29:16 -06:00
2025-07-11 10:43:29 -06:00
2025-05-29 08:29:16 -06:00
2025-05-29 08:29:16 -06:00
2026-06-24 18:13:24 -06:00
2024-08-27 14:30:14 -06:00
2025-04-10 20:55:53 -06:00
2025-05-29 08:29:16 -06:00
2024-06-26 13:17:51 -06:00
2026-02-17 13:50:22 -06:00
2026-07-03 13:45:58 -06:00
2025-01-15 08:48:42 -06:00
2026-05-01 10:30:03 +02:00
2025-10-13 14:54:33 -06:00
2025-06-25 09:50:37 -06:00
2026-02-17 13:50:22 -06:00
2026-06-10 14:49:43 -06:00
2025-05-29 08:29:16 -06:00
2025-05-29 08:29:16 -06:00
2025-01-15 08:48:42 -06:00
2025-06-25 09:50:37 -06:00
2025-10-07 17:49:15 -06:00
2025-05-29 08:29:16 -06:00
2025-05-13 11:30:08 -06:00
2025-05-30 09:49:31 +01:00
2024-06-26 13:17:51 -06:00
2024-10-09 22:04:56 -06:00
2026-07-10 15:50:48 -06:00
2025-04-24 10:44:07 -06:00
2026-07-21 13:51:07 -06:00
2026-04-22 14:23:49 -06:00
2024-07-15 12:12:17 -06:00
2024-08-02 15:16:51 -03:00
2024-07-15 12:12:17 -06:00
2026-05-25 13:43:31 -06:00
2024-06-16 12:13:44 +02:00
2026-07-23 15:15:34 -06:00
2025-05-29 08:29:16 -06:00
2025-05-29 08:29:16 -06:00
2025-05-29 08:29:16 -06:00
2024-06-07 10:48:41 -06:00
2024-09-12 17:35:37 +02:00
2024-09-12 17:35:37 +02:00
2026-04-22 14:23:49 -06:00
2026-05-01 10:30:03 +02:00
2026-05-01 10:30:03 +02:00
2025-07-28 13:04:42 -06:00
2025-11-27 08:43:45 -06:00
2026-06-26 11:12:22 +02:00
2024-10-29 16:17:47 -06:00
2026-07-13 17:06:29 -06:00
2025-05-29 08:29:16 -06:00
2024-10-18 14:10:21 -06:00
2026-04-23 11:49:48 +02:00
2025-04-02 20:00:59 -06:00
2025-05-29 08:29:16 -06:00
2025-04-11 13:20:38 +02:00
2026-02-04 10:30:55 -06:00
2025-05-29 08:29:16 -06:00
2025-07-08 15:00:17 +02:00
2026-07-10 15:51:21 -06:00
2025-08-06 07:49:13 +02:00
2026-07-22 13:10:17 -06:00
2026-03-18 13:07:36 -06:00
2026-07-10 15:52:16 -06:00
2025-05-29 08:29:16 -06:00
2024-06-30 10:59:42 -06:00
2026-07-13 09:16:57 +08:00
2025-12-03 11:03:45 -06:00
2025-06-02 17:26:16 -06:00
2025-06-25 09:50:37 -06:00
2025-01-26 11:06:56 +01:00
2026-07-13 09:16:57 +08:00
2026-07-23 15:16:09 -06:00
2026-02-17 13:50:22 -06:00
2026-02-07 11:51:43 -06:00
2026-06-09 23:55:56 +08:00
2025-05-29 08:29:16 -06:00
2025-11-18 20:06:21 +01:00
2025-06-02 17:26:16 -06:00
2025-08-23 16:37:20 +02:00
2026-01-15 11:09:28 +01:00
2026-02-06 16:37:31 +01:00
2026-07-27 18:50:28 +02:00
2025-12-18 10:26:22 -06:00
2026-01-02 15:51:54 -06:00
2025-05-29 08:29:16 -06:00
2026-05-12 15:52:01 +02:00
2026-07-13 09:16:57 +08:00
2025-04-08 16:23:51 -06:00
2026-07-23 15:15:59 -06:00
2025-05-29 08:31:07 -06:00
2025-11-06 23:26:27 +01:00
2025-12-30 11:22:57 -06:00
2026-07-21 13:52:50 -06:00
2025-07-24 11:49:18 -06:00
2024-12-24 17:02:23 +01:00
2024-12-02 07:40:39 -06:00
2025-10-09 14:16:11 -06:00
2026-04-08 11:07:00 -06:00
2025-05-29 08:29:16 -06:00
2025-02-07 13:35:23 -06:00
2025-10-14 08:19:43 -06:00
2025-05-29 08:29:16 -06:00
2025-05-29 08:29:16 -06:00
2025-12-04 09:38:58 -06:00
2026-02-18 08:27:51 -06:00
2025-05-29 08:29:16 -06:00
2026-02-17 13:50:22 -06:00
2025-05-29 08:29:16 -06:00
2026-02-17 13:50:22 -06:00
2025-05-29 08:29:16 -06:00
2026-07-23 15:15:48 -06:00
2025-01-15 08:48:42 -06:00
2024-10-17 03:12:47 +02:00
2025-10-08 13:54:59 -06:00
2025-09-16 13:43:33 -06:00
2026-04-02 16:00:29 -06:00
2025-05-29 08:29:16 -06:00
2025-07-29 08:44:18 +02:00
2024-07-15 12:12:17 -06:00
2025-12-04 09:38:58 -06:00
2024-12-31 19:00:46 -06:00
2026-07-08 11:34:44 +02:00
2026-07-08 11:30:14 +02:00
2026-06-24 18:13:24 -06:00
2025-05-29 08:29:16 -06:00
2024-07-03 07:36:32 +01:00
2026-02-06 09:29:55 -06:00
2026-07-10 15:52:36 -06:00
2026-04-29 10:32:04 +02:00
2024-09-18 13:00:59 -06:00
2024-10-11 11:44:47 -06:00
2025-03-17 08:06:53 -06:00
2025-05-22 14:26:38 -06:00
2024-07-15 12:12:17 -06:00
2026-02-06 09:29:53 -06:00