1. 06 3月, 2018 1 次提交
  2. 22 2月, 2018 3 次提交
  3. 21 2月, 2018 2 次提交
  4. 27 1月, 2018 4 次提交
  5. 24 1月, 2018 4 次提交
  6. 18 1月, 2018 4 次提交
  7. 17 1月, 2018 2 次提交
    • J
      i2c: core-smbus: prevent stack corruption on read I2C_BLOCK_DATA · 89c6efa6
      Jeremy Compostella 提交于
      On a I2C_SMBUS_I2C_BLOCK_DATA read request, if data->block[0] is
      greater than I2C_SMBUS_BLOCK_MAX + 1, the underlying I2C driver writes
      data out of the msgbuf1 array boundary.
      
      It is possible from a user application to run into that issue by
      calling the I2C_SMBUS ioctl with data.block[0] greater than
      I2C_SMBUS_BLOCK_MAX + 1.
      
      This patch makes the code compliant with
      Documentation/i2c/dev-interface by raising an error when the requested
      size is larger than 32 bytes.
      
      Call Trace:
       [<ffffffff8139f695>] dump_stack+0x67/0x92
       [<ffffffff811802a4>] panic+0xc5/0x1eb
       [<ffffffff810ecb5f>] ? vprintk_default+0x1f/0x30
       [<ffffffff817456d3>] ? i2cdev_ioctl_smbus+0x303/0x320
       [<ffffffff8109a68b>] __stack_chk_fail+0x1b/0x20
       [<ffffffff817456d3>] i2cdev_ioctl_smbus+0x303/0x320
       [<ffffffff81745aed>] i2cdev_ioctl+0x4d/0x1e0
       [<ffffffff811f761a>] do_vfs_ioctl+0x2ba/0x490
       [<ffffffff81336e43>] ? security_file_ioctl+0x43/0x60
       [<ffffffff811f7869>] SyS_ioctl+0x79/0x90
       [<ffffffff81a22e97>] entry_SYSCALL_64_fastpath+0x12/0x6a
      Signed-off-by: NJeremy Compostella <jeremy.compostella@intel.com>
      Signed-off-by: NWolfram Sang <wsa@the-dreams.de>
      Cc: stable@kernel.org
      89c6efa6
    • L
      i2c: core: decrease reference count of device node in i2c_unregister_device · e0638fa4
      Lixin Wang 提交于
      Reference count of device node was increased in of_i2c_register_device,
      but without decreasing it in i2c_unregister_device. Then the added
      device node will never be released. Fix this by adding the of_node_put.
      Signed-off-by: NLixin Wang <alan.1.wang@nokia-sbell.com>
      Tested-by: NWolfram Sang <wsa@the-dreams.de>
      Signed-off-by: NWolfram Sang <wsa@the-dreams.de>
      Cc: stable@kernel.org
      e0638fa4
  8. 16 1月, 2018 18 次提交
  9. 10 1月, 2018 2 次提交
    • R
      PM: i2c-designware-platdrv: Optimize power management · 02e45646
      Rafael J. Wysocki 提交于
      Optimize the power management in i2c-designware-platdrv by making it
      set the DPM_FLAG_SMART_SUSPEND and DPM_FLAG_LEAVE_SUSPENDED which
      allows some code to be dropped from its PM callbacks.
      
      First, setting DPM_FLAG_SMART_SUSPEND causes the intel-lpss driver
      to avoid resuming i2c-designware-platdrv devices in its ->prepare
      callback, so they can stay in runtime suspend after that point even
      if the direct-complete feature is not used for them.
      
      It also causes the ACPI PM domain and the PM core to avoid invoking
      "late" and "noirq" suspend callbacks for these devices if they are
      in runtime suspend at the beginning of the "late" phase of device
      suspend during system suspend.  That guarantees dw_i2c_plat_suspend()
      to be called for a device only if it is not in runtime suspend.
      
      Moreover, it causes the device's runtime PM status to be set to
      "active" after calling dw_i2c_plat_resume() for it, so the
      driver doesn't need internal flags to avoid invoking either
      dw_i2c_plat_suspend() or dw_i2c_plat_resume() twice in a row.
      
      Second, setting DPM_FLAG_LEAVE_SUSPENDED enables the optimization
      allowing the device to stay suspended after system resume under
      suitable conditions, so again the driver doesn't need to take
      care of that by itself.
      
      Accordingly, the internal "suspended" and "skip_resume" flags
      used by the driver are not necessary any more, so drop them and
      simplify the driver's PM callbacks.
      
      Additionally, notice that dw_i2c_plat_complete() only needs to
      schedule runtime PM resume for the device if platform firmware
      has been involved in resuming the system, so make it call
      pm_resume_via_firmware() to check that.  Also make it check the
      runtime PM status of the device instead of its direct_complete
      flag which also works if the device remained suspended due to
      the DPM_FLAG_LEAVE_SUSPENDED driver flag.
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      Acked-by: NJarkko Nikula <jarkko.nikula@linux.intel.com>
      Acked-by: NWolfram Sang <wsa@the-dreams.de>
      Tested-by: NJarkko Nikula <jarkko.nikula@linux.intel.com>
      02e45646
    • R
      PM: i2c-designware-platdrv: Use DPM_FLAG_SMART_PREPARE · 422cb781
      Rafael J. Wysocki 提交于
      Modify i2c-designware-platdrv to set DPM_FLAG_SMART_PREPARE for its
      devices and return 0 from the system suspend ->prepare callback
      if the device has an ACPI companion object in order to tell the PM
      core and middle layers to avoid skipping system suspend/resume
      callbacks for the device in that case (which may be problematic,
      because the device may be accessed during suspend and resume of
      other devices via I2C operation regions then).
      
      Also the pm_runtime_suspended() check in dw_i2c_plat_prepare()
      is not necessary any more, because the core does it when setting
      power.direct_complete for the device, so drop it.
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      Acked-by: NJarkko Nikula <jarkko.nikula@linux.intel.com>
      Acked-by: NWolfram Sang <wsa@the-dreams.de>
      Tested-by: NJarkko Nikula <jarkko.nikula@linux.intel.com>
      422cb781