Skip to content
Snippets Groups Projects
  1. Apr 07, 2021
    • Wagner Popov dos Santos's avatar
      JFFS2: fix jffs2 summary datacrc status uninitialized · fc25ffe7
      Wagner Popov dos Santos authored and Tom Rini's avatar Tom Rini committed
      
      The function jffs2_1pass_read_inode() was discarding the summary
      inodes and dirent because the value in datacrc flag wasn't
      initialized in function jffs2_sum_process_sum_data().
      
      This fix initializes the status of all summary records to indicate
      that the CRC needs to be verified when they are loaded.
      
      Before this fix, the behaviors produced by the undefined value of
      datacrc was:
      - Summary's registries were discarded when 'b->datacrc' is equal
        as 'CRC_BAD'.
      - Summary's registries were not checked when b->datacrc differs of
        'CRC_BAD' and 'CRC_UNKNOWN'
      
      So, almost all of the time the crc just isn't checked, and in some
      cases the registries are discarded.
      
      Signed-off-by: default avatarWagner Popov dos Santos <wpopov@gmail.com>
      fc25ffe7
    • Wagner Popov dos Santos's avatar
      JFFS2: fix the reading address over nand's limit · 610a2cc7
      Wagner Popov dos Santos authored and Tom Rini's avatar Tom Rini committed
      
      Fixes address violation in functions read_nand_cached() and
      read_onenand_cached(). This happens because these functions
      try to read a fixed amount
      of data even when the offset+length
      is above the nand's limit.
      
      Signed-off-by: default avatarWagner Popov dos Santos <wpopov@gmail.com>
      610a2cc7
  2. Mar 27, 2021
  3. Mar 04, 2021
  4. Mar 01, 2021
    • Marek Behún's avatar
      fs: btrfs: do not fail when offset of a ROOT_ITEM is not -1 · 1afb9f22
      Marek Behún authored and Tom Rini's avatar Tom Rini committed
      
      When the btrfs_read_fs_root() function is searching a ROOT_ITEM with
      location key offset other than -1, it currently fails via BUG_ON.
      
      The offset can have other value than -1, though. This can happen for
      example if a subvolume is renamed:
      
        $ btrfs subvolume create X && sync
        Create subvolume './X'
        $ btrfs inspect-internal dump-tree /dev/root | grep -B 2 'name: X$
              location key (270 ROOT_ITEM 18446744073709551615) type DIR
              transid 283 data_len 0 name_len 1
              name: X
        $ mv X Y && sync
        $ btrfs inspect-internal dump-tree /dev/root | grep -B 2 'name: Y$
              location key (270 ROOT_ITEM 0) type DIR
              transid 285 data_len 0 name_len 1
              name: Y
      
      As can be seen the offset changed from -1ULL to 0.
      
      Do not fail in this case.
      
      Signed-off-by: default avatarMarek Behún <marek.behun@nic.cz>
      Cc: David Sterba <dsterba@suse.com>
      Cc: Qu Wenruo <wqu@suse.com>
      Cc: Tom Rini <trini@konsulko.com>
      1afb9f22
  5. Feb 24, 2021
  6. Feb 03, 2021
  7. Feb 02, 2021
    • Simon Glass's avatar
      common: Drop asm/global_data.h from common header · 401d1c4f
      Simon Glass authored and Tom Rini's avatar Tom Rini committed
      
      Move this out of the common header and include it only where needed.  In
      a number of cases this requires adding "struct udevice;" to avoid adding
      another large header or in other cases replacing / adding missing header
      files that had been pulled in, very indirectly.   Finally, we have a few
      cases where we did not need to include <asm/global_data.h> at all, so
      remove that include.
      
      Signed-off-by: Simon Glass's avatarSimon Glass <sjg@chromium.org>
      Signed-off-by: default avatarTom Rini <trini@konsulko.com>
      401d1c4f
  8. Feb 01, 2021
  9. Jan 29, 2021
  10. Jan 23, 2021
  11. Jan 20, 2021
    • Heinrich Schuchardt's avatar
      ubifs: do not decide upon uninitialized variable · 81f56271
      Heinrich Schuchardt authored and Tom Rini's avatar Tom Rini committed
      
      Before 'if (err)' we have to initialize the variable otherwise we use a
      random value from the stack.
      
      Signed-off-by: Heinrich Schuchardt's avatarHeinrich Schuchardt <xypron.glpk@gmx.de>
      81f56271
    • Heinrich Schuchardt's avatar
      fs: btrfs: simplify close_ctree_fs_info() · 3b00a6ba
      Heinrich Schuchardt authored and Tom Rini's avatar Tom Rini committed
      
      At the beginning of close_ctree_fs_info() the value 0 is assigned to err
      and never changed before testing it.
      
      Let's get rid of the superfluous variable.
      
      Fixes: f06bfcf5 ("fs: btrfs: Crossport open_ctree_fs_info() from btrfs-progs")
      Signed-off-by: Heinrich Schuchardt's avatarHeinrich Schuchardt <xypron.glpk@gmx.de>
      Reviewed-by: default avatarQu Wenruo <wqu@suse.com>
      3b00a6ba
    • Campbell Suter's avatar
      Fix squashfs failing to load sparse files · 9dba07f1
      Campbell Suter authored and Tom Rini's avatar Tom Rini committed
      
      SquashFS supports sprase blocks in files - that is, if a given block is
      composed only of zeros, it's not written to the output file to save
      space and it's on-disk length field is set to zero to indicate that.
      
      Previously the squashfs driver did not recognise that, and would attempt
      to read and decompress a zero-sized block, which obviously failed.
      
      The following command may be used to create a file for testing:
      
      cat <(dd if=/dev/urandom of=/dev/stdout bs=1M count=1) \
      	<(dd if=/dev/zero of=/dev/stdout bs=1M count=1) \
      	<(dd if=/dev/urandom of=/dev/stdout bs=1k count=200) >test_file
      
      Signed-off-by: default avatarCampbell Suter <campbell@snapit.group>
      9dba07f1
    • Qu Wenruo's avatar
      fs: btrfs: volumes: prevent overflow for multiplying · 3b72612a
      Qu Wenruo authored and Tom Rini's avatar Tom Rini committed
      
      In __btrfs_map_block() we do a int * int and assign it to u64.
      This is not safe as the result (int * int) is still evaluated as (int)
      thus it can overflow.
      
      Convert one of the multiplier to u64 to prevent such problem.
      
      In real world, this should not cause problem as we have device number
      limit thus it won't go beyond 4G for a single stripe.
      
      But it's harder to teach coverity about all these hidden limits, so just
      fix the possible overflow.
      
      Reported-by: Coverity CID 312957
      Reported-by: Coverity CID 312948
      Signed-off-by: default avatarQu Wenruo <wqu@suse.com>
      3b72612a
  12. Jan 13, 2021
    • Heinrich Schuchardt's avatar
      efi_loader: setting boot device · 5f59518a
      Heinrich Schuchardt authored
      
      Up to now the bootefi command used the last file loaded to determine the
      boot partition. This has led to errors when the fdt had been loaded from
      another partition after the EFI binary.
      
      Before setting the boot device from a loaded file check if it is a PE-COFF
      image or a FIT image.
      
      For a PE-COFF image remember address and size, boot device and path.
      
      For a FIT image remember boot device and path.
      
      If the PE-COFF image is overwritten by loading another file, forget it.
      
      Do not allow to start an image via bootefi which is not the last loaded
      PE-COFF image.
      
      Signed-off-by: Heinrich Schuchardt's avatarHeinrich Schuchardt <xypron.glpk@gmx.de>
      5f59518a
  13. Dec 31, 2020
  14. Dec 10, 2020
Loading