[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[xen master] EFI/Arm64: don't clobber DTB pointer



commit 884ef07f4f66b9d12fc4811047db95ba649db85c
Author:     Jan Beulich <jbeulich@xxxxxxxx>
AuthorDate: Wed Oct 14 14:13:16 2020 +0200
Commit:     Jan Beulich <jbeulich@xxxxxxxx>
CommitDate: Wed Oct 14 14:13:16 2020 +0200

    EFI/Arm64: don't clobber DTB pointer
    
    read_section() needs to be more careful: efi_arch_use_config_file()
    may have found a DTB file (but without modules), and there may be no DTB
    specified in the EFI config file. In this case the pointer to the blob
    must not be overwritten with NULL when no ".dtb" section is present
    either.
    
    Fixes: 8a71d50ed40b ("efi: Enable booting unified hypervisor/kernel/initrd 
images")
    Signed-off-by: Jan Beulich <jbeulich@xxxxxxxx>
    Acked-by: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
---
 xen/common/efi/boot.c | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/xen/common/efi/boot.c b/xen/common/efi/boot.c
index bacd551bb5..eb1ef91ba4 100644
--- a/xen/common/efi/boot.c
+++ b/xen/common/efi/boot.c
@@ -637,11 +637,14 @@ static bool __init read_section(const EFI_LOADED_IMAGE 
*image,
                                 const CHAR16 *name, struct file *file,
                                 const char *options)
 {
-    file->ptr = pe_find_section(image->ImageBase, image->ImageSize,
-                                name, &file->size);
-    if ( !file->ptr )
+    const void *ptr = pe_find_section(image->ImageBase, image->ImageSize,
+                                      name, &file->size);
+
+    if ( !ptr )
         return false;
 
+    file->ptr = ptr;
+
     handle_file_info(name, file, options);
 
     return true;
--
generated by git-patchbot for /home/xen/git/xen.git#master



 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.