1. 14 9月, 2021 4 次提交
  2. 21 7月, 2021 1 次提交
    • U
      bus: Make remove callback return void · fc7a6209
      Uwe Kleine-König 提交于
      The driver core ignores the return value of this callback because there
      is only little it can do when a device disappears.
      
      This is the final bit of a long lasting cleanup quest where several
      buses were converted to also return void from their remove callback.
      Additionally some resource leaks were fixed that were caused by drivers
      returning an error code in the expectation that the driver won't go
      away.
      
      With struct bus_type::remove returning void it's prevented that newly
      implemented buses return an ignored error code and so don't anticipate
      wrong expectations for driver authors.
      
      Reviewed-by: Tom Rix <trix@redhat.com> (For fpga)
      Reviewed-by: NMathieu Poirier <mathieu.poirier@linaro.org>
      Reviewed-by: Cornelia Huck <cohuck@redhat.com> (For drivers/s390 and drivers/vfio)
      Acked-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk> (For ARM, Amba and related parts)
      Acked-by: NMark Brown <broonie@kernel.org>
      Acked-by: Chen-Yu Tsai <wens@csie.org> (for sunxi-rsb)
      Acked-by: NPali Rohár <pali@kernel.org>
      Acked-by: Mauro Carvalho Chehab <mchehab@kernel.org> (for media)
      Acked-by: Hans de Goede <hdegoede@redhat.com> (For drivers/platform)
      Acked-by: NAlexandre Belloni <alexandre.belloni@bootlin.com>
      Acked-By: NVinod Koul <vkoul@kernel.org>
      Acked-by: Juergen Gross <jgross@suse.com> (For xen)
      Acked-by: Lee Jones <lee.jones@linaro.org> (For mfd)
      Acked-by: Johannes Thumshirn <jth@kernel.org> (For mcb)
      Acked-by: NJohan Hovold <johan@kernel.org>
      Acked-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org> (For slimbus)
      Acked-by: Kirti Wankhede <kwankhede@nvidia.com> (For vfio)
      Acked-by: NMaximilian Luz <luzmaximilian@gmail.com>
      Acked-by: Heikki Krogerus <heikki.krogerus@linux.intel.com> (For ulpi and typec)
      Acked-by: Samuel Iglesias Gonsálvez <siglesias@igalia.com> (For ipack)
      Acked-by: Geoff Levand <geoff@infradead.org> (For ps3)
      Acked-by: Yehezkel Bernat <YehezkelShB@gmail.com> (For thunderbolt)
      Acked-by: Alexander Shishkin <alexander.shishkin@linux.intel.com> (For intel_th)
      Acked-by: Dominik Brodowski <linux@dominikbrodowski.net> (For pcmcia)
      Acked-by: Rafael J. Wysocki <rafael@kernel.org> (For ACPI)
      Acked-by: Bjorn Andersson <bjorn.andersson@linaro.org> (rpmsg and apr)
      Acked-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com> (For intel-ish-hid)
      Acked-by: Dan Williams <dan.j.williams@intel.com> (For CXL, DAX, and NVDIMM)
      Acked-by: William Breathitt Gray <vilhelm.gray@gmail.com> (For isa)
      Acked-by: Stefan Richter <stefanr@s5r6.in-berlin.de> (For firewire)
      Acked-by: Benjamin Tissoires <benjamin.tissoires@redhat.com> (For hid)
      Acked-by: Thorsten Scherer <t.scherer@eckelmann.de> (For siox)
      Acked-by: Sven Van Asbroeck <TheSven73@gmail.com> (For anybuss)
      Acked-by: Ulf Hansson <ulf.hansson@linaro.org> (For MMC)
      Acked-by: Wolfram Sang <wsa@kernel.org> # for I2C
      Acked-by: NSudeep Holla <sudeep.holla@arm.com>
      Acked-by: NGeert Uytterhoeven <geert@linux-m68k.org>
      Acked-by: NDmitry Torokhov <dmitry.torokhov@gmail.com>
      Acked-by: NFinn Thain <fthain@linux-m68k.org>
      Signed-off-by: NUwe Kleine-König <u.kleine-koenig@pengutronix.de>
      Link: https://lore.kernel.org/r/20210713193522.1770306-6-u.kleine-koenig@pengutronix.deSigned-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      fc7a6209
  3. 08 3月, 2021 2 次提交
  4. 28 10月, 2020 1 次提交
  5. 27 10月, 2020 1 次提交
  6. 23 4月, 2020 3 次提交
  7. 21 3月, 2020 1 次提交
  8. 23 10月, 2019 1 次提交
  9. 30 7月, 2019 1 次提交
  10. 17 6月, 2019 3 次提交
  11. 31 5月, 2019 1 次提交
  12. 08 3月, 2019 1 次提交
  13. 24 2月, 2019 1 次提交
  14. 31 10月, 2018 1 次提交
  15. 23 6月, 2018 1 次提交
  16. 02 3月, 2018 2 次提交
  17. 24 2月, 2018 1 次提交
  18. 19 2月, 2018 1 次提交
  19. 15 2月, 2018 1 次提交
    • A
      platform/x86: wmi: fix off-by-one write in wmi_dev_probe() · 6e1d8ea9
      Andrey Ryabinin 提交于
      wmi_dev_probe() allocates one byte less than necessary, thus
      subsequent sprintf() call writes trailing zero past the end
      of the 'buf':
      
          BUG: KASAN: slab-out-of-bounds in vsnprintf+0xda4/0x1240
          Write of size 1 at addr ffff880423529caf by task kworker/1:1/32
      
          Call Trace:
           dump_stack+0xb3/0x14d
           print_address_description+0xd7/0x380
           kasan_report+0x166/0x2b0
           vsnprintf+0xda4/0x1240
           sprintf+0x9b/0xd0
           wmi_dev_probe+0x1c3/0x400
           driver_probe_device+0x5d1/0x990
           bus_for_each_drv+0x109/0x190
           __device_attach+0x217/0x360
           bus_probe_device+0x1ad/0x260
           deferred_probe_work_func+0x10f/0x5d0
           process_one_work+0xa8b/0x1dc0
           worker_thread+0x20d/0x17d0
           kthread+0x311/0x3d0
           ret_from_fork+0x3a/0x50
      
          Allocated by task 32:
           kasan_kmalloc+0xa0/0xd0
           __kmalloc+0x14f/0x3e0
           wmi_dev_probe+0x182/0x400
           driver_probe_device+0x5d1/0x990
           bus_for_each_drv+0x109/0x190
           __device_attach+0x217/0x360
           bus_probe_device+0x1ad/0x260
           deferred_probe_work_func+0x10f/0x5d0
           process_one_work+0xa8b/0x1dc0
           worker_thread+0x20d/0x17d0
           kthread+0x311/0x3d0
           ret_from_fork+0x3a/0x50
      
      Increment allocation size to fix this.
      
      Fixes: 44b6b766 ("platform/x86: wmi: create userspace interface for drivers")
      Signed-off-by: NAndrey Ryabinin <aryabinin@virtuozzo.com>
      Cc: <stable@vger.kernel.org>
      Signed-off-by: NAndy Shevchenko <andriy.shevchenko@linux.intel.com>
      6e1d8ea9
  20. 09 1月, 2018 1 次提交
  21. 06 1月, 2018 1 次提交
  22. 09 11月, 2017 1 次提交
  23. 04 11月, 2017 3 次提交
    • M
      platform/x86: wmi: create userspace interface for drivers · 44b6b766
      Mario Limonciello 提交于
      For WMI operations that are only Set or Query readable and writable sysfs
      attributes created by WMI vendor drivers or the bus driver makes sense.
      
      For other WMI operations that are run on Method, there needs to be a
      way to guarantee to userspace that the results from the method call
      belong to the data request to the method call.  Sysfs attributes don't
      work well in this scenario because two userspace processes may be
      competing at reading/writing an attribute and step on each other's
      data.
      
      When a WMI vendor driver declares a callback method in the wmi_driver
      the WMI bus driver will create a character device that maps to that
      function.  This callback method will be responsible for filtering
      invalid requests and performing the actual call.
      
      That character device will correspond to this path:
      /dev/wmi/$driver
      
      Performing read() on this character device will provide the size
      of the buffer that the character device needs to perform calls.
      This buffer size can be set by vendor drivers through a new symbol
      or when MOF parsing is available by the MOF.
      
      Performing ioctl() on this character device will be interpretd
      by the WMI bus driver. It will perform sanity tests for size of
      data, test them for a valid instance, copy the data from userspace
      and pass iton to the vendor driver to further process and run.
      
      This creates an implicit policy that each driver will only be allowed
      a single character device.  If a module matches multiple GUID's,
      the wmi_devices will need to be all handled by the same wmi_driver.
      
      The WMI vendor drivers will be responsible for managing inappropriate
      access to this character device and proper locking on data used by
      it.
      
      When a WMI vendor driver is unloaded the WMI bus driver will clean
      up the character device and any memory allocated for the call.
      Signed-off-by: NMario Limonciello <mario.limonciello@dell.com>
      Reviewed-by: NEdward O'Callaghan <quasisec@google.com>
      Signed-off-by: NDarren Hart (VMware) <dvhart@infradead.org>
      44b6b766
    • M
      platform/x86: wmi: Don't allow drivers to get each other's GUIDs · f97e058c
      Mario Limonciello 提交于
      The only driver using this was dell-wmi, and it really was a hack.
      The driver was getting a data attribute from another driver and this
      type of action should not be encouraged.
      
      Rather drivers that need to interact with one another should pass
      data back and forth via exported functions.
      Signed-off-by: NMario Limonciello <mario.limonciello@dell.com>
      Reviewed-by: NEdward O'Callaghan <quasisec@google.com>
      Reviewed-by: NPali Rohár <pali.rohar@gmail.com>
      Signed-off-by: NDarren Hart (VMware) <dvhart@infradead.org>
      f97e058c
    • M
      platform/x86: wmi: Add new method wmidev_evaluate_method · 722c856d
      Mario Limonciello 提交于
      Drivers properly using the wmibus can pass their wmi_device
      pointer rather than the GUID back to the WMI bus to evaluate
      the proper methods.
      
      Any "new" drivers added that use the WMI bus should use this
      rather than the old wmi_evaluate_method that would take the
      GUID.
      Signed-off-by: NMario Limonciello <mario.limonciello@dell.com>
      Reviewed-by: NEdward O'Callaghan <quasisec@google.com>
      Reviewed-by: NPali Rohár <pali.rohar@gmail.com>
      Signed-off-by: NDarren Hart (VMware) <dvhart@infradead.org>
      722c856d
  24. 28 9月, 2017 3 次提交
  25. 18 8月, 2017 1 次提交
  26. 22 7月, 2017 1 次提交
  27. 14 6月, 2017 1 次提交