• Arvind Sankar's avatar
    efi/x86: Only copy upto the end of setup_header · 59476f80
    Arvind Sankar authored
    When copying the setup_header into the boot_params buffer, only the data
    that is actually part of the setup_header should be copied.
    
    efi_pe_entry() currently copies the entire second sector, which
    initializes some of the fields in boot_params beyond the setup_header
    with garbage (i.e. part of the real-mode boot code gets copied into
    those fields).
    
    This does not cause any issues currently because the fields that are
    overwritten are padding, BIOS EDD information that won't get used, and
    the E820 table which will get properly filled in later.
    
    Fix this to only copy data that is actually part of the setup_header
    structure.
    Signed-off-by: default avatarArvind Sankar <nivedita@alum.mit.edu>
    Signed-off-by: default avatarArd Biesheuvel <ardb@kernel.org>
    59476f80
x86-stub.c 21.1 KB