- Jan 20, 2019
-
-
Klaus Frank authored
-
Klaus Frank authored
-
Klaus Frank authored
-
- Jan 19, 2019
-
-
Klaus Frank authored
-
- Jan 14, 2019
-
-
Colin Watson authored
Commit b07feb87 (verifiers: Rename verify module to pgp module) renamed the "verify" module to "pgp", but the GRUB_MOD_INIT and GRUB_MOD_FINI macros were left as "verify", which broke the emu target build; and file_filter_test still referred to the now non-existent "verify" module. Fix both of these. Signed-off-by:
Colin Watson <cjwatson@ubuntu.com> Reviewed-by:
Daniel Kiper <daniel.kiper@oracle.com>
-
Peter Große authored
Add support for multiple, shared, early initrd images. These early images will be loaded in the order declared, and all will be loaded before the initrd image. While many classes of data can be provided by early images, the immediate use case would be for distributions to provide CPU microcode to mitigate the Meltdown and Spectre vulnerabilities. Xen has also support to load microcode updates provided as additional modules by the bootloader. There are two environment variables provided for declaring the early images. * GRUB_EARLY_INITRD_LINUX_STOCK is for the distribution declare images that are provided by the distribution or installed packages. If undeclared, this will default to a set of common microcode image names. * GRUB_EARLY_INITRD_LINUX_CUSTOM is for user created images. User images will be loaded after the stock images. These separate configurations allow the distribution and user to declare different image sets without clobbering each other. This also makes a minor update to ensure that UUID partition labels stay disabled when no initrd image is found, even if early images are present. This is basically a copy of a698240d "grub-mkconfig/10_linux: Support multiple early initrd images" by Matthew S. Turnbull. Signed-off-by:
Peter Große <pegro@friiks.de> Reviewed-by:
Daniel Kiper <daniel.kiper@oracle.com>
-
Heinrich Schuchardt authored
We should not try to copy any memory area which is outside of the original fdt. If this extra memory is controlled by a hypervisor this might end with a crash. Signed-off-by:
Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by:
Leif Lindholm <leif.lindholm@linaro.org> Reviewed-by:
Daniel Kiper <daniel.kiper@oracle.com>
-
- Dec 12, 2018
-
-
Matthew Garrett authored
Describe the behaviour of GRUB when the TPM module is in use. Signed-off-by:
Matthew Garrett <mjg59@google.com> Reviewed-by:
Daniel Kiper <daniel.kiper@oracle.com>
-
Matthew Garrett authored
Add support for performing basic TPM measurements. Right now this only supports extending PCRs statically and only on UEFI. In future we might want to have some sort of mechanism for choosing which events get logged to which PCRs, but this seems like a good default policy and we can wait to see whether anyone has a use case before adding more complexity. Signed-off-by:
Matthew Garrett <mjg59@google.com> Reviewed-by:
Daniel Kiper <daniel.kiper@oracle.com>
-
Matthew Garrett authored
Pass all commands executed by GRUB to the verifiers layer. Most verifiers will ignore this, but some (such as the TPM verifier) want to be able to measure and log each command executed in order to ensure that the boot state is as expected. Signed-off-by:
Matthew Garrett <mjg59@google.com> Reviewed-by:
Daniel Kiper <daniel.kiper@oracle.com>
-
Juergen Gross authored
Support platform i386/xen_pvh in configure. Signed-off-by:
Juergen Gross <jgross@suse.com> Reviewed-by:
Daniel Kiper <daniel.kiper@oracle.com> Tested-by:
Hans van Kranenburg <hans@knorrie.org>
-
Juergen Gross authored
Add xen_pvh support to grub-install. Signed-off-by:
Juergen Gross <jgross@suse.com> Reviewed-by:
Daniel Kiper <daniel.kiper@oracle.com> Tested-by:
Hans van Kranenburg <hans@knorrie.org>
-
Juergen Gross authored
Support mkimage for xen_pvh. Signed-off-by:
Juergen Gross <jgross@suse.com> Reviewed-by:
Daniel Kiper <daniel.kiper@oracle.com> Tested-by:
Hans van Kranenburg <hans@knorrie.org>
-
Juergen Gross authored
In order to avoid using plain integers for the ELF notes use the available Xen include instead. Signed-off-by:
Juergen Gross <jgross@suse.com> Reviewed-by:
Daniel Kiper <daniel.kiper@oracle.com> Tested-by:
Hans van Kranenburg <hans@knorrie.org>
-
Hans van Kranenburg authored
This solves the build failing with "Error: no symbol table and no .moddeps section" Also see: - 6371e9c1 - https://savannah.gnu.org/bugs/?49012 Signed-off-by:
Hans van Kranenburg <hans@knorrie.org> Reviewed-by:
Daniel Kiper <daniel.kiper@oracle.com> Tested-by:
Hans van Kranenburg <hans@knorrie.org>
-
Juergen Gross authored
Add the modifications to the build system needed to build a xen_pvh grub. Signed-off-by:
Juergen Gross <jgross@suse.com> Reviewed-by:
Daniel Kiper <daniel.kiper@oracle.com> Tested-by:
Hans van Kranenburg <hans@knorrie.org>
-
Juergen Gross authored
Add all usable memory regions to grub memory management and add the needed mmap iterate code, which will be used by grub core (e.g. grub-core/lib/relocator.c or grub-core/mmap/mmap.c). As we are running in 32-bit mode don't add memory above 4GB. Signed-off-by:
Juergen Gross <jgross@suse.com> Reviewed-by:
Daniel Kiper <daniel.kiper@oracle.com> Tested-by:
Hans van Kranenburg <hans@knorrie.org>
-
Juergen Gross authored
Initialize the needed Xen specific data. This is: - the Xen start of day page containing the console and Xenstore ring page PFN and event channel - the grant table - the shared info page Write back the possibly modified memory map to the hypervisor in case the guest is reading it from there again. Set the RSDP address for the guest from the start_info page passed as boot parameter. Signed-off-by:
Juergen Gross <jgross@suse.com> Reviewed-by:
Daniel Kiper <daniel.kiper@oracle.com> Reviewed-by:
Roger Pau Monné <roger.pau@citrix.com> Tested-by:
Hans van Kranenburg <hans@knorrie.org>
-
Juergen Gross authored
Retrieve the memory map from the hypervisor and normalize it to contain no overlapping entries and to be sorted by address. Signed-off-by:
Juergen Gross <jgross@suse.com> Reviewed-by:
Daniel Kiper <daniel.kiper@oracle.com> Tested-by:
Hans van Kranenburg <hans@knorrie.org>
-
Juergen Gross authored
Add the needed code to setup the hypercall page for calling into the Xen hypervisor. Import the XEN_HVM_DEBUGCONS_IOPORT define from Xen unstable into include/xen/arch-x86/xen.h Signed-off-by:
Juergen Gross <jgross@suse.com> Reviewed-by:
Roger Pau Monné <roger.pau@citrix.com> Reviewed-by:
Daniel Kiper <daniel.kiper@oracle.com> Tested-by:
Hans van Kranenburg <hans@knorrie.org>
-
Juergen Gross authored
Add the code for the Xen PVH mode boot entry. Signed-off-by:
Juergen Gross <jgross@suse.com> Reviewed-by:
Daniel Kiper <daniel.kiper@oracle.com> Tested-by:
Hans van Kranenburg <hans@knorrie.org>
-
Juergen Gross authored
Add the hooks to current code needed for Xen PVH. They will be filled with code later when the related functionality is being added. loader/i386/linux.c needs to include machine/kernel.h now as it needs to get GRUB_KERNEL_USE_RSDP_ADDR from there. This in turn requires to add an empty kernel.h header for some i386 platforms (efi, coreboot, ieee1275, xen) and for x86_64 efi. Signed-off-by:
Juergen Gross <jgross@suse.com> Reviewed-by:
Daniel Kiper <daniel.kiper@oracle.com> Tested-by:
Hans van Kranenburg <hans@knorrie.org>
-
Juergen Gross authored
include/grub/offsets.h needs some defines for Xen PVH mode. Add them. While at it line up the values in the surrounding lines to start at the same column. Signed-off-by:
Juergen Gross <jgross@suse.com> Reviewed-by:
Daniel Kiper <daniel.kiper@oracle.com> Tested-by:
Hans van Kranenburg <hans@knorrie.org>
-
Juergen Gross authored
grub_xen_ptr2mfn() returns the machine frame number for a given pointer value. For Xen-PVH guests this is just the PFN. Add the PVH specific variant. Signed-off-by:
Juergen Gross <jgross@suse.com> Reviewed-by:
Daniel Kiper <daniel.kiper@oracle.com> Tested-by:
Hans van Kranenburg <hans@knorrie.org>
-
Juergen Gross authored
Rearrange grub-core/kern/xen/init.c to prepare adding PVH mode support to it. This includes putting some code under #ifdef GRUB_MACHINE_XEN as it will not be used when running as PVH. Signed-off-by:
Juergen Gross <jgross@suse.com> Reviewed-by:
Daniel Kiper <daniel.kiper@oracle.com> Tested-by:
Hans van Kranenburg <hans@knorrie.org>
-
Juergen Gross authored
With Xen PVH mode adding a new machine type the machine related headers need to be present for the build to succeed. Most of the headers just need to include the related common i386 headers. Add those to the tree. Note that xen_pvh/int.h needs to include pc/int_types.h instead of pc/int.h in order to avoid the definition of grub_bios_interrupt(). xen_pvh/memory.h needs to include coreboot/memory.h (like some other <machine>/memory.h do as well) as this contains just the needed stubs. Signed-off-by:
Juergen Gross <jgross@suse.com> Reviewed-by:
Daniel Kiper <daniel.kiper@oracle.com> Tested-by:
Hans van Kranenburg <hans@knorrie.org>
-
Juergen Gross authored
Some common code needs to be special cased for Xen PVH mode. This hits mostly Xen PV mode specific areas. Split include/grub/i386/pc/int_types.h off from include/grub/i386/pc/int.h to support including this file later from xen_pvh code without the grub_bios_interrupt definition. Move definition of struct grub_e820_mmap_entry from grub-core/mmap/i386/pc/mmap.c to include/grub/i386/memory.h in order to make it usable from xen_pvh code. Signed-off-by:
Juergen Gross <jgross@suse.com> Reviewed-by:
Daniel Kiper <daniel.kiper@oracle.com> Tested-by:
Hans van Kranenburg <hans@knorrie.org>
-
Juergen Gross authored
Initialize the grant tab in a dedicated function. This will enable using it for PVH guests, too. Call the new function from grub_machine_init() as this will later be common between Xen PV and Xen PVH mode. Signed-off-by:
Juergen Gross <jgross@suse.com> Reviewed-by:
Daniel Kiper <daniel.kiper@oracle.com> Tested-by:
Hans van Kranenburg <hans@knorrie.org>
-
Juergen Gross authored
Xen PVH guests will have the RSDP at an arbitrary address. Support that by passing the RSDP address via the boot parameters to Linux. Signed-off-by:
Juergen Gross <jgross@suse.com> Reviewed-by:
Daniel Kiper <daniel.kiper@oracle.com> Tested-by:
Hans van Kranenburg <hans@knorrie.org>
-
Juergen Gross authored
In order to support grub2 in Xen PVH environment some additional Xen headers are needed as grub2 will be started in PVH mode requiring to use several HVM hypercalls and structures. Add the needed headers from Xen 4.10 being the first Xen version with full (not only experimental) PVH guest support. Signed-off-by:
Juergen Gross <jgross@suse.com> Reviewed-by:
Daniel Kiper <daniel.kiper@oracle.com> Tested-by:
Hans van Kranenburg <hans@knorrie.org>
-
- Dec 07, 2018
-
-
Daniel Kiper authored
ARM Xen fallout cleanup after commit ca0a4f68 (verifiers: File type for fine-grained signature-verification controlling). Signed-off-by:
Daniel Kiper <daniel.kiper@oracle.com> Reviewed-by:
Ross Philipson <ross.philipson@oracle.com>
-
Daniel Kiper authored
Xen fallout cleanup after commit ca0a4f68 (verifiers: File type for fine-grained signature-verification controlling). Signed-off-by:
Daniel Kiper <daniel.kiper@oracle.com> Reviewed-by:
Ross Philipson <ross.philipson@oracle.com>
-
- Nov 28, 2018
-
-
Eric Snowberg authored
The grub_ieee1275_parse_bootpath() function (commit a661a321, ofnet: Initialize structs in bootpath parser) introduces a build regression on SPARC: cc1: warnings being treated as errors net/drivers/ieee1275/ofnet.c: In function 'grub_ieee1275_parse_bootpath': net/drivers/ieee1275/ofnet.c:156: error: missing initializer net/drivers/ieee1275/ofnet.c:156: error: (near initialization for 'client_addr.type') net/drivers/ieee1275/ofnet.c:156: error: missing initializer net/drivers/ieee1275/ofnet.c:156: error: (near initialization for 'gateway_addr.type') net/drivers/ieee1275/ofnet.c:156: error: missing initializer net/drivers/ieee1275/ofnet.c:156: error: (near initialization for 'subnet_mask.type') net/drivers/ieee1275/ofnet.c:157: error: missing initializer net/drivers/ieee1275/ofnet.c:157: error: (near initialization for 'hw_addr.type') make[3]: *** [net/drivers/ieee1275/ofnet_module-ofnet.o] Error 1 Initialize the entire structure. More info can be found here: http://lists.gnu.org/archive/html/grub-devel/2018-03/msg00034.html Signed-off-by:
Eric Snowberg <eric.snowberg@oracle.com> Reviewed-by:
Daniel Kiper <daniel.kiper@oracle.com>
-
- Nov 26, 2018
-
-
Nick Terrell authored
- Adds zstd support to the btrfs module. - Adds a test case for btrfs zstd support. - Changes top_srcdir to srcdir in the btrfs module's lzo include following comments from Daniel Kiper about the zstd include. Tested on Ubuntu-18.04 with a btrfs /boot partition with and without zstd compression. A test case was also added to the test suite that fails before the patch, and passes after. Signed-off-by:
Nick Terrell <terrelln@fb.com> Reviewed-by:
Daniel Kiper <daniel.kiper@oracle.com>
-
Nick Terrell authored
- Import zstd-1.3.6 from upstream - Add zstd's module.c file - Add the zstd module to Makefile.core.def Import zstd-1.3.6 from upstream [1]. Only the files need for decompression are imported. I used the latest zstd release, which includes patches [2] to build cleanly in GRUB. I included the script used to import zstd-1.3.6 below at the bottom of the commit message. Upstream zstd commit hash: 4fa456d7f12f8b27bd3b2f5dfd4f46898cb31c24 Upstream zstd commit name: Merge pull request #1354 from facebook/dev Zstd requires some posix headers, which it gets from posix_wrap. This can be checked by inspecting the .Po files generated by automake, which contain the header dependencies. After building run the command `cat grub-core/lib/zstd/.deps-core/*.Po` to see the dependencies [3]. The only OS dependencies are: - stddef.h, which is already a dependency in posix_wrap, and used for size_t by lzo and xz. - stdarg.h, which comes from the grub/misc.h header, and we don't use in zstd. All the types like uint64_t are typedefed to grub_uint64_t under the hood. The only exception is size_t, which comes from stddef.h. This is already the case for lzo and xz. I don't think there are any cross-compilation concerns, because cross-compilers provide their own system headers (and it would already be broken). [1] https://github.com/facebook/zstd/releases/tag/v1.3.6 [2] https://github.com/facebook/zstd/pull/1344 [3] https://gist.github.com/terrelln/7a16b92f5a1b3aecf980f944b4a966c4 ``` curl -L -O https://github.com/facebook/zstd/releases/download/v1.3.6/zstd-1.3.6.tar.gz curl -L -O https://github.com/facebook/zstd/releases/download/v1.3.6/zstd-1.3.6.tar.gz.sha256 sha256sum --check zstd-1.3.6.tar.gz.sha256 tar xzf zstd-1.3.6.tar.gz SRC_LIB="zstd-1.3.6/lib" DST_LIB="grub-core/lib/zstd" rm -rf $DST_LIB mkdir -p $DST_LIB cp $SRC_LIB/zstd.h $DST_LIB/ cp $SRC_LIB/common/*.[hc] $DST_LIB/ cp $SRC_LIB/decompress/*.[hc] $DST_LIB/ rm $DST_LIB/{pool.[hc],threading.[hc]} rm -rf zstd-1.3.6* echo SUCCESS! ``` Signed-off-by:
Nick Terrell <terrelln@fb.com> Reviewed-by:
Daniel Kiper <daniel.kiper@oracle.com>
-
- Nov 21, 2018
-
-
Michael Chang authored
An error emerged as when I was testing the verifiers branch, so instead of putting it in pgp prefix, the verifiers is used to reflect what the patch is based on. While running verify_detached, grub aborts with error. verify_detached /@/.snapshots/1/snapshot/boot/grub/grub.cfg /@/.snapshots/1/snapshot/boot/grub/grub.cfg.sig alloc magic is broken at 0x7beea660: 0 Aborted. Press any key to exit. The error is caused by sig file descriptor been closed twice, first time in grub_verify_signature() to which it is passed as parameter. Second in grub_cmd_verify_signature() or in whichever opens the sig file descriptor. The second close is not consider as bug to me either, as in common rule of what opens a file has to close it to avoid file descriptor leakage. After all the design of grub_verify_signature() makes it difficult to keep a good trace on opened file descriptor from it's caller. Let's refine the application interface to accept file path rather than descriptor, in this way the caller doesn't have to care about closing the descriptor by delegating it to grub_verify_signature() with full tracing to opened file descriptor by itself. Also making it clear that sig descriptor is not referenced in error returning path of grub_verify_signature_init(), so it can be closed directly by it's caller. This also makes delegating it to grub_pubkey_close() infeasible to help in relieving file descriptor leakage as it has to depend on uncertainty of ctxt fields in error returning path. Signed-off-by:
Michael Chang <mchang@suse.com> Reviewed-by:
Daniel Kiper <daniel.kiper@oracle.com>
-
Lee Jones authored
grub_file_filter_disable_compression() no longer exists. Signed-off-by:
Lee Jones <lee.jones@linaro.org> Reviewed-by:
Daniel Kiper <daniel.kiper@oracle.com>
-
Lee Jones authored
Without this fix, building xen_boot.c omits: loader/arm64/xen_boot.c: In function ‘xen_boot_binary_load’: loader/arm64/xen_boot.c:370:7: error: too few arguments to function ‘grub_create_loader_cmdline’ grub_create_loader_cmdline (argc - 1, argv + 1, binary->cmdline, ^~~~~~~~~~~~~~~~~~~~~~~~~~ In file included from loader/arm64/xen_boot.c:36:0: ../include/grub/lib/cmdline.h:29:12: note: declared here grub_err_t grub_create_loader_cmdline (int argc, char *argv[], char *buf, Signed-off-by:
Lee Jones <lee.jones@linaro.org> Reviewed-by:
Julien Grall <julien.grall@arm.com> Reviewed-by:
Daniel Kiper <daniel.kiper@oracle.com>
-
- Nov 16, 2018
-
-
Leif Lindholm authored
The verifiers framework changed the grub_file_open() interface, breaking all non-x86 linux loaders. Add file types to the grub_file_open() calls to make them build again. Signed-off-by:
Leif Lindholm <leif.lindholm@linaro.org> Reviewed-by:
Daniel Kiper <daniel.kiper@oracle.com>
-
Leif Lindholm authored
- add variable "err" (used but not defined), - add GRUB_FILE_TYPE_LINUX_KERNEL to grub_file_open() call. Signed-off-by:
Leif Lindholm <leif.lindholm@linaro.org> Reviewed-by:
Daniel Kiper <daniel.kiper@oracle.com>
-