1. 22 Mar, 2016 1 commit
  2. 14 Mar, 2016 5 commits
  3. 25 Jan, 2016 1 commit
  4. 19 Jan, 2016 1 commit
  5. 14 Jan, 2016 2 commits
  6. 08 Jan, 2016 1 commit
  7. 23 Nov, 2015 1 commit
    • Thomas Fitzsimmons's avatar
      fs: ext4: Prevent infinite loop in ext4fs_iterate_dir · 54d68e93
      Thomas Fitzsimmons authored
      If the ext3 journal gets out of sync with what is written on disk, for
      example because of an unexpected power cut, ext4fs_read_file can
      return an all-zero directory entry.  In that case, ext4fs_iterate_dir
      would infinite loop.
      This patch detects when a directory entry's direntlen member is 0 and
      returns a failure status, which breaks out of the infinite loop.  As a
      result, U-Boot will not find files that may subsequently be recovered
      when the journal is replayed.
      This is better behaviour than hanging in an infinite loop, but as a
      further improvement maybe U-Boot could interpret the ext3 journal and
      actually find the unsynced entries.
      Signed-off-by: default avatarThomas Fitzsimmons <fitzsim@cisco.com>
      Reviewed-by: default avatarStefan Roese <sr@denx.de>
  8. 10 Nov, 2015 1 commit
    • Tom Rini's avatar
      Various Makefiles: Add SPDX-License-Identifier tags · da58dec8
      Tom Rini authored
      After consulting with some of the SPDX team, the conclusion is that
      Makefiles are worth adding SPDX-License-Identifier tags too, and most of
      ours have one.  This adds tags to ones that lack them and converts a few
      that had full (or in one case, very partial) license blobs into the
      equivalent tag.
      Cc: Kate Stewart <kstewart@linuxfoundation.org>
      Signed-off-by: default avatarTom Rini <trini@konsulko.com>
  9. 05 Nov, 2015 1 commit
  10. 26 Oct, 2015 1 commit
  11. 24 Oct, 2015 3 commits
  12. 11 Oct, 2015 5 commits
  13. 11 Sep, 2015 8 commits
    • Gary Bisson's avatar
      fs: ext4: fix symlink read function · 9d2f6a9a
      Gary Bisson authored
      Since last API changes for files >2GB, the read of symlink is broken as
      ext4fs_read_file now returns 0 instead of the length of the actual read.
      Signed-off-by: default avatarGary Bisson <gary.bisson@boundarydevices.com>
    • Stephen Warren's avatar
      ext4: fix leak in check_filename() · d56b2015
      Stephen Warren authored
      root_first_block_buffer should be free()d in all cases, not just when an
      error occurs. Fix the success exit path of the function to do this.
      Signed-off-by: default avatarStephen Warren <swarren@nvidia.com>
      Acked-by: default avatarLukasz Majewski <l.majewski@samsung.com>
      Tested-by: default avatarLukasz Majewski <l.majewski@samsung.com>
    • Stephen Warren's avatar
      ext4: free allocations by parse_path() · 934b14f2
      Stephen Warren authored
      parse_path() malloc()s the entries in the array it's passed. Those
      allocations must be free()d by the caller, ext4fs_get_parent_inode_num().
      Add code to do this.
      For this to work, all the array entries must be dynamically allocated,
      rather than a mix of dynamic and static allocations. Fix parse_path() not
      to over-write arr[0] with a pointer to statically allocated data.
      Signed-off-by: default avatarStephen Warren <swarren@nvidia.com>
      Acked-by: default avatarLukasz Majewski <l.majewski@samsung.com>
      Tested-by: default avatarLukasz Majewski <l.majewski@samsung.com>
    • Stephen Warren's avatar
      ext4: avoid calling ext4fs_mount() twice, which leaks · 676505f5
      Stephen Warren authored
      ext4_write_file() is only called from the "fs" layer, which calls both
      ext4fs_mount() and ext4fs_close() before/after calling ext4_write_file().
      Fix ext4_write_file() not to call ext4fs_mount() again, since the mount
      operation malloc()s some RAM which is leaked when a second mount call
      over-writes the pointer to that data, if no intervening close call is
      Signed-off-by: default avatarStephen Warren <swarren@nvidia.com>
      Acked-by: default avatarLukasz Majewski <l.majewski@samsung.com>
      Tested-by: default avatarLukasz Majewski <l.majewski@samsung.com>
    • Łukasz Majewski's avatar
      FIX: fat: Provide correct return code from disk_{read|write} to upper layers · 0a04ed86
      Łukasz Majewski authored
      It is very common that FAT code is using following pattern:
      if (disk_{read|write}() < 0)
              return -1;
      Up till now the above code was dead, since disk_{read|write) could only
      return value >= 0.
      As a result some errors from medium layer (i.e. eMMC/SD) were not caught.
      The above behavior was caused by block_{read|write|erase} declared at
      struct block_dev_desc (@part.h). It returns unsigned long, where 0
      indicates error and > 0 indicates that medium operation was correct.
      This patch as error regards 0 returned from block_{read|write|erase}
      when nr_blocks is grater than zero. Read/Write operation with nr_blocks=0
      should return 0 and hence is not considered as an error.
      Signed-off-by: default avatarLukasz Majewski <l.majewski@samsung.com>
      Test HW: Odroid XU3 - Exynos 5433
    • Simon Glass's avatar
      Move ALLOC_CACHE_ALIGN_BUFFER() to the new memalign.h header · cf92e05c
      Simon Glass authored
      Now that we have a new header file for cache-aligned allocation, we should
      move the stack-based allocation macro there also.
      Signed-off-by: default avatarSimon Glass <sjg@chromium.org>
    • Simon Glass's avatar
      Move malloc_cache_aligned() to its own header · 6e295186
      Simon Glass authored
      At present malloc.h is included everywhere since it recently was added to
      common.h in this commit:
         4519668b mtd/nand/ubi: assortment of alignment fixes
      This seems wasteful and unnecessary. We have been trying to trim down
      common.h and put separate functions into separate header files and that
      change goes in the opposite direction.
      Move malloc_cache_aligned() to a new header so that this can be avoided.
      The header would perhaps be better named as alignmem.h but it needs to be
      included after common.h and people might be confused by this. With the name
      memalign.h it fits nicely after malloc() in most cases.
      Signed-off-by: default avatarSimon Glass <sjg@chromium.org>
      Acked-by: default avatarMarcel Ziswiler <marcel.ziswiler@toradex.com>
    • Stephen Warren's avatar
      fat: handle paths that include ../ · 18a10d46
      Stephen Warren authored
      The FAT code contains a special case to parse the root directory. This
      is needed since the root directory location/layout on disk is special
      cased for FAT12/16. In particular, the location and size of the FAT12/16
      root directory is hard-coded and contiguous, whereas all FAT12/16 non-root
      directories, and all FAT32 directories, are stored in a non-contiguous
      fashion, with the layout represented by a linked-list of clusters in the
      If a file path contains ../ (for example /extlinux/../bcm2835-rpi-cm.dtb),
      it is possible to need to parse the root directory for the first element
      in the path (requiring application of the special case), then a sub-
      directory (in the general way), then re-parse the root directory (again
      requiring the special case). However, the current code in U-Boot only
      applies the special case for the very first path element, and never for
      any later path element. When reparsing the root directory without
      applying the special case, any file in a sector (or cluster?) other than
      the first sector/cluster of the root directory will not be found.
      This change modifies the non-root-dir-parsing loop of do_fat_read_at()
      to detect if it's walked back to the root directory, and if so, jumps
      back to the special case code that handles parsing of the root directory.
      This change was tested using sandbox by executing:
      ./u-boot -c "host bind 0 ../sd-p1.bin; ls host 0:0"
      ./u-boot -c "host bind 0 ../sd-p1.bin; ls host 0:0 /"
      ./u-boot -c "host bind 0 ../sd-p1.bin; ls host 0:0 /extlinux"
      ./u-boot -c "host bind 0 ../sd-p1.bin; ls host 0:0 /extlinux/"
      ./u-boot -c "host bind 0 ../sd-p1.bin; ls host 0:0 /extlinux/.."
      ./u-boot -c "host bind 0 ../sd-p1.bin; ls host 0:0 /extlinux/../"
      ./u-boot -c "host bind 0 ../sd-p1.bin; ls host 0:0 /extlinux/../backup"
      ./u-boot -c "host bind 0 ../sd-p1.bin; ls host 0:0 /extlinux/../backup/"
      ./u-boot -c "host bind 0 ../sd-p1.bin; ls host 0:0 /extlinux/../backup/.."
      ./u-boot -c "host bind 0 ../sd-p1.bin; ls host 0:0 /extlinux/../backup/../"
      ./u-boot -c "host bind 0 ../sd-p1.bin; load host 0:0 0 /bcm2835-rpi-cm.dtb"
      ./u-boot -c "host bind 0 ../sd-p1.bin; load host 0:0 0 /extlinux/../bcm2835-rpi-cm.dtb"
      ./u-boot -c "host bind 0 ../sd-p1.bin; load host 0:0 0 /backup/../bcm2835-rpi-cm.dtb"
      ./u-boot -c "host bind 0 ../sd-p1.bin; load host 0:0 0 /extlinux/..backup/../bcm2835-rpi-cm.dtb"
      ./u-boot -c "host bind 0 ../sd-p1.bin; load host 0:0 0 /extlinux/../backup/../bcm2835-rpi-cm.dtb"
      (/extlinux and /backup are in different sectors so trigger some different
      cases, and bcm2835-rpi-cm.dtb is in a sector of the root directory other
      than the first).
      In all honesty, this change is a bit of a hack, using goto and all.
      However, as demonstrated above it appears to work well in practice, is
      quite minimal, likely doesn't introduce any risk of regressions, and
      hopefully doesn't introduce any maintenance issues.
      The correct fix would be to collapse the root and non-root loops in
      do_fat_read_at() and get_dentfromdir() into a single loop that has a
      small special-case when moving from one sector to the next, to handle
      the layout difference of root/non-root directories. AFAIK all other
      aspects of directory parsing are identical. However, that's a much
      larger change which needs significantly more thought before it's
      Signed-off-by: default avatarStephen Warren <swarren@wwwdotorg.org>
  14. 28 Aug, 2015 1 commit
  15. 13 Aug, 2015 8 commits