Skip to content
Snippets Groups Projects
  1. Aug 04, 2011
  2. Jul 28, 2011
  3. Jul 26, 2011
  4. May 10, 2011
  5. Apr 12, 2011
  6. Apr 02, 2011
    • Erik Hansen's avatar
      fat32 root directory handling · 3f270f42
      Erik Hansen authored
      
      Fat directory handling didn't check reaching the end of the root directory. It
      relied on a stop condition based on a directory entry with a name starting with
      a '\0' character. This check in itself is wrong ('\0' indicates free entry, not
      end_of_directory) but outside the scope of this fix. For FAT32, the end of the
      rootdir is reached when the end of the cluster chain is reached. The code didn't
      check this condition and started to read an incorrect cluster. This caused a
      subsequent read request of a sector outside the range of the usb stick in
      use. On its turn, the usb stick protested with a stall handshake.
      
      Both FAT32 and non-FAT32 (FAT16/FAT12) end or rootdir checks have been put in.
      
      Signed-off-by: default avatarErik Hansen <erik@makarta.com>
      3f270f42
  7. Jan 11, 2011
  8. Dec 09, 2010
  9. Dec 03, 2010
  10. Nov 28, 2010
  11. Nov 17, 2010
    • Sebastien Carlier's avatar
      Switch from archive libraries to partial linking · 6d8962e8
      Sebastien Carlier authored
      
      Before this commit, weak symbols were not overridden by non-weak symbols
      found in archive libraries when linking with recent versions of
      binutils.  As stated in the System V ABI, "the link editor does not
      extract archive members to resolve undefined weak symbols".
      
      This commit changes all Makefiles to use partial linking (ld -r) instead
      of creating library archives, which forces all symbols to participate in
      linking, allowing non-weak symbols to override weak symbols as intended.
      This approach is also used by Linux, from which the gmake function
      cmd_link_o_target (defined in config.mk and used in all Makefiles) is
      inspired.
      
      The name of each former library archive is preserved except for
      extensions which change from ".a" to ".o".  This commit updates
      references accordingly where needed, in particular in some linker
      scripts.
      
      This commit reveals board configurations that exclude some features but
      include source files that depend these disabled features in the build,
      resulting in undefined symbols.  Known such cases include:
      - disabling CMD_NET but not CMD_NFS;
      - enabling CONFIG_OF_LIBFDT but not CONFIG_QE.
      
      Signed-off-by: default avatarSebastien Carlier <sebastien.carlier@gmail.com>
      6d8962e8
  12. Oct 29, 2010
  13. Oct 20, 2010
    • Stefano Babic's avatar
      FAT: buffer overflow with FAT12/16 · 11c8dd36
      Stefano Babic authored
      
      Last commit 3831530d was intended
      "explicitly specify FAT12/16 root directory parsing buffer size, instead
      of relying on cluster size". Howver, the underlying function requires
      the size of the buffer in blocks, not in bytes, and instead of passing
      a double sector size a request for 1024 blocks is sent. This generates
      a buffer overflow with overwriting of other structure (in the case seen,
      USB structures were overwritten).
      
      Signed-off-by: default avatarStefano Babic <sbabic@denx.de>
      CC: Mikhail Zolotaryov <lebon@lebon.org.ua>
      11c8dd36
  14. Oct 12, 2010
    • Mikhail Zolotaryov's avatar
      VFAT: fix processing of scattered long file name entries · 3831530d
      Mikhail Zolotaryov authored
      
      The U-Boot code has the following bugs related to the processing of Long File
      Name (LFN) entries scattered across several clusters/sectors :
      
      1) get_vfatname() function is designed to gather scattered LFN entries by
      cluster chain processing - that doesn't work for FAT12/16 root directory.
      In other words, the function expects the following input data:
       1.1) FAT32 directory (which is cluster chain based);
              OR
       1.2) FAT12/16 non-root directory (which is also cluster chain based);
              OR
       1.3) FAT12/16 root directory (allocated as contiguous sectors area), but
       all necessary information MUST be within the input buffer of filesystem cluster
       size (thus cluster-chain jump is never initiated).
      
      In order to accomplish the last condition, root directory parsing code in
      do_fat_read() uses the following trick: read-out cluster-size block, process
      only first sector (512 bytes), then shift 512 forward, read-out cluster-size
      block and so on. This works great unless cluster size is equal to 512 bytes
      (in a case you have a small partition), or long file name entries are scattered
      across three sectors, see 4) for details.
      
      2) Despite of the fact that get_vfatname() supports FAT32 root directory
      browsing, do_fat_read() function doesn't send current cluster number correctly,
      so root directory look-up doesn't work correctly.
      
      3) get_vfatname() doesn't gather scattered entries correctly also is the case
      when all LFN entries are located at the end of the source cluster, but real
      directory entry (which must be returned) is at the only beginning of the
      next one. No error detected, the resulting directory entry returned contains
      a semi-random information (wrong size, wrong start cluster number and so on)
      i.e. the entry is not accessible.
      
      4) LFN (VFAT) allows up to 20 entries (slots) each containing 26 bytes (13
      UTF-16 code units) to represent a single long file name i.e. up to 520 bytes.
      U-Boot allocates 256 bytes buffer instead, i.e. 10 or more LFN slots record
      may cause buffer overflow / memory corruption.
      Also, it's worth to mention that 20+1 slots occupy 672 bytes space which may
      take more than one cluster of 512 bytes (medium-size FAT32 or small FAT16
      partition) - get_vfatname() function doesn't support such case as well.
      
      The patch attached fixes these problems in the following way:
      - keep using 256 bytes buffer for a long file name, but safely prevent a
      possible buffer overflow (skip LFN processing, if it contains 10 or more
      slots).
      
      - explicitly specify FAT12/16 root directory parsing buffer size, instead
      of relying on cluster size. The value used is a double sector size (to store
      current sector and the next one). This fixes the first problem and increases
      performance on big FAT12/16 partitions;
      
      - send current cluster number (FAT32) to get_vfatname() during root
      directory processing;
      
      - use LFN counter to seek the real directory entry in get_vfatname() - fixes the
      third problem;
      
      - skip deleted entries in the root directory (to prevent bogus buffer
      overflow detection and LFN counter steps).
      
      Note: it's not advised to split up the patch, because a separate part may
      operate incorrectly.
      
      Signed-off-by: default avatarMikhail Zolotaryov <lebon@lebon.org.ua>
      3831530d
  15. Aug 07, 2010
  16. Jul 24, 2010
    • Wolfgang Denk's avatar
      fs/fat: Big code cleanup. · 7385c28e
      Wolfgang Denk authored
      
      - reformat
      - throw out macros like FAT_DPRINT and FAT_DPRINT
      - remove dead code
      
      Signed-off-by: default avatarWolfgang Denk <wd@denx.de>
      7385c28e
    • Wolfgang Denk's avatar
      FAT32: fix broken root directory handling. · 2aa98c66
      Wolfgang Denk authored
      
      On FAT32, instead of fetching the cluster numbers from the FAT, the
      code assumed (incorrectly) that the clusters for the root directory
      were allocated contiguously. In the result, only the first cluster
      could be accessed. At the typical cluster size of 8 sectors this
      caused all accesses to files after the first 128 entries to fail -
      "fatls" would terminate after 128 files (usually displaying a bogus
      file name, occasionally even crashing the system), and "fatload"
      would fail to find any files that were not in the first directory
      cluster.
      
      Signed-off-by: default avatarWolfgang Denk <wd@denx.de>
      2aa98c66
    • Wolfgang Denk's avatar
      FAT32: fix support for superfloppy-format (PBR) · 66c2d73c
      Wolfgang Denk authored
      
      "Superfloppy" format (in U-Boot called PBR) did not work for FAT32 as
      the file system type string is at a different location. Add support
      for FAT32.
      
      Signed-off-by: default avatarWolfgang Denk <wd@denx.de>
      66c2d73c
  17. May 28, 2010
  18. Apr 28, 2010
  19. Mar 31, 2010
  20. Jan 15, 2010
    • Wolfgang Denk's avatar
      JFFS2: drop support for LZARI compression mode · f0983371
      Wolfgang Denk authored
      
      Support for LZARI compression mode was added based on a MTD CVS
      snapshot of March 13, 2005. However, fs/jffs2/compr_lzari.c contains
      contradictory licensing terms: the original copyright clause says "All
      rights reserved. Permission granted for non-commercial use.", but
      later reference to the file 'LICENCE' in the jffs2 directory was added
      which says GPL v2 or later.
      
      As no boards ever used LZARI compression, and this file is also not
      present in recent MTD code, we resolve this conflict by removing the
      conflicting file and references to it.
      
      Also copy the referenced but missing file 'LICENCE' from the current
      MTD source tree.
      
      Signed-off-by: default avatarWolfgang Denk <wd@denx.de>
      f0983371
  21. Dec 21, 2009
  22. Dec 08, 2009
  23. Dec 04, 2009
  24. Oct 03, 2009
  25. Sep 28, 2009
  26. Sep 23, 2009
  27. Sep 15, 2009
  28. Aug 21, 2009
    • Ilya Yanok's avatar
      jffs2: some fixes to summary support · 8cf19b9f
      Ilya Yanok authored
      
      This patch fixes some issues with JFFS2 summary support in U-Boot.
      1/ Summary support made compilation configurable (as summary support
      considered expiremental even in Linux).
      2/ Summary code can do unaligned 16-bit and 32-bit memory accesses.
      We need to get data byte by byte to exclude data aborts.
      3/ Make summary scan in two passes so we can safely fall back to full
      scan if we found unsupported entry in the summary.
      
      Signed-off-by: default avatarIlya Yanok <yanok@emcraft.com>
      8cf19b9f
  29. Aug 18, 2009
  30. Jul 28, 2009
  31. Jul 17, 2009
    • Scott Wood's avatar
      Remove legacy NAND and disk on chip code. · be33b046
      Scott Wood authored
      
      Legacy NAND had been scheduled for removal.  Any boards that use this
      were already not building in the previous release due to an #error.
      
      The disk on chip code in common/cmd_doc.c relies on legacy NAND,
      and it has also been removed.  There is newer disk on chip code
      in drivers/mtd/nand; someone with access to hardware and sufficient
      time and motivation can try to get that working, but for now disk
      on chip is not supported.
      
      Signed-off-by: default avatarScott Wood <scottwood@freescale.com>
      be33b046
  32. Jun 12, 2009
    • Tom Rix's avatar
      FAT replace compare_sign with strncmp. · 651351fe
      Tom Rix authored
      
      The static function compare_sign is only used to compare the fs_type string
      and does not do anything more than what strncmp does.
      
      The addition of the trailing '\0' to fs_type, while legal, is not needed
      because the it is never printed out and strncmp does not depend on NULL
      terminated strings.
      
      Signed-off-by: default avatarTom Rix <Tom.Rix@windriver.com>
      651351fe
  33. Jun 09, 2009
Loading