06 May, 2020

7 commits

  • Previous patch "MLK-21885 lmb: Handle the overlap case for lmb reserve" adds
    the overlap support to lmb reserve. However, u-boot has some places to use the
    lmb_reserve when allocating memory in loading images. If we allowed overlap
    in this function, it means images loading address can overlap each other and
    cause the address check mechanism not work.

    So add another function to allow overlap and only use it for fdt reserved-memory
    nodes. The FDT reserved-memory is ok to merge with other reserved memory, since
    this won't break image loading address check.

    Signed-off-by: Ye Li
    (cherry picked from commit 2109dc2a4da592003ec62820f5bdfb6bd0899805)

    Ye Li
     
  • lmb reserve is used to reserve some memory so that when loading images
    (like kernel, dtb, initrd), images won't be loaded into the reserved memory.

    The problem in current lmb is it does not handle the overlap case. When adding
    a new reserved memory, if the memory region is overlap with regions already been
    added in lmb, it will fail. One example is reserved memory in DTB may overlap with
    u-boot relocate address. lmb reserves the u-boot relocate address firstly, so when
    adding reserved memory from DTB, we will meet failure.

    Actually if we handle the overlap case, we can resolve the overlap by using a max
    common region for the overlap regions. So that this case won't fail.

    Signed-off-by: Ye Li
    Reviewed-by: Peng Fan
    (cherry picked from commit 37d86c68816dffde3dc8dcda5b9d67a195b2f9c2)

    Ye Li
     
  • Fix coverity issue CID 18031: Resource leak (RESOURCE_LEAK)
    leaked_storage: Variable fill_buf going out of scope leaks the storage it points to

    Should free the fill_buf before function return.

    Signed-off-by: Ye Li
    (cherry picked from commit bc23ae569c7aaea338648c000b7b733b09eb735a)
    (cherry picked from commit 0a496da0851e981b0ab19338145fcb622762af94)

    Ye Li
     
  • chunk_data_sz = sparse_header->blk_sz * chunk_header->chunk_sz;
    All is uint32. chunk_data_sz may be bigger than 4G.

    Change chunk_data_sz to 64bit.
    force chunk_header->chunk_sz and sparse_header->blk_sz to 64bit.

    Signed-off-by: Frank Li
    Acked-by: Ye Li
    (cherry picked from commit 08090670625c4ccf86dbc9157dad4799f3669fb7)
    (cherry picked from commit af09befee9c55525a6bc9844904048c324db7261)

    Frank Li
     
  • The lib provided ql-tipc communication channel with
    Trusty OS.
    Also the AVB, Keymaster, hwcrypto and SecureStorage service
    tipc client implement in this lib.

    Change-Id: I0ab1ec9ee1b6f272b960c2e944008283c2c9249a
    Signed-off-by: Haoran.Wang
    (cherry picked from commit 8fb370dd80fbb293b58115d2e7fc4970813773c7)
    (cherry picked from commit 0ccdd527a794c2b450658980361a7857ce7495c9)
    (cherry picked from commit ffca28682c5a9375c29b3036a156aff190341960)

    Haoran.Wang
     
  • Porting the FSL android fastboot features from imx u-boot v2018.03 to
    support all SoCs: imx6/imx7/imx7ulp/imx8/imx8m.

    The UUU commands like UCmd and ACmd are also added. Users need set
    CONFIG_FASTBOOT_UUU_SUPPORT=y to enable the feature.

    Signed-off-by: Frank Li
    Signed-off-by: Ye Li
    (cherry picked from commit 65120b06a7f750b9b1a6e0db3d2082cc7088d5a8)
    (cherry picked from commit 9b149c2a28829fe7017f83981d634157bc31cc94)

    Ye Li
     
  • Porting the android AVB lib from imx u-boot v2018.03. Since 2019 u-boot
    has added latest AVB library, try to reuse it.

    Signed-off-by: Ye Li
    (cherry picked from commit 2105662ada738a271e12a81d775134a5821dc38f)
    (cherry picked from commit f7291d86c4183ce2e299ad271aa5618c71507ffc)
    (cherry picked from commit b871714c519e1bda3de6afbd354bee2cb246e4b7)

    Ye Li
     

01 Apr, 2020

1 commit


23 Mar, 2020

1 commit


22 Mar, 2020

8 commits


17 Mar, 2020

1 commit


11 Mar, 2020

2 commits

  • The assigned value NULL is never used.

    Signed-off-by: Heinrich Schuchardt

    Heinrich Schuchardt
     
  • Currently, if GetMemoryMap API returns EFI_BUFFER_TOO_SMALL, it doesn't
    set valid values to other parameters, descriptor_size and
    descriptor_version, except memory_map_size.
    Some efi applications, however, may use those value; in particular,
    xen uses descriptor_size to calculate a size of buffer to be allocated.

    While UEFI specification is ambiguous in this point, it would be better
    to address this issue proactively to maximize the compatibility with
    existing efi applications.

    With this patch, for example, xen.efi (and hence linux kernel) can be
    started via bootefi without modification.

    Signed-off-by: AKASHI Takahiro
    Reviewed-by: Heinrich Schuchardt

    AKASHI Takahiro
     

