aboutsummaryrefslogtreecommitdiff
path: root/include/efi_loader.h
diff options
context:
space:
mode:
authorHeinrich Schuchardt <xypron.glpk@gmx.de>2020-08-23 10:49:46 +0200
committerHeinrich Schuchardt <xypron.glpk@gmx.de>2020-08-24 16:37:53 +0200
commit5cad4a30932a31f1646510d35af7e9e36f71708a (patch)
tree6f1fdb4a9cbb0dfd88065fe672dfaace03119ab4 /include/efi_loader.h
parented0b10722c880d82e5da2a357122f5ae0e53d4db (diff)
downloadu-boot-5cad4a30932a31f1646510d35af7e9e36f71708a.zip
u-boot-5cad4a30932a31f1646510d35af7e9e36f71708a.tar.gz
u-boot-5cad4a30932a31f1646510d35af7e9e36f71708a.tar.bz2
efi_loader: efi_dp_check_length()
We need to check that device paths provided via UEFI variables are not malformed. Provide function efi_dp_check_length() to check if a device path has an end node within a given number of bytes. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Diffstat (limited to 'include/efi_loader.h')
-rw-r--r--include/efi_loader.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/include/efi_loader.h b/include/efi_loader.h
index 50a17a3..0baa1d2 100644
--- a/include/efi_loader.h
+++ b/include/efi_loader.h
@@ -631,6 +631,8 @@ efi_status_t efi_dp_from_name(const char *dev, const char *devnr,
const char *path,
struct efi_device_path **device,
struct efi_device_path **file);
+ssize_t efi_dp_check_length(const struct efi_device_path *dp,
+ const size_t maxlen);
#define EFI_DP_TYPE(_dp, _type, _subtype) \
(((_dp)->type == DEVICE_PATH_TYPE_##_type) && \