| 2fcaa413 | 04-Jul-2017 |
Alison Chaiken <alison@peloton-tech.com> |
gpt: harden set_gpt_info() against non NULL-terminated strings
Strings read from devices may sometimes fail to be NULL-terminated. The functions in lib/string.c are subject to failure in this case
gpt: harden set_gpt_info() against non NULL-terminated strings
Strings read from devices may sometimes fail to be NULL-terminated. The functions in lib/string.c are subject to failure in this case. Protect against observed failures in set_gpt_info() by switching to length-checking variants with a length limit of the maximum possible partition table length. At the same time, add a few checks for NULL string pointers.
Here is an example as observed in sandbox under GDB:
=> gpt verify host 0 $partitions Program received signal SIGSEGV, Segmentation fault. 0x0000000000477747 in strlen (s=0x0) at lib/string.c:267 267 for (sc = s; *sc != '\0'; ++sc) (gdb) bt #0 0x0000000000477747 in strlen (s=0x0) at lib/string.c:267 #1 0x00000000004140b2 in set_gpt_info (str_part=<optimized out>, str_disk_guid=str_disk_guid@entry=0x7fffffffdbe8, partitions=partitions@entry=0x7fffffffdbd8, parts_count=parts_count@entry=0x7fffffffdbcf "", dev_desc=<optimized out>) at cmd/gpt.c:415 #2 0x00000000004145b9 in gpt_verify (str_part=<optimized out>, blk_dev_desc=0x7fffef09a9d0) at cmd/gpt.c:580 #3 do_gpt (cmdtp=<optimized out>, flag=<optimized out>, argc=<optimized out>, argv=0x7fffef09a8f0) at cmd/gpt.c:783 #4 0x00000000004295b0 in cmd_call (argv=0x7fffef09a8f0, argc=0x5, flag=<optimized out>, cmdtp=0x714e20 <_u_boot_list_2_cmd_2_gpt>) at common/command.c:500 #5 cmd_process (flag=<optimized out>, argc=0x5, argv=0x7fffef09a8f0, repeatable=repeatable@entry=0x726c04 <flag_repeat>, ticks=ticks@entry=0x0) at common/command.c:539
Suggested-by: Lothar Waßmann <LW@karo-electronics.de> Signed-off-by: Alison Chaiken <alison@peloton-tech.com>
show more ...
|
| 203f9b48 | 04-Jul-2017 |
Alison Chaiken <alison@peloton-tech.com> |
GPT: provide commands to selectively rename partitions
This patch provides support in u-boot for renaming GPT partitions. The renaming is accomplished via new 'gpt swap' and 'gpt rename' commands.
GPT: provide commands to selectively rename partitions
This patch provides support in u-boot for renaming GPT partitions. The renaming is accomplished via new 'gpt swap' and 'gpt rename' commands.
The 'swap' mode returns an error if no matching partition names are found, or if the number of partitions with one name does not equal the number with the second name. The 'rename' variant always succeeds as long as a partition with the provided number exists.
Rewriting the partition table has the side-effect that all partitions end up with "msftdata" flag set. The reason is that partition type PARTITION_BASIC_DATA_GUID is hard-coded in the gpt_fill_pte() function. This does not appear to cause any harm.
Signed-off-by: Alison Chaiken <alison@peloton-tech.com>
show more ...
|
| 09a49930 | 04-Jul-2017 |
Alison Chaiken <alison@peloton-tech.com> |
GPT: read partition table from device into a data structure
Make the partition table available for modification by reading it from the user-specified device into a linked list. Provide an accessor
GPT: read partition table from device into a data structure
Make the partition table available for modification by reading it from the user-specified device into a linked list. Provide an accessor function for command-line testing.
Signed-off-by: Alison Chaiken <alison@peloton-tech.com> [trini: Make this depend on CMD_GPT_RENAME, as it is the user of this code] Signed-off-by: Tom Rini <trini@konsulko.com>
show more ...
|
| f4f9993f | 26-Jul-2017 |
Alexander Graf <agraf@suse.de> |
efi_loader: Fix configuration table override
Before commit 7cbc12415d ("efi_loader: initalize EFI object list only once") we recreated the world on every bootefi invocation.
That included the objec
efi_loader: Fix configuration table override
Before commit 7cbc12415d ("efi_loader: initalize EFI object list only once") we recreated the world on every bootefi invocation.
That included the object tree as well as the configuration tables.
Now however we don't recreate them, which means we must not explicitly override the configuration tables, as otherwise we may lose our SMBIOS table from the configuration table list on second bootefi invocation.
This patch makes bootefi call our normal configuration table modification APIs to add/remove the FDT instead of recreating all tables from scratch. That way the SMBIOS table gets preserved across multiple invocations.
Signed-off-by: Alexander Graf <agraf@suse.de>
show more ...
|
| 3e433e96 | 24-Jul-2017 |
Rob Clark <robdclark@gmail.com> |
efi_loader: EFI file paths should be DOS style
shim.efi, for example, actually tries to parse this, but is expecting backslashes.
Signed-off-by: Rob Clark <robdclark@gmail.com> Signed-off-by: Alexa
efi_loader: EFI file paths should be DOS style
shim.efi, for example, actually tries to parse this, but is expecting backslashes.
Signed-off-by: Rob Clark <robdclark@gmail.com> Signed-off-by: Alexander Graf <agraf@suse.de>
show more ...
|
| 24fc9531 | 12-Jul-2017 |
Karl Beldan <karl.beldan-ext@sagemcom.com> |
cmd: Kconfig: Fix CMD_UBIFS dependencies
Remove the ARCH_SUNXI and RBTREE dependencies. CMD_UBIFS already gets RBTREE from CMD_UBI (from MTD_UBI), and should the first become independant from the la
cmd: Kconfig: Fix CMD_UBIFS dependencies
Remove the ARCH_SUNXI and RBTREE dependencies. CMD_UBIFS already gets RBTREE from CMD_UBI (from MTD_UBI), and should the first become independant from the latter, there would likely be a dependency on MTD_UBI anyway.
Cc: Boris Brezillon <boris.brezillon@free-electrons.com> Cc: Jagan Teki <jagan@openedev.com> Signed-off-by: Karl Beldan <karl.beldan-ext@sagemcom.com> Reviewed-by: Tom Rini <trini@konsulko.com>
show more ...
|
| 22cf953a | 12-Jul-2017 |
Karl Beldan <karl.beldan-ext@sagemcom.com> |
cmd: Kconfig: Make CMD_UBI select CMD_MTDPARTS
Many configs still define CMD_MTDPARTS in their non-Kconfig but CMD_MTDPARTS has now moved to Kconfig.
Signed-off-by: Karl Beldan <karl.beldan-ext@sag
cmd: Kconfig: Make CMD_UBI select CMD_MTDPARTS
Many configs still define CMD_MTDPARTS in their non-Kconfig but CMD_MTDPARTS has now moved to Kconfig.
Signed-off-by: Karl Beldan <karl.beldan-ext@sagemcom.com> Reviewed-by: Tom Rini <trini@konsulko.com>
show more ...
|
| 1da1bac4 | 04-Jul-2017 |
xypron.glpk@gmx.de <xypron.glpk@gmx.de> |
efi_loader: provide meaningful status code
Currenty any EFI status other than EFI_SUCCESS is reported as Application terminated, r = -22
With the patch the status code returned by the EFI applicati
efi_loader: provide meaningful status code
Currenty any EFI status other than EFI_SUCCESS is reported as Application terminated, r = -22
With the patch the status code returned by the EFI application is printed.
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Signed-off-by: Alexander Graf <agraf@suse.de>
show more ...
|
| b06d8ac3 | 04-Jul-2017 |
xypron.glpk@gmx.de <xypron.glpk@gmx.de> |
bootefi: allow return without EFI_BOOT_SERVICES.Exit
The Unified Extensible Firmware Interface Specification, version 2.7, defines in chapter 2.1.2 - UEFI Application that an EFI application may eit
bootefi: allow return without EFI_BOOT_SERVICES.Exit
The Unified Extensible Firmware Interface Specification, version 2.7, defines in chapter 2.1.2 - UEFI Application that an EFI application may either directly return or call EFI_BOOT_SERVICES.Exit().
Unfortunately U-Boot makes the incorrect assumption that EFI_BOOT_SERVICES.Exit() is always called.
So the following application leads to a memory exception on the aarch64 architecture when returning:
EFI_STATUS efi_main( EFI_HANDLE handle, EFI_SYSTEM_TABlE systable) { return EFI_SUCCESS; }
With this patch the entry point is stored in the image handle.
The new wrapper function do_enter is used to call the EFI entry point.
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Signed-off-by: Alexander Graf <agraf@suse.de>
show more ...
|