Skip to content
  1. Nov 16, 2017
  2. Nov 15, 2017
    • Mikulas Patocka's avatar
      dax: fix general protection fault in dax_alloc_inode · 9f586fff
      Mikulas Patocka authored
      Don't crash in case of allocation failure in dax_alloc_inode.
      
          syzkaller hit the following crash on e4880bc5
      
          kasan: CONFIG_KASAN_INLINE enabled
          kasan: GPF could be caused by NULL-ptr deref or user memory access
          [..]
          RIP: 0010:dax_alloc_inode+0x3b/0x70 drivers/dax/super.c:348
          Call Trace:
          alloc_inode+0x65/0x180 fs/inode.c:208
          new_inode_pseudo+0x69/0x190 fs/inode.c:890
          new_inode+0x1c/0x40 fs/inode.c:919
          mount_pseudo_xattr+0x288/0x560 fs/libfs.c:261
          mount_pseudo include/linux/fs.h:2137 [inline]
          dax_mount+0x2e/0x40 drivers/dax/super.c:388
          mount_fs+0x66/0x2d0 fs/super.c:1223
      
      Cc: <stable@vger.kernel.org>
      Fixes: 7b6be844
      
       ("dax: refactor dax-fs into a generic provider...")
      Reported-by: default avatarsyzbot <syzkaller@googlegroups.com>
      Signed-off-by: default avatarMikulas Patocka <mpatocka@redhat.com>
      Signed-off-by: default avatarDan Williams <dan.j.williams@intel.com>
      9f586fff
    • Jeff Moyer's avatar
      dax: fix PMD faults on zero-length files · 957ac8c4
      Jeff Moyer authored
      PMD faults on a zero length file on a file system mounted with -o dax
      will not generate SIGBUS as expected.
      
      	fd = open(...O_TRUNC);
      	addr = mmap(NULL, 2*1024*1024, PROT_READ|PROT_WRITE, MAP_SHARED, fd, 0);
      	*addr = 'a';
              <expect SIGBUS>
      
      The problem is this code in dax_iomap_pmd_fault:
      
      	max_pgoff = (i_size_read(inode) - 1) >> PAGE_SHIFT;
      
      If the inode size is zero, we end up with a max_pgoff that is way larger
      than 0.  :)  Fix it by using DIV_ROUND_UP, as is done elsewhere in the
      kernel.
      
      I tested this with some simple test code that ensured that SIGBUS was
      received where expected.
      
      Cc: <stable@vger.kernel.org>
      Fixes: 642261ac
      
       ("dax: add struct iomap based DAX PMD support")
      Signed-off-by: default avatarJeff Moyer <jmoyer@redhat.com>
      Signed-off-by: default avatarDan Williams <dan.j.williams@intel.com>
      957ac8c4
    • Dan Williams's avatar
      dax: stop requiring a live device for dax_flush() · 6a21586a
      Dan Williams authored
      Now that dax_flush() is no longer a driver callback (commit c3ca015f
      
      
      "dax: remove the pmem_dax_ops->flush abstraction"), stop requiring the
      dax_read_lock() to be held and the device to be alive.  This is in
      preparation for switching filesystem-dax to store pfns instead of
      sectors in the radix.
      
      Reviewed-by: default avatarChristoph Hellwig <hch@lst.de>
      Signed-off-by: default avatarDan Williams <dan.j.williams@intel.com>
      6a21586a
    • Dan Williams's avatar
      brd: remove dax support · 7a862fbb
      Dan Williams authored
      
      
      DAX support in brd is awkward because its backing page frames are
      distinct from the ones provided by pmem, dcssblk, or axonram. We need
      pfn_t_devmap() entries to fully support DAX, and the limited DAX support
      for pfn_t_special() page frames is not interesting for brd when pmem is
      already a superset of brd.  Lastly, brd is the only dax capable driver
      that may sleep in its ->direct_access() implementation. So it causes a
      global burden with no net gain of kernel functionality.
      
      For all these reasons, remove DAX support.
      
      Cc: Jens Axboe <axboe@kernel.dk>
      Cc: Matthew Wilcox <mawilcox@microsoft.com>
      Cc: Ross Zwisler <ross.zwisler@linux.intel.com>
      Reviewed-by: default avatarChristoph Hellwig <hch@lst.de>
      Signed-off-by: default avatarDan Williams <dan.j.williams@intel.com>
      7a862fbb
    • Dan Williams's avatar
      dax: quiet bdev_dax_supported() · 66a86cc1
      Dan Williams authored
      
      
      Before we add another failure reason, quiet the existing log messages.
      Leave it to the caller to decide if bdev_dax_supported() failures are
      errors worth emitting to the log.
      
      Reported-by: default avatarJeff Moyer <jmoyer@redhat.com>
      Reviewed-by: default avatarChristoph Hellwig <hch@lst.de>
      Signed-off-by: default avatarDan Williams <dan.j.williams@intel.com>
      66a86cc1
  3. Nov 14, 2017
  4. Nov 13, 2017
    • Dan Williams's avatar
      acpi, nfit: validate commands against the device type · 0e7f0741
      Dan Williams authored
      Fix occasions in acpi_nfit_ctl where we check the command type without
      validating whether we are parsing dimm vs bus level commands. Where the
      command numbers alias between dimms and bus we can make the wrong
      assumption just checking the raw command number. For example, with a
      simple nfit_test mock up of the clear-error command we trigger the
      following:
      
          BUG: unable to handle kernel NULL pointer dereference at 0000000000000094
          IP: acpi_nfit_ctl+0x29b/0x930 [nfit]
          [..]
          Call Trace:
           nfit_test_probe+0xb85/0xc09 [nfit_test]
           platform_drv_probe+0x3b/0xa0
           ? platform_drv_probe+0x3b/0xa0
           driver_probe_device+0x29c/0x450
           ? test_alloc+0x180/0x180 [nfit_test]
           __driver_attach+0xe3/0xf0
           ? driver_probe_device+0x450/0x450
           bus_for_each_dev+0x73/0xc0
           driver_attach+0x1e/0x20
           bus_add_driver+0x173/0x270
           driver_register+0x60/0xe0
           __platform_driver_register+0x36/0x40
           nfit_test_init+0x2a1/0x1000 [nfit_test]
      
      Fixes: 4b27db7e
      
       ("acpi, nfit: add support for the _LSI, _LSR, and...")
      Reported-by: default avatarVishal Verma <vishal.l.verma@intel.com>
      Tested-by: default avatarVishal Verma <vishal.l.verma@intel.com>
      Signed-off-by: default avatarDan Williams <dan.j.williams@intel.com>
      0e7f0741
  5. Nov 09, 2017
  6. Nov 03, 2017
  7. Oct 31, 2017
  8. Oct 30, 2017
    • Dan Williams's avatar
      acpi, nfit: hide unknown commands from nmemX/commands · b9b1504d
      Dan Williams authored
      
      
      For vendor specific commands that do not have a common kernel
      translation, hide them from nmemX/commands. For example, the following
      results from new enabling to probe for support of the new
      NVDIMM_FAMILY_INTEL DSMs specified in v1.6 of the command specification
      [1]:
      
          # cat /sys/bus/nd/devices/nmem0/commands
          smart smart_thresh flags get_size get_data set_data effect_size
          effect_log vendor cmd_call unknown unknown unknown unknown unknown
          unknown unknown unknown
      
      [1]: https://pmem.io/documents/NVDIMM_DSM_Interface-V1.6.pdf
      
      Signed-off-by: default avatarDan Williams <dan.j.williams@intel.com>
      b9b1504d
  9. Oct 20, 2017
  10. Oct 09, 2017
  11. Oct 08, 2017
    • Linus Torvalds's avatar
      Merge tag 'scsi-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi · 85b1bb24
      Linus Torvalds authored
      Pull SCSI fixes from James Bottomley:
      
       - a couple of serious fixes: use after free and blacklist for WRITE
         SAME
      
       - one error leg fix: write_pending failure
      
       - one user experience problem: do not override max_sectors_kb
      
       - one minor unused function removal
      
      * tag 'scsi-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi:
        scsi: ibmvscsis: Fix write_pending failure path
        scsi: libiscsi: Remove iscsi_destroy_session
        scsi: libiscsi: Fix use-after-free race during iscsi_session_teardown
        scsi: sd: Do not override max_sectors_kb sysfs setting
        scsi: sd: Implement blacklist option for WRITE SAME w/ UNMAP
      85b1bb24