18 Jun, 2019

1 commit

  • 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

    Ye Li
     

02 Feb, 2019

1 commit

  • This fixes the automatic lmb initialization and reservation for boards
    with more than one DRAM bank.

    This fixes the CVE-2018-18439 and -18440 fixes that only allowed to load
    files into the firs DRAM bank from fs and via tftp.

    Found-by: Heinrich Schuchardt
    Signed-off-by: Simon Goldschmidt
    Tested-by: Heinrich Schuchardt
    Reviewed-by: Simon Glass

    Simon Goldschmidt
     

26 Jan, 2019

1 commit


17 Jan, 2019

3 commits

  • lmb.h includes an extern declaration of "struct lmb lmb;" which
    is not used anywhere, so remove it.

    Reviewed-by: Simon Glass
    Signed-off-by: Simon Goldschmidt

    Simon Goldschmidt
     
  • This fixes CVE-2018-18440 ("insufficient boundary checks in filesystem
    image load") by using lmb to check the load size of a file against
    reserved memory addresses.

    Signed-off-by: Simon Goldschmidt
    Reviewed-by: Simon Glass

    Simon Goldschmidt
     
  • This adds two new functions, lmb_alloc_addr and
    lmb_get_unreserved_size.

    lmb_alloc_addr behaves like lmb_alloc, but it tries to allocate a
    pre-specified address range. Unlike lmb_reserve, this address range
    must be inside one of the memory ranges that has been set up with
    lmb_add.

    lmb_get_unreserved_size returns the number of bytes that can be
    used up to the next reserved region or the end of valid ram. This
    can be 0 if the address passed is reserved.

    Added test for these new functions.

    Reviewed-by: Simon Glass
    Signed-off-by: Simon Goldschmidt

    Simon Goldschmidt
     

07 May, 2018

1 commit

  • When U-Boot started using SPDX tags we were among the early adopters and
    there weren't a lot of other examples to borrow from. So we picked the
    area of the file that usually had a full license text and replaced it
    with an appropriate SPDX-License-Identifier: entry. Since then, the
    Linux Kernel has adopted SPDX tags and they place it as the very first
    line in a file (except where shebangs are used, then it's second line)
    and with slightly different comment styles than us.

    In part due to community overlap, in part due to better tag visibility
    and in part for other minor reasons, switch over to that style.

    This commit changes all instances where we have a single declared
    license in the tag as both the before and after are identical in tag
    contents. There's also a few places where I found we did not have a tag
    and have introduced one.

    Signed-off-by: Tom Rini

    Tom Rini
     

24 Jul, 2013

1 commit


15 May, 2013

1 commit

  • This seems to be a common function for several architectures, so create
    a common function rather than duplicating the code in each arch.

    Also make an attempt to avoid introducing #ifdefs in the new code, partly
    by removing useless #ifdefs around function declarations in the image.h
    header.

    Signed-off-by: Simon Glass

    Simon Glass
     

20 Jun, 2012

1 commit


22 Jan, 2010

1 commit


10 Jul, 2008

1 commit

  • The LMB code now uses phys_addr_t and phys_size_t. Also, there were a couple
    of casting problems in the bootm code that called the LMB functions.

    Signed-off-by: Andy Fleming

    Andy Fleming
     

04 Jul, 2008

1 commit


12 Jun, 2008

1 commit

  • This updates the lmb code to use phys_size_t
    and phys_addr_t instead of unsigned long. Other code
    which interacts with this code, like getenv_bootm_size()
    is also updated.

    Booted on MPC8641HPCN, build-tested ppc, arm, mips.

    Signed-off-by: Becky Bruce

    Becky Bruce
     

29 Feb, 2008

1 commit