29 Feb, 2020

2 commits

  • Provide a unit test loading an initial ramdisk using the
    EFI_LOAD_FILE2_PROTOCOL. The test is only executed on request.

    An example usage - given a file image with a file system in partition 1
    holding file initrd - is:

    * Configure the sandbox with

    CONFIG_EFI_SELFTEST=y
    CONFIG_EFI_LOAD_FILE2_INITRD=y
    CONFIG_EFI_INITRD_FILESPEC="host 0:1 initrd"

    * Run ./u-boot and execute

    host bind 0 image
    setenv efi_selftest load initrd
    bootefi selftest

    This would provide a test output like:

    Testing EFI API implementation

    Selected test: 'load initrd'

    Setting up 'load initrd'
    Setting up 'load initrd' succeeded

    Executing 'load initrd'
    Loaded 12378613 bytes
    CRC32 2997478465
    Executing 'load initrd' succeeded

    Now the size and CRC32 can be compared to the provided file.

    Signed-off-by: Ilias Apalodimas
    Signed-off-by: Heinrich Schuchardt

    Ilias Apalodimas
     
  • Following kernel's proposal for an arch-agnostic initrd loading
    mechanism [1] let's implement the U-boot counterpart.
    This new approach has a number of advantages compared to what we did up
    to now. The file is loaded into memory only when requested limiting the
    area of TOCTOU attacks. Users will be allowed to place the initramfs
    file on any u-boot accessible partition instead of just the ESP one.
    Finally this is an attempt of a generic interface across architectures
    in the linux kernel so it makes sense to support that.

    The file location is intentionally only supported as a config option
    argument(CONFIG_EFI_INITRD_FILESPEC), in an effort to enhance security.
    Although U-boot is not responsible for verifying the integrity of the
    initramfs, we can enhance the offered security by only accepting a
    built-in option, which will be naturally verified by UEFI Secure Boot.
    This can easily change in the future if needed and configure that via ENV
    or UEFI variable.

    [1] https://lore.kernel.org/linux-efi/20200207202637.GA3464906@rani.riverdale.lan/T/#m4a25eb33112fab7a22faa0fd65d4d663209af32f

    Signed-off-by: Ilias Apalodimas
    Signed-off-by: Heinrich Schuchardt

    Ilias Apalodimas
     

27 Feb, 2020

1 commit


19 Feb, 2020

1 commit


06 Feb, 2020

4 commits


31 Jan, 2020

2 commits

  • In upstream libfdt, 6dcb8ba4 "libfdt: Add helpers for accessing
    unaligned words" introduced changes to support unaligned reads for ARM
    platforms and 11738cf01f15 "libfdt: Don't use memcpy to handle unaligned
    reads on ARM" improved the performance of these helpers.

    In practice however, this only occurs when the user has forced the
    device tree to be placed in memory in a non-aligned way, which in turn
    violates both our rules and the Linux Kernel rules for how things must
    reside in memory to function.

    This "in practice" part is important as handling these other cases adds
    visible (1 second or more) delay to boot in what would be considered the
    fast path of the code.

    Cc: Patrice CHOTARD
    Cc: Patrick DELAUNAY
    Link: https://www.spinics.net/lists/devicetree-compiler/msg02972.html
    Signed-off-by: Tom Rini
    Tested-by: Patrice Chotard

    Tom Rini
     
  • As hinted by GCC 9, there is a return statement that returns
    an uninitialized variable in optee_copy_firmware_node().
    This patch addresses this.

    Signed-off-by: Christoph Müllner
    Reviewed-by: Heiko Stuebner

    Christoph Müllner
     

26 Jan, 2020

2 commits

  • drivers/rng/sandbox_rng.c requires rand() to be defined but configuration
    option CONFIG_CONFIG_LIB_RAND selected in drivers/rng/Kconfig does not
    exist.

    test/lib/test_aes.c requires rand() to be defined.

    Fix the selection criteria for choice "Pseudo-random library support type".

    Signed-off-by: Heinrich Schuchardt

    Heinrich Schuchardt
     
  • CONFIG_SPL_RSA is meant to control if lib/rsa/* is used for SPL. Adjust
    lib/Makefile to consider this setting.

    This was correctly setup with commit 51c14cd128f4 ("verified-boot: Minimal
    support for booting U-Boot proper from SPL") and got lost with commit
    089df18bfe9d ("lib: move hash CONFIG options to Kconfig").

    Fixes: 089df18bfe9d ("lib: move hash CONFIG options to Kconfig")
    Signed-off-by: Heinrich Schuchardt

    Heinrich Schuchardt
     

23 Jan, 2020

2 commits


18 Jan, 2020

5 commits


17 Jan, 2020

1 commit