linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: linux-kernel@vger.kernel.org
Cc: "Greg Kroah-Hartman" <gregkh@linuxfoundation.org>,
	stable@vger.kernel.org, "Ronald Tschalär" <ronald@innovation.ch>,
	"Rafael J. Wysocki" <rafael.j.wysocki@intel.com>,
	"Sasha Levin" <sashal@kernel.org>
Subject: [PATCH 4.14 085/122] ACPI / SBS: Fix rare oops when removing modules
Date: Fri, 22 Nov 2019 11:28:58 +0100	[thread overview]
Message-ID: <20191122100824.823949891@linuxfoundation.org> (raw)
In-Reply-To: <20191122100722.177052205@linuxfoundation.org>

From: Ronald Tschalär <ronald@innovation.ch>

[ Upstream commit 757c968c442397f1249bb775a7c8c03842e3e0c7 ]

There was a small race when removing the sbshc module where
smbus_alarm() had queued acpi_smbus_callback() for deferred execution
but it hadn't been run yet, so that when it did run hc had been freed
and the module unloaded, resulting in an invalid paging request.

A similar race existed when removing the sbs module with regards to
acpi_sbs_callback() (which is called from acpi_smbus_callback()).

We therefore need to ensure no callbacks are pending or executing before
the cleanups are done and the modules are removed.

Signed-off-by: Ronald Tschalär <ronald@innovation.ch>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/acpi/osl.c   | 1 +
 drivers/acpi/sbshc.c | 2 ++
 2 files changed, 3 insertions(+)

diff --git a/drivers/acpi/osl.c b/drivers/acpi/osl.c
index 191e86c62037a..9da7e7d874bd8 100644
--- a/drivers/acpi/osl.c
+++ b/drivers/acpi/osl.c
@@ -1116,6 +1116,7 @@ void acpi_os_wait_events_complete(void)
 	flush_workqueue(kacpid_wq);
 	flush_workqueue(kacpi_notify_wq);
 }
+EXPORT_SYMBOL(acpi_os_wait_events_complete);
 
 struct acpi_hp_work {
 	struct work_struct work;
diff --git a/drivers/acpi/sbshc.c b/drivers/acpi/sbshc.c
index 7a3431018e0ab..5008ead4609a4 100644
--- a/drivers/acpi/sbshc.c
+++ b/drivers/acpi/sbshc.c
@@ -196,6 +196,7 @@ int acpi_smbus_unregister_callback(struct acpi_smb_hc *hc)
 	hc->callback = NULL;
 	hc->context = NULL;
 	mutex_unlock(&hc->lock);
+	acpi_os_wait_events_complete();
 	return 0;
 }
 
@@ -292,6 +293,7 @@ static int acpi_smbus_hc_remove(struct acpi_device *device)
 
 	hc = acpi_driver_data(device);
 	acpi_ec_remove_query_handler(hc->ec, hc->query_bit);
+	acpi_os_wait_events_complete();
 	kfree(hc);
 	device->driver_data = NULL;
 	return 0;
-- 
2.20.1




  parent reply	other threads:[~2019-11-22 11:14 UTC|newest]

