Skip to content
Snippets Groups Projects
  1. Jan 20, 2019
  2. Jan 19, 2019
  3. Jan 14, 2019
    • Colin Watson's avatar
      pgp: Fix emu build and tests after pgp module renaming · ed087f04
      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: default avatarColin Watson <cjwatson@ubuntu.com>
      Reviewed-by: default avatarDaniel Kiper <daniel.kiper@oracle.com>
      ed087f04
    • Peter Große's avatar
      grub-mkconfig/20_linux_xen: Support multiple early initrd images · e86f6aaf
      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: default avatarPeter Große <pegro@friiks.de>
      Reviewed-by: default avatarDaniel Kiper <daniel.kiper@oracle.com>
      e86f6aaf
    • Heinrich Schuchardt's avatar
      grub-core/loader/efi/fdt.c: Do not copy random memory · ad0ea7c4
      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: default avatarHeinrich Schuchardt <xypron.glpk@gmx.de>
      Reviewed-by: default avatarLeif Lindholm <leif.lindholm@linaro.org>
      Reviewed-by: default avatarDaniel Kiper <daniel.kiper@oracle.com>
      ad0ea7c4
  4. Dec 12, 2018
  5. Dec 07, 2018
  6. Nov 28, 2018
    • Eric Snowberg's avatar
      ofnet: Fix build regression in grub_ieee1275_parse_bootpath() · 29157553
      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: default avatarEric Snowberg <eric.snowberg@oracle.com>
      Reviewed-by: default avatarDaniel Kiper <daniel.kiper@oracle.com>
      29157553
  7. Nov 26, 2018
    • Nick Terrell's avatar
      btrfs: Add zstd support to grub btrfs · 38612864
      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: default avatarNick Terrell <terrelln@fb.com>
      Reviewed-by: default avatarDaniel Kiper <daniel.kiper@oracle.com>
      38612864
    • Nick Terrell's avatar
      zstd: Import upstream zstd-1.3.6 · 461f1d8a
      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: default avatarNick Terrell <terrelln@fb.com>
      Reviewed-by: default avatarDaniel Kiper <daniel.kiper@oracle.com>
      461f1d8a
  8. Nov 21, 2018
    • Michael Chang's avatar
      verifiers: fix double close on pgp's sig file descriptor · e8b37e2c
      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: default avatarMichael Chang <mchang@suse.com>
      Reviewed-by: default avatarDaniel Kiper <daniel.kiper@oracle.com>
      e8b37e2c
    • Lee Jones's avatar
      generic/blocklist: Fix implicit declaration of function grub_file_filter_disable_compression() · 5c6f9bc1
      Lee Jones authored
      
      grub_file_filter_disable_compression() no longer exists.
      
      Signed-off-by: default avatarLee Jones <lee.jones@linaro.org>
      Reviewed-by: default avatarDaniel Kiper <daniel.kiper@oracle.com>
      5c6f9bc1
    • Lee Jones's avatar
      arm64/xen: Fix too few arguments to function grub_create_loader_cmdline() · 25e35377
      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: default avatarLee Jones <lee.jones@linaro.org>
      Reviewed-by: default avatarJulien Grall <julien.grall@arm.com>
      Reviewed-by: default avatarDaniel Kiper <daniel.kiper@oracle.com>
      25e35377
  9. Nov 16, 2018
Loading