public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH AUTOSEL 4.4 01/14] iio: adc: xilinx: fix potential use-after-free on remove
@ 2019-05-07  5:42 Sasha Levin
  2019-05-07  5:42 ` [PATCH AUTOSEL 4.4 02/14] HID: input: add mapping for Expose/Overview key Sasha Levin
                   ` (12 more replies)
  0 siblings, 13 replies; 14+ messages in thread
From: Sasha Levin @ 2019-05-07  5:42 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: Sven Van Asbroeck, Sven Van Asbroeck, Jonathan Cameron,
	Sasha Levin, linux-iio

From: Sven Van Asbroeck <thesven73@gmail.com>

[ Upstream commit 62039b6aef63380ba7a37c113bbaeee8a55c5342 ]

When cancel_delayed_work() returns, the delayed work may still
be running. This means that the core could potentially free
the private structure (struct xadc) while the delayed work
is still using it. This is a potential use-after-free.

Fix by calling cancel_delayed_work_sync(), which waits for
any residual work to finish before returning.

Signed-off-by: Sven Van Asbroeck <TheSven73@gmail.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/iio/adc/xilinx-xadc-core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/iio/adc/xilinx-xadc-core.c b/drivers/iio/adc/xilinx-xadc-core.c
index 475c5a74f2d1..6398e86a272b 100644
--- a/drivers/iio/adc/xilinx-xadc-core.c
+++ b/drivers/iio/adc/xilinx-xadc-core.c
@@ -1299,7 +1299,7 @@ static int xadc_remove(struct platform_device *pdev)
 	}
 	free_irq(irq, indio_dev);
 	clk_disable_unprepare(xadc->clk);
-	cancel_delayed_work(&xadc->zynq_unmask_work);
+	cancel_delayed_work_sync(&xadc->zynq_unmask_work);
 	kfree(xadc->data);
 	kfree(indio_dev->channels);
 
-- 
2.20.1


^ permalink raw reply related	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2019-05-07  5:44 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-05-07  5:42 [PATCH AUTOSEL 4.4 01/14] iio: adc: xilinx: fix potential use-after-free on remove Sasha Levin
2019-05-07  5:42 ` [PATCH AUTOSEL 4.4 02/14] HID: input: add mapping for Expose/Overview key Sasha Levin
2019-05-07  5:42 ` [PATCH AUTOSEL 4.4 03/14] HID: input: add mapping for keyboard Brightness Up/Down/Toggle keys Sasha Levin
2019-05-07  5:42 ` [PATCH AUTOSEL 4.4 04/14] libnvdimm/btt: Fix a kmemdup failure check Sasha Levin
2019-05-07  5:42 ` [PATCH AUTOSEL 4.4 05/14] s390/dasd: Fix capacity calculation for large volumes Sasha Levin
2019-05-07  5:42 ` [PATCH AUTOSEL 4.4 06/14] Input: snvs_pwrkey - initialize necessary driver data before enabling IRQ Sasha Levin
2019-05-07  5:42 ` [PATCH AUTOSEL 4.4 07/14] s390/3270: fix lockdep false positive on view->lock Sasha Levin
2019-05-07  5:42 ` [PATCH AUTOSEL 4.4 08/14] KVM: x86: avoid misreporting level-triggered irqs as edge-triggered in tracing Sasha Levin
2019-05-07  5:42 ` [PATCH AUTOSEL 4.4 09/14] tools lib traceevent: Fix missing equality check for strcmp Sasha Levin
2019-05-07  5:42 ` [PATCH AUTOSEL 4.4 10/14] init: initialize jump labels before command line option parsing Sasha Levin
2019-05-07  5:42 ` [PATCH AUTOSEL 4.4 11/14] ipvs: do not schedule icmp errors from tunnels Sasha Levin
2019-05-07  5:42 ` [PATCH AUTOSEL 4.4 12/14] s390: ctcm: fix ctcm_new_device error return code Sasha Levin
2019-05-07  5:42 ` [PATCH AUTOSEL 4.4 13/14] selftests/net: correct the return value for run_netsocktests Sasha Levin
2019-05-07  5:42 ` [PATCH AUTOSEL 4.4 14/14] gpu: ipu-v3: dp: fix CSC handling Sasha Levin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox