Pull request for UEFI sub-system for v2019.10-rc5

Bug fixes for the SetVariable() boot service.
 -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCAAdFiEEbcT5xx8ppvoGt20zxIHbvCwFGsQFAl2LnfkACgkQxIHbvCwF
 GsTuUQ//V5kJWSwBHQb6EqKqmJoBOfS37n3jkbZbpfuKyIFMhuLCsWueVo9PJFlh
 /NVxnt0gWp1hVoaNhzNKq/GwkPHKOoJUfE1vNpVl/5x9i0cRpDgsEbYDToMFno00
 ILDUgj6wbcGKH2Xp1R/EPCRv0BX9EyLr21upSxp9oWiAhR0FU3IXCofL3INu+A6n
 LmEHM0UrEeYX4odwLnz6yWXccb4GV2RU4xufGz4sROkrn+6UDboYWrspLAsmCqVw
 ldb9pQS0/WMyj8a/9Y2HKm/E6i1RkN5Mivkk1nDYAI9tz71Tt19gdX9KepFi57Ac
 rJzN6v8iTPq2MhGrZ/vxI+4Dx8tiOV6dV2H3lWBJHgnf3gk2eDGtW2p+IjFRrpx2
 4S92EcyamCtb75KtcOOPLacMwvd8EEMC5gWY94+JrXSIZxYtCkf42CV6sItJCKNO
 O8+tMlrQZUQ3chU4UocgZBEeDml+NS5lIQ5Hgf9cqhHgYHPiW5gHN8uvEgwyC3mb
 PQJ+qqiMJXwJbkxWknQrS0G6RjRLFZr7tWcI6hOMUPuCuqPFgHRdENCOQEAMdET0
 L3tJ2i+1GiRrlWT0qu0KyUM44X80YsQyQxGQVcx4mFJlqgSLHgWdccw1m1PNrt7g
 JTqqAEneovzd/mjrITmpIKMJSYTlx2P/+HpLAjzpSZBiSdKdkj4=
 =jgKo
 -----END PGP SIGNATURE-----

Merge tag 'efi-2019-10-rc5' of https://gitlab.denx.de/u-boot/custodians/u-boot-efi

Pull request for UEFI sub-system for v2019.10-rc5

Bug fixes for the SetVariable() boot service.
This commit is contained in:
Tom Rini 2019-09-26 17:22:22 -04:00
commit dfd590075c
2 changed files with 7 additions and 11 deletions

View file

@ -43,11 +43,6 @@ const efi_guid_t efi_guid_unicode_collation_protocol2 =
* See the Unified Extensible Firmware Interface (UEFI) specification for
* details.
*
* TODO:
* The implementation does not follow the Unicode collation algorithm.
* For ASCII characters it results in the same sort order as EDK2.
* We could use table UNICODE_CAPITALIZATION_TABLE for better results.
*
* Return: 0: s1 == s2, > 0: s1 > s2, < 0: s1 < s2
*/
static efi_intn_t EFIAPI efi_stri_coll(

View file

@ -443,8 +443,6 @@ efi_status_t EFIAPI efi_set_variable(u16 *variable_name,
if (ret)
goto out;
#define ACCESS_ATTR (EFI_VARIABLE_RUNTIME_ACCESS | EFI_VARIABLE_BOOTSERVICE_ACCESS)
old_val = env_get(native_name);
if (old_val) {
old_val = parse_attr(old_val, &attr);
@ -455,7 +453,9 @@ efi_status_t EFIAPI efi_set_variable(u16 *variable_name,
goto out;
}
if ((data_size == 0) || !(attributes & ACCESS_ATTR)) {
if ((data_size == 0 &&
!(attributes & EFI_VARIABLE_APPEND_WRITE)) ||
!attributes) {
/* delete the variable: */
env_set(native_name, NULL);
ret = EFI_SUCCESS;
@ -470,7 +470,7 @@ efi_status_t EFIAPI efi_set_variable(u16 *variable_name,
if (attributes & EFI_VARIABLE_APPEND_WRITE) {
if (!prefix(old_val, "(blob)")) {
return EFI_DEVICE_ERROR;
ret = EFI_DEVICE_ERROR;
goto out;
}
old_size = strlen(old_val);
@ -478,8 +478,9 @@ efi_status_t EFIAPI efi_set_variable(u16 *variable_name,
old_size = 0;
}
} else {
if ((data_size == 0) || !(attributes & ACCESS_ATTR) ||
(attributes & EFI_VARIABLE_APPEND_WRITE)) {
if ((data_size == 0 &&
!(attributes & EFI_VARIABLE_APPEND_WRITE)) ||
!attributes) {
/* delete, but nothing to do */
ret = EFI_NOT_FOUND;
goto out;