Thread overview: 126+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-11-22 10:27 [PATCH 4.14 000/122] 4.14.156-stable review Greg Kroah-Hartman
2019-11-22 10:27 ` [PATCH 4.14 001/122] spi: mediatek: use correct mata->xfer_len when in fifo transfer Greg Kroah-Hartman
2019-11-22 10:27 ` [PATCH 4.14 002/122] tee: optee: add missing of_node_put after of_device_is_available Greg Kroah-Hartman
2019-11-22 10:27 ` [PATCH 4.14 003/122] Revert "OPP: Protect dev_list with opp_table lock" Greg Kroah-Hartman
2019-11-22 10:27 ` [PATCH 4.14 004/122] net: cdc_ncm: Signedness bug in cdc_ncm_set_dgram_size() Greg Kroah-Hartman
2019-11-22 10:27 ` [PATCH 4.14 005/122] idr: Fix idr_get_next race with idr_remove Greg Kroah-Hartman
2019-11-22 10:27 ` [PATCH 4.14 007/122] mm/memory_hotplug: fix updating the node span Greg Kroah-Hartman
2019-11-22 10:27 ` [PATCH 4.14 008/122] arm64: uaccess: Ensure PAN is re-enabled after unhandled uaccess fault Greg Kroah-Hartman
2019-11-22 10:27 ` [PATCH 4.14 009/122] fbdev: Ditch fb_edid_add_monspecs Greg Kroah-Hartman
2019-11-22 10:27 ` [PATCH 4.14 010/122] net: ovs: fix return type of ndo_start_xmit function Greg Kroah-Hartman
2019-11-22 10:27 ` [PATCH 4.14 011/122] net: xen-netback: " Greg Kroah-Hartman
2019-11-22 10:27 ` [PATCH 4.14 012/122] ARM: dts: dra7: Enable workaround for errata i870 in PCIe host mode Greg Kroah-Hartman
2019-11-22 10:27 ` [PATCH 4.14 013/122] ARM: dts: omap5: enable OTG role for DWC3 controller Greg Kroah-Hartman
2019-11-22 10:27 ` [PATCH 4.14 014/122] net: hns3: Fix for netdev not up problem when setting mtu Greg Kroah-Hartman
2019-11-22 10:27 ` [PATCH 4.14 015/122] f2fs: return correct errno in f2fs_gc Greg Kroah-Hartman
2019-11-22 10:27 ` [PATCH 4.14 016/122] ARM: dts: sun8i: h3-h5: ir register size should be the whole memory block Greg Kroah-Hartman
2019-11-22 10:27 ` [PATCH 4.14 017/122] SUNRPC: Fix priority queue fairness Greg Kroah-Hartman
2019-11-22 10:27 ` [PATCH 4.14 018/122] IB/hfi1: Ensure ucast_dlid access doesnt exceed bounds Greg Kroah-Hartman
2019-11-22 10:27 ` [PATCH 4.14 019/122] iommu/io-pgtable-arm: Fix race handling in split_blk_unmap() Greg Kroah-Hartman
2019-11-22 10:27 ` [PATCH 4.14 020/122] kvm: arm/arm64: Fix stage2_flush_memslot for 4 level page table Greg Kroah-Hartman
2019-11-22 10:27 ` [PATCH 4.14 021/122] arm64/numa: Report correct memblock range for the dummy node Greg Kroah-Hartman
2019-11-22 10:27 ` [PATCH 4.14 022/122] ath10k: fix vdev-start timeout on error Greg Kroah-Hartman
2019-11-22 10:27 ` [PATCH 4.14 023/122] ata: ahci_brcm: Allow using driver or DSL SoCs Greg Kroah-Hartman
2019-11-22 10:27 ` [PATCH 4.14 024/122] ath9k: fix reporting calculated new FFT upper max Greg Kroah-Hartman
2019-11-22 10:27 ` [PATCH 4.14 025/122] usb: gadget: udc: fotg210-udc: Fix a sleep-in-atomic-context bug in fotg210_get_status() Greg Kroah-Hartman
2019-11-22 10:27 ` [PATCH 4.14 026/122] usb: dwc3: gadget: Check ENBLSLPM before sending ep command Greg Kroah-Hartman
2019-11-22 10:28 ` [PATCH 4.14 027/122] nl80211: Fix a GET_KEY reply attribute Greg Kroah-Hartman
2019-11-22 10:28 ` [PATCH 4.14 028/122] irqchip/irq-mvebu-icu: Fix wrong private data retrieval Greg Kroah-Hartman
2019-11-22 10:28 ` [PATCH 4.14 029/122] watchdog: w83627hf_wdt: Support NCT6796D, NCT6797D, NCT6798D Greg Kroah-Hartman
2019-11-22 10:28 ` [PATCH 4.14 030/122] KVM: PPC: Inform the userspace about TCE update failures Greg Kroah-Hartman
2019-11-22 10:28 ` [PATCH 4.14 031/122] dmaengine: ep93xx: Return proper enum in ep93xx_dma_chan_direction Greg Kroah-Hartman
2019-11-22 10:28 ` [PATCH 4.14 032/122] dmaengine: timb_dma: Use proper enum in td_prep_slave_sg Greg Kroah-Hartman
2019-11-22 10:28 ` [PATCH 4.14 033/122] ext4: fix build error when DX_DEBUG is defined Greg Kroah-Hartman
2019-11-22 10:28 ` [PATCH 4.14 034/122] clk: keystone: Enable TISCI clocks if K3_ARCH Greg Kroah-Hartman
2019-11-22 10:28 ` [PATCH 4.14 035/122] sunrpc: Fix connect metrics Greg Kroah-Hartman
2019-11-22 10:28 ` [PATCH 4.14 036/122] mei: samples: fix a signedness bug in amt_host_if_call() Greg Kroah-Hartman
2019-11-22 10:28 ` [PATCH 4.14 037/122] cxgb4: Use proper enum in cxgb4_dcb_handle_fw_update Greg Kroah-Hartman
2019-11-22 10:28 ` [PATCH 4.14 038/122] cxgb4: Use proper enum in IEEE_FAUX_SYNC Greg Kroah-Hartman
2019-11-22 10:28 ` [PATCH 4.14 039/122] powerpc/pseries: Fix DTL buffer registration Greg Kroah-Hartman
2019-11-22 10:28 ` [PATCH 4.14 040/122] powerpc/pseries: Fix how we iterate over the DTL entries Greg Kroah-Hartman
2019-11-22 10:28 ` [PATCH 4.14 041/122] powerpc/xive: Move a dereference below a NULL test Greg Kroah-Hartman
2019-11-22 10:28 ` [PATCH 4.14 042/122] ARM: dts: at91: sama5d4_xplained: fix addressable nand flash size Greg Kroah-Hartman
2019-11-22 10:28 ` [PATCH 4.14 043/122] ARM: dts: at91: at91sam9x5cm: " Greg Kroah-Hartman
2019-11-22 10:28 ` [PATCH 4.14 044/122] mtd: rawnand: sh_flctl: Use proper enum for flctl_dma_fifo0_transfer Greg Kroah-Hartman
2019-11-22 10:28 ` [PATCH 4.14 045/122] PM / hibernate: Check the success of generating md5 digest before hibernation Greg Kroah-Hartman
2019-11-22 10:28 ` [PATCH 4.14 046/122] tools: PCI: Fix compilation warnings Greg Kroah-Hartman
2019-11-22 10:28 ` [PATCH 4.14 047/122] clocksource/drivers/sh_cmt: Fixup for 64-bit machines Greg Kroah-Hartman
2019-11-22 10:28 ` [PATCH 4.14 048/122] clocksource/drivers/sh_cmt: Fix clocksource width for 32-bit machines Greg Kroah-Hartman
2019-11-22 10:28 ` [PATCH 4.14 049/122] md: allow metadata updates while suspending an array - fix Greg Kroah-Hartman
2019-11-22 10:28 ` [PATCH 4.14 050/122] ixgbe: Fix ixgbe TX hangs with XDP_TX beyond queue limit Greg Kroah-Hartman
2019-11-22 10:28 ` [PATCH 4.14 051/122] i40e: Use proper enum in i40e_ndo_set_vf_link_state Greg Kroah-Hartman
2019-11-22 10:28 ` [PATCH 4.14 052/122] ixgbe: Fix crash with VFs and flow director on interface flap Greg Kroah-Hartman
2019-11-22 10:28 ` [PATCH 4.14 053/122] IB/mthca: Fix error return code in __mthca_init_one() Greg Kroah-Hartman
2019-11-22 10:28 ` [PATCH 4.14 054/122] IB/mlx4: Avoid implicit enumerated type conversion Greg Kroah-Hartman
2019-11-22 10:28 ` [PATCH 4.14 055/122] ACPICA: Never run _REG on system_memory and system_IO Greg Kroah-Hartman
2019-11-22 10:28 ` [PATCH 4.14 056/122] powerpc/time: Use clockevents_register_device(), fixing an issue with large decrementer Greg Kroah-Hartman
2019-11-22 10:28 ` [PATCH 4.14 057/122] ata: ep93xx: Use proper enums for directions Greg Kroah-Hartman
2019-11-22 10:28 ` [PATCH 4.14 058/122] media: rc: ir-rc6-decoder: enable toggle bit for Kathrein RCU-676 remote Greg Kroah-Hartman
2019-11-22 10:28 ` [PATCH 4.14 059/122] media: pxa_camera: Fix check for pdev->dev.of_node Greg Kroah-Hartman
2019-11-22 10:28 ` [PATCH 4.14 060/122] media: i2c: adv748x: Support probing a single output Greg Kroah-Hartman
2019-11-22 10:28 ` [PATCH 4.14 061/122] ALSA: hda/sigmatel - Disable automute for Elo VuPoint Greg Kroah-Hartman
2019-11-22 10:28 ` [PATCH 4.14 062/122] KVM: PPC: Book3S PR: Exiting split hack mode needs to fixup both PC and LR Greg Kroah-Hartman
2019-11-22 10:28 ` [PATCH 4.14 063/122] USB: serial: cypress_m8: fix interrupt-out transfer length Greg Kroah-Hartman
2019-11-22 10:28 ` [PATCH 4.14 064/122] mtd: physmap_of: Release resources on error Greg Kroah-Hartman
2019-11-22 10:28 ` [PATCH 4.14 065/122] cpu/SMT: State SMT is disabled even with nosmt and without "=force" Greg Kroah-Hartman
2019-11-22 10:28 ` [PATCH 4.14 066/122] brcmfmac: reduce timeout for action frame scan Greg Kroah-Hartman
2019-11-22 10:28 ` [PATCH 4.14 067/122] brcmfmac: fix full timeout waiting for action frame on-channel tx Greg Kroah-Hartman
2019-11-22 10:28 ` [PATCH 4.14 068/122] qtnfmac: pass sgi rate info flag to wireless core Greg Kroah-Hartman
2019-11-22 10:28 ` [PATCH 4.14 069/122] qtnfmac: drop error reports for out-of-bounds key indexes Greg Kroah-Hartman
2019-11-22 10:28 ` [PATCH 4.14 070/122] clk: samsung: exynos5420: Define CLK_SECKEY gate clock only or Exynos5420 Greg Kroah-Hartman
2019-11-22 10:28 ` [PATCH 4.14 071/122] clk: samsung: Use clk_hw API for calling clk framework from clk notifiers Greg Kroah-Hartman
2019-11-22 10:28 ` [PATCH 4.14 072/122] i2c: brcmstb: Allow enabling the driver on DSL SoCs Greg Kroah-Hartman
2019-11-22 10:28 ` [PATCH 4.14 073/122] NFSv4.x: fix lock recovery during delegation recall Greg Kroah-Hartman
2019-11-22 10:28 ` [PATCH 4.14 074/122] dmaengine: ioat: fix prototype of ioat_enumerate_channels Greg Kroah-Hartman
2019-11-22 10:28 ` [PATCH 4.14 075/122] media: cec-gpio: select correct Signal Free Time Greg Kroah-Hartman
2019-11-22 10:28 ` [PATCH 4.14 076/122] Input: st1232 - set INPUT_PROP_DIRECT property Greg Kroah-Hartman
2019-11-22 10:28 ` [PATCH 4.14 077/122] Input: silead - try firmware reload after unsuccessful resume Greg Kroah-Hartman
2019-11-22 10:28 ` [PATCH 4.14 078/122] remoteproc: Check for NULL firmwares in sysfs interface Greg Kroah-Hartman
2019-11-22 10:28 ` [PATCH 4.14 079/122] kexec: Allocate decrypted control pages for kdump if SME is enabled Greg Kroah-Hartman
2019-11-22 10:28 ` [PATCH 4.14 080/122] x86/olpc: Fix build error with CONFIG_MFD_CS5535=m Greg Kroah-Hartman
2019-11-22 10:28 ` [PATCH 4.14 081/122] dmaengine: rcar-dmac: set scatter/gather max segment size Greg Kroah-Hartman
2019-11-22 10:28 ` [PATCH 4.14 082/122] crypto: mxs-dcp - Fix SHA null hashes and output length Greg Kroah-Hartman
2019-11-22 10:28 ` [PATCH 4.14 083/122] crypto: mxs-dcp - Fix AES issues Greg Kroah-Hartman
2019-11-22 10:28 ` [PATCH 4.14 084/122] xfrm: use correct size to initialise sp->ovec Greg Kroah-Hartman
2019-11-22 10:28 ` Greg Kroah-Hartman [this message]
2019-11-22 10:28 ` [PATCH 4.14 086/122] iwlwifi: mvm: dont send keys when entering D3 Greg Kroah-Hartman
2019-11-22 10:29 ` [PATCH 4.14 087/122] x86/fsgsbase/64: Fix ptrace() to read the FS/GS base accurately Greg Kroah-Hartman
2019-11-22 10:29 ` [PATCH 4.14 088/122] mmc: tmio: Fix SCC error detection Greg Kroah-Hartman
2019-11-22 10:29 ` [PATCH 4.14 089/122] fbdev: sbuslib: use checked version of put_user() Greg Kroah-Hartman
2019-11-22 10:29 ` [PATCH 4.14 090/122] fbdev: sbuslib: integer overflow in sbusfb_ioctl_helper() Greg Kroah-Hartman
2019-11-22 10:29 ` [PATCH 4.14 091/122] reset: Fix potential use-after-free in __of_reset_control_get() Greg Kroah-Hartman
2019-11-22 10:29 ` [PATCH 4.14 092/122] bcache: recal cached_dev_sectors on detach Greg Kroah-Hartman
2019-11-22 10:29 ` [PATCH 4.14 093/122] media: dw9714: Fix error handling in probe function Greg Kroah-Hartman
2019-11-22 10:29 ` [PATCH 4.14 094/122] s390/kasan: avoid vdso instrumentation Greg Kroah-Hartman
2019-11-22 10:29 ` [PATCH 4.14 095/122] proc/vmcore: Fix i386 build error of missing copy_oldmem_page_encrypted() Greg Kroah-Hartman
2019-11-22 10:29 ` [PATCH 4.14 096/122] backlight: lm3639: Unconditionally call led_classdev_unregister Greg Kroah-Hartman
2019-11-22 10:29 ` [PATCH 4.14 097/122] mfd: ti_am335x_tscadc: Keep ADC interface on if child is wakeup capable Greg Kroah-Hartman
2019-11-22 10:29 ` [PATCH 4.14 098/122] printk: Give error on attempt to set log buffer length to over 2G Greg Kroah-Hartman
2019-11-22 10:29 ` [PATCH 4.14 099/122] media: isif: fix a NULL pointer dereference bug Greg Kroah-Hartman
2019-11-22 10:29 ` [PATCH 4.14 100/122] GFS2: Flush the GFS2 delete workqueue before stopping the kernel threads Greg Kroah-Hartman
2019-11-22 10:29 ` [PATCH 4.14 101/122] media: cx231xx: fix potential sign-extension overflow on large shift Greg Kroah-Hartman
2019-11-22 10:29 ` [PATCH 4.14 102/122] x86/kexec: Correct KEXEC_BACKUP_SRC_END off-by-one error Greg Kroah-Hartman
2019-11-22 10:29 ` [PATCH 4.14 103/122] gpio: syscon: Fix possible NULL ptr usage Greg Kroah-Hartman
2019-11-22 10:29 ` [PATCH 4.14 104/122] spi: fsl-lpspi: Prevent FIFO under/overrun by default Greg Kroah-Hartman
2019-11-22 10:29 ` [PATCH 4.14 105/122] pinctrl: gemini: Mask and set properly Greg Kroah-Hartman
2019-11-22 10:29 ` [PATCH 4.14 106/122] spi: spidev: Fix OF tree warning logic Greg Kroah-Hartman
2019-11-22 10:29 ` [PATCH 4.14 107/122] ARM: 8802/1: Call syscall_trace_exit even when system call skipped Greg Kroah-Hartman
2019-11-22 10:29 ` [PATCH 4.14 108/122] orangefs: rate limit the client not running info message Greg Kroah-Hartman
2019-11-22 10:29 ` [PATCH 4.14 109/122] pinctrl: gemini: Fix up TVC clock group Greg Kroah-Hartman
2019-11-22 10:29 ` [PATCH 4.14 110/122] hwmon: (pwm-fan) Silence error on probe deferral Greg Kroah-Hartman
2019-11-22 10:29 ` [PATCH 4.14 111/122] hwmon: (ina3221) Fix INA3221_CONFIG_MODE macros Greg Kroah-Hartman
2019-11-22 10:29 ` [PATCH 4.14 112/122] netfilter: nft_compat: do not dump private area Greg Kroah-Hartman
2019-11-22 10:29 ` [PATCH 4.14 113/122] misc: cxl: Fix possible null pointer dereference Greg Kroah-Hartman
2019-11-22 10:29 ` [PATCH 4.14 114/122] mac80211: minstrel: fix using short preamble CCK rates on HT clients Greg Kroah-Hartman
2019-11-22 10:29 ` [PATCH 4.14 115/122] mac80211: minstrel: fix CCK rate group streams value Greg Kroah-Hartman
2019-11-22 10:29 ` [PATCH 4.14 116/122] mac80211: minstrel: fix sampling/reporting of CCK rates in HT mode Greg Kroah-Hartman
2019-11-22 10:29 ` [PATCH 4.14 117/122] spi: rockchip: initialize dma_slave_config properly Greg Kroah-Hartman
2019-11-22 10:29 ` [PATCH 4.14 118/122] mlxsw: spectrum_switchdev: Check notification relevance based on upper device Greg Kroah-Hartman
2019-11-22 10:29 ` [PATCH 4.14 119/122] ARM: dts: omap5: Fix dual-role mode on Super-Speed port Greg Kroah-Hartman
2019-11-22 10:29 ` [PATCH 4.14 120/122] tools: PCI: Fix broken pcitest compilation Greg Kroah-Hartman
2019-11-22 10:29 ` [PATCH 4.14 121/122] powerpc/time: Fix clockevent_decrementer initalisation for PR KVM Greg Kroah-Hartman
2019-11-22 10:29 ` [PATCH 4.14 122/122] mmc: tmio: fix SCC error handling to avoid false positive CRC error Greg Kroah-Hartman
2019-11-22 13:38 ` [PATCH 4.14 000/122] 4.14.156-stable review Jon Hunter
2019-11-22 18:12 ` Guenter Roeck
2019-11-22 20:30 ` shuah
2019-11-22 23:50 ` Daniel Díaz

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20191122100824.823949891@linuxfoundation.org \
    --to=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rafael.j.wysocki@intel.com \
    --cc=ronald@innovation.ch \
    --cc=sashal@kernel.org \
    --cc=stable@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).