aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Rini <trini@konsulko.com>2020-11-29 11:12:49 -0500
committerTom Rini <trini@konsulko.com>2020-11-29 11:12:49 -0500
commitfc4c2f7f85165c5e0f72ce79849b4deb54a48ab3 (patch)
tree279ff534cc40970c4a523bdae36780558207135f
parentf6cf78dc6a83dcbc6e68655088e041a12ae253d5 (diff)
parent6974a4a37348ba272e53dd33effcc0db9e144c59 (diff)
downloadu-boot-fc4c2f7f85165c5e0f72ce79849b4deb54a48ab3.zip
u-boot-fc4c2f7f85165c5e0f72ce79849b4deb54a48ab3.tar.gz
u-boot-fc4c2f7f85165c5e0f72ce79849b4deb54a48ab3.tar.bz2
Merge tag 'efi-2021-01-rc3-3' of https://gitlab.denx.de/u-boot/custodians/u-boot-efi
Pull request for UEFI sub-system for efi-2021-01-rc3 (3) The following errors are corrected: * Linux crash when accessing UEFI variables at runtime. * UEFI variable using standalone MM on 32 bit systems not working due to missing packing of communication structure * NULL dereference when FAT16 root directory is full * FAT files with a short file name starting with 0xE5 (0x05 in directory entry) where treated as deleted. The UEFI SetTime() service is enabled on ARM QEMU.
-rw-r--r--fs/fat/fat.c3
-rw-r--r--fs/fat/fat_write.c8
-rw-r--r--include/mm_communication.h2
-rw-r--r--lib/charset.c3
-rw-r--r--lib/efi_loader/Kconfig1
5 files changed, 9 insertions, 8 deletions
diff --git a/fs/fat/fat.c b/fs/fat/fat.c
index 28aa5aa..fb6ba89 100644
--- a/fs/fat/fat.c
+++ b/fs/fat/fat.c
@@ -926,8 +926,7 @@ static int fat_itr_next(fat_itr *itr)
if (!dent)
return 0;
- if (dent->name[0] == DELETED_FLAG ||
- dent->name[0] == aRING)
+ if (dent->name[0] == DELETED_FLAG)
continue;
if (dent->attr & ATTR_VOLUME) {
diff --git a/fs/fat/fat_write.c b/fs/fat/fat_write.c
index a2682b5..7afc838 100644
--- a/fs/fat/fat_write.c
+++ b/fs/fat/fat_write.c
@@ -260,9 +260,8 @@ fill_dir_slot(fat_itr *itr, const char *l_name)
flush_dir(itr);
/* allocate a cluster for more entries */
- if (!fat_itr_next(itr))
- if (!itr->dent &&
- (!itr->is_root || itr->fsdata->fatsize == 32) &&
+ if (!fat_itr_next(itr) && !itr->dent)
+ if ((itr->is_root && itr->fsdata->fatsize != 32) ||
new_dir_table(itr))
return -1;
}
@@ -1192,7 +1191,8 @@ int file_fat_write_at(const char *filename, loff_t pos, void *buffer,
}
/* Set short name entry */
- fill_dentry(itr->fsdata, itr->dent, filename, 0, size, 0x20);
+ fill_dentry(itr->fsdata, itr->dent, filename, 0, size,
+ ATTR_ARCH);
retdent = itr->dent;
}
diff --git a/include/mm_communication.h b/include/mm_communication.h
index e464cbb..e65fbde 100644
--- a/include/mm_communication.h
+++ b/include/mm_communication.h
@@ -43,7 +43,7 @@
* To avoid confusion in interpreting frames, the communication buffer should
* always begin with efi_mm_communicate_header.
*/
-struct efi_mm_communicate_header {
+struct __packed efi_mm_communicate_header {
efi_guid_t header_guid;
size_t message_len;
u8 data[];
diff --git a/lib/charset.c b/lib/charset.c
index 5686d6f..2177014 100644
--- a/lib/charset.c
+++ b/lib/charset.c
@@ -8,6 +8,7 @@
#include <common.h>
#include <charset.h>
#include <capitalization.h>
+#include <efi_loader.h>
#include <malloc.h>
static struct capitalization_table capitalization_table[] =
@@ -372,7 +373,7 @@ size_t u16_strlen(const void *in)
return ret;
}
-size_t u16_strnlen(const u16 *in, size_t count)
+size_t __efi_runtime u16_strnlen(const u16 *in, size_t count)
{
size_t i;
for (i = 0; count-- && in[i]; i++);
diff --git a/lib/efi_loader/Kconfig b/lib/efi_loader/Kconfig
index 29ea14b..7fd3a3c 100644
--- a/lib/efi_loader/Kconfig
+++ b/lib/efi_loader/Kconfig
@@ -88,6 +88,7 @@ config EFI_GET_TIME
config EFI_SET_TIME
bool "SetTime() runtime service"
depends on EFI_GET_TIME
+ default y if ARCH_QEMU || SANDBOX
default n
help
Provide the SetTime() runtime service at boottime. This service