From dd12c6a4463ff62271a783772b92571dab3b56fb Mon Sep 17 00:00:00 2001 From: Heinrich Schuchardt Date: Sat, 15 Aug 2020 23:09:35 +0200 Subject: efi_loader: remove empty comment line Remove a line leading to a warning in make htmldocs. Signed-off-by: Heinrich Schuchardt --- include/efi_variable.h | 1 - 1 file changed, 1 deletion(-) (limited to 'include') diff --git a/include/efi_variable.h b/include/efi_variable.h index 60491cb6402..4704a3c16e6 100644 --- a/include/efi_variable.h +++ b/include/efi_variable.h @@ -274,7 +274,6 @@ efi_get_next_variable_name_mem(efi_uintn_t *variable_name_size, u16 *variable_na * @data: buffer to which the variable value is copied * @timep: authentication time (seconds since start of epoch) * Return: status code - */ efi_status_t __efi_runtime efi_get_variable_mem(u16 *variable_name, const efi_guid_t *vendor, u32 *attributes, -- cgit v1.2.3 From ed0b10722c880d82e5da2a357122f5ae0e53d4db Mon Sep 17 00:00:00 2001 From: Heinrich Schuchardt Date: Sun, 23 Aug 2020 09:54:44 +0200 Subject: include: kernel.h: define SSIZE_MAX Define SSIZE_MAX, the largest value fitting into a variable of type ssize_t. Signed-off-by: Heinrich Schuchardt --- include/linux/kernel.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'include') diff --git a/include/linux/kernel.h b/include/linux/kernel.h index b88c2100659..3e71d61074b 100644 --- a/include/linux/kernel.h +++ b/include/linux/kernel.h @@ -19,6 +19,9 @@ #ifndef SIZE_MAX #define SIZE_MAX (~(size_t)0) #endif +#ifndef SSIZE_MAX +#define SSIZE_MAX ((ssize_t)(SIZE_MAX >> 1)) +#endif #define U8_MAX ((u8)~0U) #define S8_MAX ((s8)(U8_MAX>>1)) -- cgit v1.2.3 From 5cad4a30932a31f1646510d35af7e9e36f71708a Mon Sep 17 00:00:00 2001 From: Heinrich Schuchardt Date: Sun, 23 Aug 2020 10:49:46 +0200 Subject: 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 --- include/efi_loader.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'include') diff --git a/include/efi_loader.h b/include/efi_loader.h index 50a17a33ca4..0baa1d2324c 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) && \ -- cgit v1.2.3