1. 06 6月, 2018 4 次提交
    • D
      xfs: push corruption -> ESTALE conversion to xfs_nfs_get_inode() · 29cad0b3
      Dave Chinner 提交于
      In xfs_imap_to_bp(), we convert a -EFSCORRUPTED error to -EINVAL if
      we are doing an untrusted lookup. This is done because we need
      failed filehandle lookups to report -ESTALE to the caller, and it
      does this by converting -EINVAL and -ENOENT errors to -ESTALE.
      
      The squashing of EFSCORRUPTED in imap_to_bp makes it impossible for
      for xfs_iget(UNTRUSTED) callers to determine the difference between
      "inode does not exist" and "corruption detected during lookup". We
      realy need that distinction in places calling xfS_iget(UNTRUSTED),
      so move the filehandle error case handling all the way out to
      xfs_nfs_get_inode() where it is needed.
      Signed-off-by: NDave Chinner <dchinner@redhat.com>
      Reviewed-by: NCarlos Maiolino <cmaiolino@redhat.com>
      Reviewed-by: NDarrick J. Wong <darrick.wong@oracle.com>
      Signed-off-by: NDarrick J. Wong <darrick.wong@oracle.com>
      29cad0b3
    • D
      xfs: verify COW extent size hint is valid in inode verifier · 02a0fda8
      Dave Chinner 提交于
      There are rules for vald extent size hints. We enforce them when
      applications set them, but fuzzers violate those rules and that
      screws us over. Validate COW extent size hint rules in the inode
      verifier to catch this.
      Signed-off-by: NDave Chinner <dchinner@redhat.com>
      Reviewed-by: NCarlos Maiolino <cmaiolino@redhat.com>
      Reviewed-by: NDarrick J. Wong <darrick.wong@oracle.com>
      Signed-off-by: NDarrick J. Wong <darrick.wong@oracle.com>
      02a0fda8
    • D
      xfs: verify extent size hint is valid in inode verifier · 7d71a671
      Dave Chinner 提交于
      There are rules for vald extent size hints. We enforce them when
      applications set them, but fuzzers violate those rules and that
      screws us over.
      
      This results in alignment assertion failures when setting up
      allocations such as this in direct IO:
      
      XFS: Assertion failed: ap->length, file: fs/xfs/libxfs/xfs_bmap.c, line: 3432
      ....
      Call Trace:
       xfs_bmap_btalloc+0x415/0x910
       xfs_bmapi_write+0x71c/0x12e0
       xfs_iomap_write_direct+0x2a9/0x420
       xfs_file_iomap_begin+0x4dc/0xa70
       iomap_apply+0x43/0x100
       iomap_file_buffered_write+0x62/0x90
       xfs_file_buffered_aio_write+0xba/0x300
       __vfs_write+0xd5/0x150
       vfs_write+0xb6/0x180
       ksys_write+0x45/0xa0
       do_syscall_64+0x5a/0x180
       entry_SYSCALL_64_after_hwframe+0x49/0xbe
      
      And from xfs_db:
      
      core.extsize = 10380288
      
      Which is not an integer multiple of the block size, and so violates
      Rule #7 for setting extent size hints. Validate extent size hint
      rules in the inode verifier to catch this.
      Signed-off-by: NDave Chinner <dchinner@redhat.com>
      Reviewed-by: NCarlos Maiolino <cmaiolino@redhat.com>
      Reviewed-by: NDarrick J. Wong <darrick.wong@oracle.com>
      Signed-off-by: NDarrick J. Wong <darrick.wong@oracle.com>
      7d71a671
    • D
      xfs: catch bad stripe alignment configurations · fa4ca9c5
      Dave Chinner 提交于
      When stripe alignments are invalid, data alignment algorithms in the
      allocator may not work correctly. Ensure we catch superblocks with
      invalid stripe alignment setups at mount time. These data alignment
      mismatches are now detected at mount time like this:
      
      XFS (loop0): SB stripe unit sanity check failed
      XFS (loop0): Metadata corruption detected at xfs_sb_read_verify+0xab/0x110, xfs_sb block 0xffffffffffffffff
      XFS (loop0): Unmount and run xfs_repair
      XFS (loop0): First 128 bytes of corrupted metadata buffer:
      0000000091c2de02: 58 46 53 42 00 00 10 00 00 00 00 00 00 00 10 00  XFSB............
      0000000023bff869: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
      00000000cdd8c893: 17 32 37 15 ff ca 46 3d 9a 17 d3 33 04 b5 f1 a2  .27...F=...3....
      000000009fd2844f: 00 00 00 00 00 00 00 04 00 00 00 00 00 00 06 d0  ................
      0000000088e9b0bb: 00 00 00 00 00 00 06 d1 00 00 00 00 00 00 06 d2  ................
      00000000ff233a20: 00 00 00 01 00 00 10 00 00 00 00 01 00 00 00 00  ................
      000000009db0ac8b: 00 00 03 60 e1 34 02 00 08 00 00 02 00 00 00 00  ...`.4..........
      00000000f7022460: 00 00 00 00 00 00 00 00 0c 09 0b 01 0c 00 00 19  ................
      XFS (loop0): SB validate failed with error -117.
      
      And the mount fails.
      Signed-off-by: NDave Chinner <dchinner@redhat.com>
      Reviewed-by: NCarlos Maiolino <cmaiolino@redhat.com>
      Reviewed-by: NDarrick J. Wong <darrick.wong@oracle.com>
      Signed-off-by: NDarrick J. Wong <darrick.wong@oracle.com>
      fa4ca9c5
  2. 05 6月, 2018 12 次提交
  3. 04 6月, 2018 1 次提交
  4. 02 6月, 2018 5 次提交
  5. 30 5月, 2018 2 次提交
  6. 16 5月, 2018 14 次提交
  7. 10 5月, 2018 2 次提交