1. 10 5月, 2020 5 次提交
  2. 27 4月, 2020 1 次提交
    • N
      nvme: prevent double free in nvme_alloc_ns() error handling · 132be623
      Niklas Cassel 提交于
      When jumping to the out_put_disk label, we will call put_disk(), which will
      trigger a call to disk_release(), which calls blk_put_queue().
      
      Later in the cleanup code, we do blk_cleanup_queue(), which will also call
      blk_put_queue().
      
      Putting the queue twice is incorrect, and will generate a KASAN splat.
      
      Set the disk->queue pointer to NULL, before calling put_disk(), so that the
      first call to blk_put_queue() will not free the queue.
      
      The second call to blk_put_queue() uses another pointer to the same queue,
      so this call will still free the queue.
      
      Fixes: 85136c01 ("lightnvm: simplify geometry enumeration")
      Signed-off-by: NNiklas Cassel <niklas.cassel@wdc.com>
      Signed-off-by: NChristoph Hellwig <hch@lst.de>
      132be623
  3. 02 4月, 2020 1 次提交
  4. 31 3月, 2020 1 次提交
    • N
      nvme: fix compat address handling in several ioctls · c95b708d
      Nick Bowler 提交于
      On a 32-bit kernel, the upper bits of userspace addresses passed via
      various ioctls are silently ignored by the nvme driver.
      
      However on a 64-bit kernel running a compat task, these upper bits are
      not ignored and are in fact required to be zero for the ioctls to work.
      
      Unfortunately, this difference matters.  32-bit smartctl submits the
      NVME_IOCTL_ADMIN_CMD ioctl with garbage in these upper bits because it
      seems the pointer value it puts into the nvme_passthru_cmd structure is
      sign extended.  This works fine on 32-bit kernels but fails on a 64-bit
      one because (at least on my setup) the addresses smartctl uses are
      consistently above 2G.  For example:
      
        # smartctl -x /dev/nvme0n1
        smartctl 7.1 2019-12-30 r5022 [x86_64-linux-5.5.11] (local build)
        Copyright (C) 2002-19, Bruce Allen, Christian Franke, www.smartmontools.org
      
        Read NVMe Identify Controller failed: NVME_IOCTL_ADMIN_CMD: Bad address
      
      Since changing 32-bit kernels to actually check all of the submitted
      address bits now would break existing userspace, this patch fixes the
      compat problem by explicitly zeroing the upper bits in the compat case.
      This enables 32-bit smartctl to work on a 64-bit kernel.
      Signed-off-by: NNick Bowler <nbowler@draconx.ca>
      Signed-off-by: NChristoph Hellwig <hch@lst.de>
      c95b708d
  5. 26 3月, 2020 16 次提交
  6. 19 3月, 2020 1 次提交
  7. 05 3月, 2020 1 次提交
  8. 20 2月, 2020 1 次提交
  9. 15 2月, 2020 2 次提交
  10. 10 1月, 2020 1 次提交
  11. 03 12月, 2019 1 次提交
  12. 27 11月, 2019 2 次提交
  13. 13 11月, 2019 1 次提交
  14. 12 11月, 2019 1 次提交
    • G
      nvme: Add hardware monitoring support · 400b6a7b
      Guenter Roeck 提交于
      nvme devices report temperature information in the controller information
      (for limits) and in the smart log. Currently, the only means to retrieve
      this information is the nvme command line interface, which requires
      super-user privileges.
      
      At the same time, it would be desirable to be able to use NVMe temperature
      information for thermal control.
      
      This patch adds support to read NVMe temperatures from the kernel using the
      hwmon API and adds temperature zones for NVMe drives. The thermal subsystem
      can use this information to set thermal policies, and userspace can access
      it using libsensors and/or the "sensors" command.
      
      Example output from the "sensors" command:
      
      nvme0-pci-0100
      Adapter: PCI adapter
      Composite:    +39.0°C  (high = +85.0°C, crit = +85.0°C)
      Sensor 1:     +39.0°C
      Sensor 2:     +41.0°C
      Reviewed-by: NChristoph Hellwig <hch@lst.de>
      Signed-off-by: NGuenter Roeck <linux@roeck-us.net>
      Signed-off-by: NKeith Busch <kbusch@kernel.org>
      400b6a7b
  15. 05 11月, 2019 4 次提交
  16. 23 10月, 2019 1 次提交