freebsd-dev/sys/dev/acpica
Ben Widawsky 1a305bda15 acpi: fix acpi_ec_probe to only check EC devices
This patch utilizes the fixed_devclass attribute in order to make sure
other acpi devices with params don't get confused for an EC device.

The existing code assumes that acpi_ec_probe is only ever called with a
dereferencable acpi param. Aside from being incorrect because other
devices of ACPI_TYPE_DEVICE may be probed here which aren't ec devices,
(and they may have set acpi private data), it is even more nefarious if
another ACPI driver uses private data which is not dereferancable. This
will result in a pointer deref during boot and therefore boot failure.

On X86, as it stands today, no other devices actually do this (acpi_cpu
checks for PROCESSOR type devices) and so there is no issue. I ran into
this because I am adding such a device which gets probed before
acpi_ec_probe and sets private data. If ARM ever has an EC, I think
they'd run into this issue as well.

There have been several iterations of this patch. Earlier
iterations had ECDT enumerated ECs not call into the probe/attach
functions of this driver. This change was Suggested by: jhb@.

Reviewed by:    jhb
Approved by:	emaste (mentor)
Differential Revision:  https://reviews.freebsd.org/D16635
2018-11-19 18:29:03 +00:00
..
Osd remove unneeded inclusion of sys/interrupt.h from several files 2018-07-04 09:07:18 +00:00
acpi_acad.c Distinguish _CID match and _HID match and make lower priority probe 2018-10-26 00:05:46 +00:00
acpi_battery.c Make battery emptying rate available as sysctl variable. 2018-10-30 00:19:44 +00:00
acpi_bus_if.m Add the start of INTRNG support for ACPI. 2018-01-11 17:09:12 +00:00
acpi_button.c Distinguish _CID match and _HID match and make lower priority probe 2018-10-26 00:05:46 +00:00
acpi_cmbat.c Distinguish _CID match and _HID match and make lower priority probe 2018-10-26 00:05:46 +00:00
acpi_container.c Distinguish _CID match and _HID match and make lower priority probe 2018-10-26 00:05:46 +00:00
acpi_cpu.c Distinguish _CID match and _HID match and make lower priority probe 2018-10-26 00:05:46 +00:00
acpi_dock.c
acpi_ec.c acpi: fix acpi_ec_probe to only check EC devices 2018-11-19 18:29:03 +00:00
acpi_hpet.c Distinguish _CID match and _HID match and make lower priority probe 2018-10-26 00:05:46 +00:00
acpi_hpet.h Implement userspace gettimeofday(2) with HPET timecounter. 2016-08-17 09:52:09 +00:00
acpi_if.m Distinguish _CID match and _HID match and make lower priority probe 2018-10-26 00:05:46 +00:00
acpi_isab.c Distinguish _CID match and _HID match and make lower priority probe 2018-10-26 00:05:46 +00:00
acpi_lid.c Distinguish _CID match and _HID match and make lower priority probe 2018-10-26 00:05:46 +00:00
acpi_package.c acpica: remove a superfluous NULL check 2017-02-16 20:27:22 +00:00
acpi_pci_link.c Distinguish _CID match and _HID match and make lower priority probe 2018-10-26 00:05:46 +00:00
acpi_pci.c Add a new bus method to fetch device-specific CPU sets. 2016-05-09 20:50:21 +00:00
acpi_pcib_acpi.c Add support for NUMA domains to bus dma tags. This causes all memory 2018-01-12 23:34:16 +00:00
acpi_pcib_pci.c Implement a proper detach method for the PCI-PCI bridge driver. 2016-05-20 00:03:22 +00:00
acpi_pcib.c acpica: rework INTRNG interrupts 2018-11-19 03:02:47 +00:00
acpi_pcibvar.h Add a new bus method to fetch device-specific CPU sets. 2016-05-09 20:50:21 +00:00
acpi_pcivar.h Associate device_t objects with ACPI handles via PCI_CHILD_ADDED(). 2016-04-07 17:15:16 +00:00
acpi_perf.c Remove misc NULL checks after M_WAITOK allocations. 2016-05-10 10:26:07 +00:00
acpi_powerres.c
acpi_quirk.c
acpi_quirks
acpi_resource.c pci_host_generic, acpi_resource: drop unneeded code 2018-11-19 03:34:15 +00:00
acpi_smbat.c Distinguish _CID match and _HID match and make lower priority probe 2018-10-26 00:05:46 +00:00
acpi_smbus.h
acpi_thermal.c Make timespecadd(3) and friends public 2018-07-30 15:46:40 +00:00
acpi_throttle.c
acpi_timer.c Use uintmax_t (typedef'd to rman_res_t type) for rman ranges. 2016-03-18 01:28:41 +00:00
acpi_video.c Silence PVS-Studio warning (V595). 2016-02-23 22:55:44 +00:00
acpi.c acpica, pci_host_generic_acpi: redo pci_host_generic_acpi.c 2018-11-19 03:16:16 +00:00
acpiio.h sys/dev: minor spelling fixes. 2016-05-03 03:41:25 +00:00
acpivar.h acpica: rework INTRNG interrupts 2018-11-19 03:02:47 +00:00