17394f9a | 27-Mar-2019 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
efi_loader: TODO for the EFI file protocol
We currently only support EFI_FILE_PROTOCOL_REVISION while UEFI specs 2.4 - 2.7 prescribe EFI_FILE_PROTOCOL_REVISION2. Add a todo.
Add missing constants f
efi_loader: TODO for the EFI file protocol
We currently only support EFI_FILE_PROTOCOL_REVISION while UEFI specs 2.4 - 2.7 prescribe EFI_FILE_PROTOCOL_REVISION2. Add a todo.
Add missing constants for the EFI file protocol revision.
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
show more ...
|
1646e092 | 19-Mar-2019 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
efi_loader: superfluous conversion in efi_file_open()
printf("%ls", ..) expects u16 * as argument to print. There is not need for a conversion to wchar_t *.
Signed-off-by: Heinrich Schuchardt <xypr
efi_loader: superfluous conversion in efi_file_open()
printf("%ls", ..) expects u16 * as argument to print. There is not need for a conversion to wchar_t *.
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
show more ...
|
d5974af7 | 19-Mar-2019 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
efi_loader: remove superfluous check in efi_setup_loaded_image()
It does not make any sense to check if a pointer is NULL if we have dereferenced it before.
Reported-by: Coverity (CID 185827) Signe
efi_loader: remove superfluous check in efi_setup_loaded_image()
It does not make any sense to check if a pointer is NULL if we have dereferenced it before.
Reported-by: Coverity (CID 185827) Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
show more ...
|
e7dae584 | 19-Mar-2019 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
efi_loader: missing return in efi_get_next_variable_name()
Add a missing return statement in efi_get_next_variable_name().
Reported-by: Coverity (CID 185834) Signed-off-by: Heinrich Schuchardt <xyp
efi_loader: missing return in efi_get_next_variable_name()
Add a missing return statement in efi_get_next_variable_name().
Reported-by: Coverity (CID 185834) Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
show more ...
|
bd3b7478 | 19-Mar-2019 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
efi_loader: endless loop in add_strings_package()
Avoid an endless loop in add_strings_package().
Suggested-by: Takahiro Akashi <takahiro.akashi@linaro.org> Reported-by: Coverity (CID 185833) Signe
efi_loader: endless loop in add_strings_package()
Avoid an endless loop in add_strings_package().
Suggested-by: Takahiro Akashi <takahiro.akashi@linaro.org> Reported-by: Coverity (CID 185833) Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
show more ...
|
306b1671 | 18-Mar-2019 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
efi_loader: correct parameter size in efi_allocate_pool
efi_allocate_pages() expects a (uint64_t *) pointer to pass the address of the assigned memory. If we pass the address of a pointer here, an i
efi_loader: correct parameter size in efi_allocate_pool
efi_allocate_pages() expects a (uint64_t *) pointer to pass the address of the assigned memory. If we pass the address of a pointer here, an illegal memory access occurs on 32bit systems.
Fixes: 282a06cbcae8 ("efi_loader: Expose U-Boot addresses in memory map for sandbox") Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
show more ...
|
dd1a1ec2 | 05-Mar-2019 |
Matthias Brugger <mbrugger@suse.com> |
efi_loader: Fix serial console size detection
Function term_read_reply tries to read from the serial console until the end_char was read. This can hang forever if we are, for some reason, not able t
efi_loader: Fix serial console size detection
Function term_read_reply tries to read from the serial console until the end_char was read. This can hang forever if we are, for some reason, not able to read the full response (e.g. serial buffer too small, frame error). This patch moves the timeout detection into term_read_reply() to assure we will make progress.
Fixes: 6bb591f704 ("efi_loader: query serial console size reliably") Signed-off-by: Matthias Brugger <mbrugger@suse.com>
Throw missing error when an incomplete reply for the cursor position is received.
Change type of argument of term_get_char() *s32. This renders the function reusable in efi_cin_read_key().
Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
show more ...
|
1a9fce50 | 28-Feb-2019 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
efi_loader: HII protocols: debug messages
When package types are not supported by our implementation of the HII database protocol supported error messages are displayed.
Essentially the output is o
efi_loader: HII protocols: debug messages
When package types are not supported by our implementation of the HII database protocol supported error messages are displayed.
Essentially the output is only needed for debugging. By using EFI_PRINT() the messages are only written for in debug mode and with correct indentation.
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
show more ...
|
fdef2983 | 28-Feb-2019 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
efi_loader: HII protocols: fix new_package_list()
In new_package_list() we call new_packagelist() to create a new package list. Next we try to add the packages which fails for form packages. Due to
efi_loader: HII protocols: fix new_package_list()
In new_package_list() we call new_packagelist() to create a new package list. Next we try to add the packages which fails for form packages. Due to this error we call free_packagelist(). Now in free_packagelist() list_del() is called for an uninitialized field hii->link. This leads to changing random memory addresses.
To solve the problem move the initialization of hii->link to new_packagelist().
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: AKASHI Takahiro <takahiro.akashi@linaro.org>
show more ...
|
30a231dc | 23-Feb-2019 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
efi_loader: do not add \ in efi_fs_from_name()
In the `efidebug boot add` command we do not want an unsolicited leading backslash added to the file name.
There is no good reason to mark a loaded fi
efi_loader: do not add \ in efi_fs_from_name()
In the `efidebug boot add` command we do not want an unsolicited leading backslash added to the file name.
There is no good reason to mark a loaded file with a backslash as absolute. Anyway when reading files the file name will be interpreted as relative to root directory of the device.
So let's get rid of this backslash.
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
show more ...
|
454568b4 | 25-Feb-2019 |
AKASHI Takahiro <takahiro.akashi@linaro.org> |
efi_loader: define load option attributes
See UEFI specification v2.7a, section 3.1.3, "Load Option Processing."
Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org> Reviewed-by: Heinrich Sc
efi_loader: define load option attributes
See UEFI specification v2.7a, section 3.1.3, "Load Option Processing."
Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
show more ...
|
ccecc345 | 23-Feb-2019 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
efi_loader: fix entry count in bootmgr
Since commit 914df75b0c97 ("efi_loader: fix EFI entry counting") entry_count is already set to 1 before efi_bootmgr_load() is called. So we should not incremen
efi_loader: fix entry count in bootmgr
Since commit 914df75b0c97 ("efi_loader: fix EFI entry counting") entry_count is already set to 1 before efi_bootmgr_load() is called. So we should not increment it when entering the function.
Without the patch an assert error occurs in efi_get_variable() if DEBUG is defined.
Fixes: 914df75b0c97 ("efi_loader: fix EFI entry counting") Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
show more ...
|
33e44971 | 23-Feb-2019 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
efi_loader: error message if BootOrder not defined
For booting via `bootefi bootmgr` it is necessary that the EFI variable BootOrder is defined. Provide a diagnostic message if the variable is missi
efi_loader: error message if BootOrder not defined
For booting via `bootefi bootmgr` it is necessary that the EFI variable BootOrder is defined. Provide a diagnostic message if the variable is missing.
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
show more ...
|
997fc12e | 16-Feb-2019 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
efi_loader: do not miss last relocation block
If the last block in the relocation table contains only a single relocation, the current coding ignores it.
Fix the determination of the end of the rel
efi_loader: do not miss last relocation block
If the last block in the relocation table contains only a single relocation, the current coding ignores it.
Fix the determination of the end of the relocation table.
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
show more ...
|
1db561e1 | 16-Feb-2019 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
efi_loader: documentation of image loader
- Add missing function descriptions. - Update existing function descriptions to match Sphinx style. - Add lib/efi_loader/efi_image_loader.c to the input fil
efi_loader: documentation of image loader
- Add missing function descriptions. - Update existing function descriptions to match Sphinx style. - Add lib/efi_loader/efi_image_loader.c to the input files for Sphinx generated documentation.
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
show more ...
|
914df75b | 09-Feb-2019 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
efi_loader: fix EFI entry counting
`bootefi selftest` fails on qemu-x86_defconfig if efi_selftest() is not invoked using EFI_CALL().
Likewise we call the entry point of EFI payloads with EFI_CALL(e
efi_loader: fix EFI entry counting
`bootefi selftest` fails on qemu-x86_defconfig if efi_selftest() is not invoked using EFI_CALL().
Likewise we call the entry point of EFI payloads with EFI_CALL(efi_start_image()).
entry_count indicates if we are in U-Boot (1) or in EFI payload code (0). As we start in U-Boot code the initial value has to be 1.
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
show more ...
|
f69d63fa | 26-Dec-2018 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
efi_loader: use efi_start_image() for bootefi
Remove the duplicate code in efi_do_enter() and use efi_start_image() to start the image invoked by the bootefi command.
Signed-off-by: Heinrich Schuch
efi_loader: use efi_start_image() for bootefi
Remove the duplicate code in efi_do_enter() and use efi_start_image() to start the image invoked by the bootefi command.
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
show more ...
|
8f7e2b29 | 26-Dec-2018 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
efi_loader: set entry point in efi_load_pe()
Up to now efi_load_pe() returns the entry point or NULL in case of an error. This does not allow to return correct error codes from LoadImage().
Let efi
efi_loader: set entry point in efi_load_pe()
Up to now efi_load_pe() returns the entry point or NULL in case of an error. This does not allow to return correct error codes from LoadImage().
Let efi_load_pe() return a status code and fill in the entry point in the corresponding field of the image object.
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
show more ...
|
0e18f584 | 24-Dec-2018 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
efi_loader: LoadImage: always allocate new pages
If we want to properly unload images in Exit() the memory should always be allocated in the same way. As we allocate memory when reading from file we
efi_loader: LoadImage: always allocate new pages
If we want to properly unload images in Exit() the memory should always be allocated in the same way. As we allocate memory when reading from file we should do the same when the original image is in memory.
A further patch will be needed to free the memory when Exit() is called.
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
show more ...
|
16112f9f | 06-Feb-2019 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
efi_loader: error handling in efi_setup_loaded_image()
In case of an error we should set the returned pointers to NULL. This ensures that an illegal free does not occur even if the caller calls free
efi_loader: error handling in efi_setup_loaded_image()
In case of an error we should set the returned pointers to NULL. This ensures that an illegal free does not occur even if the caller calls free() for the handles.
If protocols cannot be installed, release all resources.
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
show more ...
|
95288b1e | 04-Feb-2019 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
efi_loader: comments for efi_file_from_path()
Add more comments for efi_file_from_path().
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de> |
caf6d2fd | 04-Feb-2019 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
efi_loader: efi_dp_split_file_path() error handling
If the path passed to efi_dp_split_file_path() does not contain a reference to a file it returns EFI_OUT_OF_RESOURCES. This does not properly indi
efi_loader: efi_dp_split_file_path() error handling
If the path passed to efi_dp_split_file_path() does not contain a reference to a file it returns EFI_OUT_OF_RESOURCES. This does not properly indicate the kind of the problem that occurred. Return EFI_INVALID_PARAMETER instead.
Update function description.
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
show more ...
|
823c233b | 09-Feb-2019 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
efi_loader: fix EFI_FILE_PROTOCOL.GetInfo()
We check the existence of files with fs_exist(). This function calls fs_close(). If we do not set the active block device again fs_opendir() fails and we
efi_loader: fix EFI_FILE_PROTOCOL.GetInfo()
We check the existence of files with fs_exist(). This function calls fs_close(). If we do not set the active block device again fs_opendir() fails and we do not set the flag EFI_FILE_DIRECTORY. Due to this error the `cd` command in the EFI shell fails.
So let's add the missing set_blk_dev(fh) call.
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Signed-off-by: Alexander Graf <agraf@suse.de>
show more ...
|
5fbb2895 | 11-Feb-2019 |
Alexander Graf <agraf@suse.de> |
efi_loader: Make HII a config option
Heinrich ran into issues with HII and iPXE which lead to #SErrors on his Odroid-C2 system. We definitely do not want to regress just yet, so let's not expose the
efi_loader: Make HII a config option
Heinrich ran into issues with HII and iPXE which lead to #SErrors on his Odroid-C2 system. We definitely do not want to regress just yet, so let's not expose the HII protocols by default.
Instead, let's make it a config option that people can play with This way, we can stabilize the code in tree without breaking any users.
Once someone figures out, why this breaks iPXE (probably a NULL dereference), we can enable it by default.
Reported-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Signed-off-by: Alexander Graf <agraf@suse.de>
---
v1 -> v2:
- Remove HII selftest as well
v2 -> v3:
- Make config option
show more ...
|
6f8f4217 | 23-Jan-2019 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
efi_loader: debug output for HII protocols
For correct indention use EFI_PRINT() instead of debug().
For printing efi_uintn_t or size_t use the %zu or %zx format code.
Signed-off-by: Heinrich Schu
efi_loader: debug output for HII protocols
For correct indention use EFI_PRINT() instead of debug().
For printing efi_uintn_t or size_t use the %zu or %zx format code.
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Signed-off-by: Alexander Graf <agraf@suse.de>
show more ...
|