linux/drivers/platform/x86
Hans de Goede d939cd96b9 platform/x86: dell-wmi-sysman: Fix crash caused by calling kset_unregister twice
On some system the WMI GUIDs used by dell-wmi-sysman are present but there
are no enum type attributes, this causes init_bios_attributes() to return
-ENODEV, after which sysman_init() does a "goto fail_create_group" and then
calls release_attributes_data().

release_attributes_data() calls kset_unregister(wmi_priv.main_dir_kset);
but before this commit it was missing a "wmi_priv.main_dir_kset = NULL;"
statement; and after calling release_attributes_data() the sysman_init()
error handling does this:

        if (wmi_priv.main_dir_kset) {
                kset_unregister(wmi_priv.main_dir_kset);
                wmi_priv.main_dir_kset = NULL;
        }

Which causes a second kset_unregister(wmi_priv.main_dir_kset), leading to
a double-free, which causes a crash.

Add the missing "wmi_priv.main_dir_kset = NULL;" statement to
release_attributes_data() to fix this double-free crash.

Fixes: e8a60aa740 ("platform/x86: Introduce support for Systems Management Driver over WMI for Dell Systems")
Cc: Divya Bharathi <Divya_Bharathi@dell.com>
Cc: Mario Limonciello <mario.limonciello@dell.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Link: https://lore.kernel.org/r/20210321115901.35072-2-hdegoede@redhat.com
2021-03-21 17:46:57 +01:00
..
dell platform/x86: dell-wmi-sysman: Fix crash caused by calling kset_unregister twice 2021-03-21 17:46:57 +01:00
intel_speed_select_if platform/x86: ISST: Mark mmio_range_devid_0 and mmio_range_devid_1 with static keyword 2020-12-08 16:30:55 +01:00
acer-wireless.c acer-wireless: send an EV_SYN/SYN_REPORT between state changes 2020-12-07 16:10:11 +01:00
acer-wmi.c platform/x86: acer-wmi: Don't use ACPI_EXCEPTION() 2021-02-04 15:15:19 +01:00
acerhdf.c thermal/core: Remove ms based delay fields 2021-01-19 22:23:49 +01:00
amd-pmc.c platform/x86: amd-pmc: put device on error paths 2021-02-02 19:33:44 +01:00
amilo-rfkill.c
apple-gmux.c platform/x86: apple-gmux: Replace HTTP links with HTTPS ones 2020-07-15 13:01:20 +03:00
asus-laptop.c ACPI: Test for ACPI_SUCCESS rather than !ACPI_FAILURE 2021-01-27 18:43:07 +01:00
asus-nb-wmi.c platform/x86: asus-wmi: Add support for SW_TABLET_MODE on UX360 2020-10-28 12:47:37 +01:00
asus-wireless.c
asus-wmi.c platform/x86: asus-wmi: Add userspace notification for performance mode change 2020-11-24 14:39:13 +01:00
asus-wmi.h platform/x86: asus-wmi: Add support for SW_TABLET_MODE on UX360 2020-10-28 12:47:37 +01:00
classmate-laptop.c x86/platform: classmate-laptop: add WiFi media button 2020-12-08 11:18:03 +01:00
compal-laptop.c
eeepc-laptop.c platform/x86: eeepc-laptop: Drop duplicate check for led_classdev_unregister() 2020-05-07 19:39:32 +03:00
eeepc-wmi.c
fujitsu-laptop.c
fujitsu-tablet.c
gpd-pocket-fan.c platform/x86: GPD pocket fan: Fix error message when temp-limits are out of range 2020-03-20 14:44:47 +02:00
hdaps.c treewide: Remove uninitialized_var() usage 2020-07-16 12:35:15 -07:00
hp_accel.c
hp-wireless.c
hp-wmi.c platform/x86: hp-wmi: Disable tablet-mode reporting by default 2021-01-25 22:06:49 +01:00
huawei-wmi.c
i2c-multi-instantiate.c platform/x86: i2c-multi-instantiate: Don't create platform device for INT3515 ACPI nodes 2021-01-04 15:54:45 +01:00
ibm_rtl.c
ideapad-laptop.c platform/x86: ideapad-laptop: add "always on USB charging" control support 2021-02-04 10:21:43 +01:00
intel_atomisp2_led.c platform/x86: Add new intel_atomisp2_led driver 2020-07-09 22:47:27 +03:00
intel_atomisp2_pm.c platform/x86: intel_atomisp2_pm: Spelling fixes 2020-01-10 11:57:22 +02:00
intel_bxtwc_tmu.c
intel_cht_int33fe_common.c platform/x86: intel_cht_int33fe: Drop double check for ACPI companion device 2020-07-09 22:40:36 +03:00
intel_cht_int33fe_common.h
intel_cht_int33fe_microb.c
intel_cht_int33fe_typec.c platform/x86: intel_cht_int33fe: Fix spelling issues 2020-04-20 14:47:45 +03:00
intel_chtdc_ti_pwrbtn.c
intel_int0002_vgpio.c Additional power management updates for 5.7-rc1 2020-04-06 10:14:39 -07:00
intel_ips.c
intel_ips.h platform/x86: intel-ips: Use the correct style for SPDX License Identifier 2020-01-10 11:57:21 +02:00
intel_menlow.c platform/x86: intel_menlow: switch to use <linux/units.h> helpers 2020-01-31 10:30:40 -08:00
intel_mrfld_pwrbtn.c
intel_oaktrail.c
intel_pmc_core_pltdrv.c platform/x86: intel_pmc_core: do not create a static struct device 2020-09-24 14:05:21 +03:00
intel_pmc_core.c platform/x86: intel_pmc_core: Assign boolean values to a bool variable 2020-11-09 15:02:40 +01:00
intel_pmc_core.h platform/x86: intel_pmc_core: Fix the slp_s0 counter displayed value 2020-10-07 23:06:29 +02:00
intel_pmt_class.c platform/x86: pmt: Fix a potential Oops on error in probe 2020-11-24 12:43:40 +01:00
intel_pmt_class.h platform/x86: Intel PMT class driver 2020-11-04 11:14:12 +00:00
intel_pmt_crashlog.c platform/x86: Intel PMT Crashlog capability driver 2020-11-04 11:14:38 +00:00
intel_pmt_telemetry.c platform/x86: Intel PMT Telemetry capability driver 2020-11-04 11:14:27 +00:00
intel_punit_ipc.c
intel_scu_ipc.c platform/x86: intel_scu_ipc: Increase virtual timeout from 3 to 5 seconds 2021-02-11 16:49:10 +01:00
intel_scu_ipcutil.c platform/x86: intel_scu_ipcutil: Convert to use new SCU IPC API 2020-04-24 11:17:41 +01:00
intel_scu_pcidrv.c sfi: Remove framework for deprecated firmware 2021-02-15 20:09:46 +01:00
intel_scu_pltdrv.c platform/x86: Add Elkhart Lake SCU/PMC support 2020-05-05 20:26:16 +03:00
intel_scu_wdt.c platform/x86: intel_scu_wdt: Drop mistakenly added const 2021-02-05 12:54:27 +02:00
intel_telemetry_core.c platform/x86: intel_telemetry: Add telemetry_get_pltdata() 2020-04-24 11:18:30 +01:00
intel_telemetry_debugfs.c platform/x86: intel_pmc_ipc: Convert to MFD 2020-04-24 11:18:44 +01:00
intel_telemetry_pltdrv.c platform/x86: intel_pmc_ipc: Convert to MFD 2020-04-24 11:18:44 +01:00
intel_turbo_max_3.c platform/x86: Convert to new CPU match macros 2020-03-24 21:33:00 +01:00
intel-hid.c platform/x86: intel-hid: Support Lenovo ThinkPad X1 Tablet Gen 2 2021-03-06 10:24:53 +01:00
intel-rst.c
intel-smartconnect.c
intel-uncore-frequency.c platform/x86/intel-uncore-freq: Add Sapphire Rapids server support 2021-02-03 13:10:34 +01:00
intel-vbtn.c platform/x86: intel-vbtn: Eval VBDL after registering our notifier 2021-01-25 21:34:36 +01:00
intel-wmi-sbl-fw-update.c platform/x86: Add Slim Bootloader firmware update signaling driver 2020-05-05 20:27:44 +03:00
intel-wmi-thunderbolt.c
Kconfig ACPI: platform: Hide ACPI_PLATFORM_PROFILE option 2021-02-24 14:52:41 +01:00
lg-laptop.c platform/x86: lg-laptop: Drop duplicate check for led_classdev_unregister() 2020-05-07 20:14:17 +03:00
Makefile platform/x86: Move all dell drivers to their own subdirectory 2021-02-04 13:23:55 +01:00
mlx-platform.c platform/x86: mlx-platform: Fix item counter assignment for MSN2700/ComEx system 2020-12-08 11:14:49 +01:00
msi-laptop.c
msi-wmi.c platform/x86: msi-wmi: Fix variable 'status' set but not used compiler warning 2021-02-04 13:35:20 +01:00
mxm-wmi.c
panasonic-laptop.c platform/x86: panasonic-laptop: Add sysfs attributes for firmware brightness registers 2020-11-10 14:49:50 +01:00
pcengines-apuv2.c platform/x86: pcengines-apuv2: Fix typo on define of AMD_FCH_GPIO_REG_GPIO55_DEVSLP0 2020-09-24 14:04:53 +03:00
peaq-wmi.c
pmc_atom.c platform/x86: pmc_atom: Add Lex 2I385SW to critclk_systems DMI table 2020-02-10 17:47:38 +02:00
samsung-laptop.c platform/x86: samsung-laptop: Drop duplicate check for led_classdev_unregister() 2020-05-07 20:14:24 +03:00
samsung-q10.c
sony-laptop.c platform/x86: remove unneeded break 2020-10-28 12:32:06 +01:00
system76_acpi.c platform/x86: system76-acpi: Fix brightness_set schedule while atomic 2020-07-09 22:40:36 +03:00
tc1100-wmi.c
thinkpad_acpi.c platform/x86: thinkpad_acpi: Disable DYTC CQL mode around switching to balanced mode 2021-03-21 17:46:51 +01:00
topstar-laptop.c
toshiba_acpi.c platform/x86: toshiba_acpi: Fix the wrong variable assignment 2020-11-26 15:48:46 +01:00
toshiba_bluetooth.c
toshiba_haps.c
toshiba-wmi.c
touchscreen_dmi.c platform/x86: touchscreen_dmi: Add info for the Jumper EZpad 7 tablet 2021-02-03 12:03:05 +01:00
uv_sysfs.c x86/platform/uv: Add sysfs hubless leaves 2020-12-07 19:51:05 +01:00
wmi-bmof.c
wmi.c platform/x86: remove unneeded break 2020-10-28 12:32:06 +01:00
xiaomi-wmi.c platform/x86: wmi: Make two functions static 2020-04-17 16:47:26 +03:00
xo1-rfkill.c
xo15-ebook.c