stable.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH AUTOSEL 4.19 01/84] regulator: fix use after free issue
@ 2019-12-27 17:42 Sasha Levin
  2019-12-27 17:42 ` [PATCH AUTOSEL 4.19 02/84] ASoC: max98090: remove msleep in PLL unlocked workaround Sasha Levin
                   ` (78 more replies)
  0 siblings, 79 replies; 83+ messages in thread
From: Sasha Levin @ 2019-12-27 17:42 UTC (permalink / raw)
  To: linux-kernel, stable; +Cc: Wen Yang, Liam Girdwood, Mark Brown, Sasha Levin

From: Wen Yang <wenyang@linux.alibaba.com>

[ Upstream commit 4affd79a125ac91e6a53be843ea3960a8fc00cbb ]

This is caused by dereferencing 'rdev' after put_device() in
the _regulator_get()/_regulator_put() functions.
This patch just moves the put_device() down a bit to avoid the
issue.

Signed-off-by: Wen Yang <wenyang@linux.alibaba.com>
Cc: Liam Girdwood <lgirdwood@gmail.com>
Cc: Mark Brown <broonie@kernel.org>
Cc: linux-kernel@vger.kernel.org
Link: https://lore.kernel.org/r/20191124145835.25999-1-wenyang@linux.alibaba.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/regulator/core.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/regulator/core.c b/drivers/regulator/core.c
index f312764660e6..4bab758d14b1 100644
--- a/drivers/regulator/core.c
+++ b/drivers/regulator/core.c
@@ -1724,8 +1724,8 @@ struct regulator *_regulator_get(struct device *dev, const char *id,
 	regulator = create_regulator(rdev, dev, id);
 	if (regulator == NULL) {
 		regulator = ERR_PTR(-ENOMEM);
-		put_device(&rdev->dev);
 		module_put(rdev->owner);
+		put_device(&rdev->dev);
 		return regulator;
 	}
 
@@ -1851,13 +1851,13 @@ static void _regulator_put(struct regulator *regulator)
 
 	rdev->open_count--;
 	rdev->exclusive = 0;
-	put_device(&rdev->dev);
 	regulator_unlock(rdev);
 
 	kfree_const(regulator->supply_name);
 	kfree(regulator);
 
 	module_put(rdev->owner);
+	put_device(&rdev->dev);
 }
 
 /**
-- 
2.20.1


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

end of thread, other threads:[~2020-01-09 17:07 UTC | newest]

Thread overview: 83+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-12-27 17:42 [PATCH AUTOSEL 4.19 01/84] regulator: fix use after free issue Sasha Levin
2019-12-27 17:42 ` [PATCH AUTOSEL 4.19 02/84] ASoC: max98090: remove msleep in PLL unlocked workaround Sasha Levin
2019-12-27 17:42 ` [PATCH AUTOSEL 4.19 03/84] ASoC: max98090: exit workaround earlier if PLL is locked Sasha Levin
2019-12-27 17:42 ` [PATCH AUTOSEL 4.19 04/84] ASoC: max98090: fix possible race conditions Sasha Levin
2019-12-27 17:42 ` [PATCH AUTOSEL 4.19 05/84] mwifiex: fix possible heap overflow in mwifiex_process_country_ie() Sasha Levin
2019-12-27 17:42 ` [PATCH AUTOSEL 4.19 06/84] locking/spinlock/debug: Fix various data races Sasha Levin
2019-12-27 17:42 ` [PATCH AUTOSEL 4.19 07/84] netfilter: ctnetlink: netns exit must wait for callbacks Sasha Levin
2019-12-27 17:42 ` [PATCH AUTOSEL 4.19 08/84] mwifiex: Fix heap overflow in mmwifiex_process_tdls_action_frame() Sasha Levin
2019-12-27 17:42 ` [PATCH AUTOSEL 4.19 09/84] libtraceevent: Fix lib installation with O= Sasha Levin
2019-12-27 17:42 ` [PATCH AUTOSEL 4.19 10/84] x86/efi: Update e820 with reserved EFI boot services data to fix kexec breakage Sasha Levin
2019-12-27 17:42 ` [PATCH AUTOSEL 4.19 11/84] ASoC: Intel: bytcr_rt5640: Update quirk for Teclast X89 Sasha Levin
2019-12-27 17:42 ` [PATCH AUTOSEL 4.19 12/84] netfilter: nf_queue: enqueue skbs with NULL dst Sasha Levin
2019-12-27 17:42 ` [PATCH AUTOSEL 4.19 13/84] efi/gop: Return EFI_NOT_FOUND if there are no usable GOPs Sasha Levin
2019-12-27 17:42 ` [PATCH AUTOSEL 4.19 14/84] efi/gop: Return EFI_SUCCESS if a usable GOP was found Sasha Levin
2019-12-27 17:42 ` [PATCH AUTOSEL 4.19 15/84] efi/gop: Fix memory leak in __gop_query32/64() Sasha Levin
2019-12-27 17:42 ` [PATCH AUTOSEL 4.19 16/84] ARM: dts: imx6ul: imx6ul-14x14-evk.dtsi: Fix SPI NOR probing Sasha Levin
2019-12-27 17:42 ` [PATCH AUTOSEL 4.19 17/84] ARM: vexpress: Set-up shared OPP table instead of individual for each CPU Sasha Levin
2019-12-27 17:42 ` [PATCH AUTOSEL 4.19 18/84] netfilter: uapi: Avoid undefined left-shift in xt_sctp.h Sasha Levin
2019-12-27 17:42 ` [PATCH AUTOSEL 4.19 19/84] netfilter: nft_set_rbtree: bogus lookup/get on consecutive elements in named sets Sasha Levin
2019-12-27 17:42 ` [PATCH AUTOSEL 4.19 20/84] netfilter: nf_tables: validate NFT_SET_ELEM_INTERVAL_END Sasha Levin
2019-12-27 17:42 ` [PATCH AUTOSEL 4.19 21/84] netfilter: nf_tables: validate NFT_DATA_VALUE after nft_data_init() Sasha Levin
2019-12-27 17:42 ` [PATCH AUTOSEL 4.19 22/84] netfilter: bridge: make sure to pull arp header in br_nf_forward_arp() Sasha Levin
2019-12-27 17:42 ` [PATCH AUTOSEL 4.19 23/84] ARM: dts: BCM5301X: Fix MDIO node address/size cells Sasha Levin
2019-12-27 17:42 ` [PATCH AUTOSEL 4.19 24/84] selftests/ftrace: Fix multiple kprobe testcase Sasha Levin
2019-12-27 17:42 ` [PATCH AUTOSEL 4.19 25/84] ARM: dts: Cygnus: Fix MDIO node address/size cells Sasha Levin
2019-12-27 17:42 ` [PATCH AUTOSEL 4.19 26/84] selftests: forwarding: Delete IPv6 address at the end Sasha Levin
2019-12-27 17:42 ` [PATCH AUTOSEL 4.19 27/84] spi: spi-cavium-thunderx: Add missing pci_release_regions() Sasha Levin
2019-12-27 17:42 ` [PATCH AUTOSEL 4.19 28/84] af_packet: set defaule value for tmo Sasha Levin
2019-12-27 17:42 ` [PATCH AUTOSEL 4.19 29/84] fjes: fix missed check in fjes_acpi_add Sasha Levin
2019-12-27 17:42 ` [PATCH AUTOSEL 4.19 30/84] ASoC: topology: Check return value for soc_tplg_pcm_create() Sasha Levin
2019-12-27 17:42 ` [PATCH AUTOSEL 4.19 31/84] ARM: dts: bcm283x: Fix critical trip point Sasha Levin
2019-12-27 17:43 ` [PATCH AUTOSEL 4.19 32/84] bnxt_en: Return error if FW returns more data than dump length Sasha Levin
2019-12-27 17:43 ` [PATCH AUTOSEL 4.19 33/84] net: ena: fix napi handler misbehavior when the napi budget is zero Sasha Levin
2019-12-27 17:43 ` [PATCH AUTOSEL 4.19 34/84] bpf, mips: Limit to 33 tail calls Sasha Levin
2019-12-27 17:43 ` [PATCH AUTOSEL 4.19 35/84] spi: spi-ti-qspi: Fix a bug when accessing non default CS Sasha Levin
2019-12-27 17:43 ` [PATCH AUTOSEL 4.19 36/84] ARM: dts: am437x-gp/epos-evm: fix panel compatible Sasha Levin
2019-12-27 17:43 ` [PATCH AUTOSEL 4.19 37/84] samples: bpf: Replace symbol compare of trace_event Sasha Levin
2019-12-27 17:43 ` [PATCH AUTOSEL 4.19 38/84] samples: bpf: fix syscall_tp due to unused syscall Sasha Levin
2019-12-27 17:43 ` [PATCH AUTOSEL 4.19 39/84] tty: serial: msm_serial: Fix lockup for sysrq and oops Sasha Levin
2019-12-27 17:43 ` [PATCH AUTOSEL 4.19 40/84] net: usb: lan78xx: Fix suspend/resume PHY register access error Sasha Levin
2019-12-27 17:43 ` [PATCH AUTOSEL 4.19 41/84] qede: Fix multicast mac configuration Sasha Levin
2019-12-27 17:43 ` [PATCH AUTOSEL 4.19 42/84] powerpc: Ensure that swiotlb buffer is allocated from low memory Sasha Levin
2019-12-27 17:43 ` [PATCH AUTOSEL 4.19 43/84] btrfs: Fix error messages in qgroup_rescan_init Sasha Levin
2019-12-27 17:43 ` [PATCH AUTOSEL 4.19 44/84] ARM: shmobile: defconfig: Restore debugfs support Sasha Levin
2019-12-27 17:43 ` [PATCH AUTOSEL 4.19 45/84] bpf: Clear skb->tstamp in bpf_redirect when necessary Sasha Levin
2019-12-27 17:43 ` [PATCH AUTOSEL 4.19 46/84] tcp/dccp: fix possible race __inet_lookup_established() Sasha Levin
2020-01-02  8:01   ` Naresh Kamboju
2020-01-09 15:32     ` Sasha Levin
2020-01-09 17:07       ` Michal Kubecek
2019-12-27 17:43 ` [PATCH AUTOSEL 4.19 47/84] 6pack,mkiss: fix possible deadlock Sasha Levin
2019-12-27 17:43 ` [PATCH AUTOSEL 4.19 48/84] net: marvell: mvpp2: phylink requires the link interrupt Sasha Levin
2019-12-27 17:43 ` [PATCH AUTOSEL 4.19 49/84] bnx2x: Do not handle requests from VFs after parity Sasha Levin
2019-12-27 17:43 ` [PATCH AUTOSEL 4.19 50/84] bnx2x: Fix logic to get total no. of PFs per engine Sasha Levin
2019-12-27 17:43 ` [PATCH AUTOSEL 4.19 51/84] bonding: fix active-backup transition after link failure Sasha Levin
2019-12-27 17:43 ` [PATCH AUTOSEL 4.19 52/84] gtp: do not allow adding duplicate tid and ms_addr pdp context Sasha Levin
2019-12-27 17:43 ` [PATCH AUTOSEL 4.19 53/84] gtp: fix wrong condition in gtp_genl_dump_pdp() Sasha Levin
2019-12-27 17:43 ` [PATCH AUTOSEL 4.19 54/84] gtp: avoid zero size hashtable Sasha Levin
2019-12-27 17:43 ` [PATCH AUTOSEL 4.19 55/84] cxgb4: Fix kernel panic while accessing sge_info Sasha Levin
2019-12-27 17:43 ` [PATCH AUTOSEL 4.19 56/84] net: usb: lan78xx: Fix error message format specifier Sasha Levin
2019-12-27 17:43 ` [PATCH AUTOSEL 4.19 57/84] parisc: add missing __init annotation Sasha Levin
2019-12-27 17:43 ` [PATCH AUTOSEL 4.19 58/84] rfkill: Fix incorrect check to avoid NULL pointer dereference Sasha Levin
2019-12-27 17:43 ` [PATCH AUTOSEL 4.19 59/84] ASoC: wm8962: fix lambda value Sasha Levin
2019-12-27 17:43 ` [PATCH AUTOSEL 4.19 60/84] regulator: rn5t618: fix module aliases Sasha Levin
2019-12-27 17:43 ` [PATCH AUTOSEL 4.19 61/84] net: gemini: Fix memory leak in gmac_setup_txqs Sasha Levin
2019-12-27 17:43 ` [PATCH AUTOSEL 4.19 62/84] iommu/iova: Init the struct iova to fix the possible memleak Sasha Levin
2019-12-27 17:43 ` [PATCH AUTOSEL 4.19 63/84] kconfig: don't crash on NULL expressions in expr_eq() Sasha Levin
2019-12-27 17:43 ` [PATCH AUTOSEL 4.19 64/84] perf/x86/intel/bts: Fix the use of page_private() Sasha Levin
2019-12-27 17:43 ` [PATCH AUTOSEL 4.19 65/84] perf/x86/intel: Fix PT PMI handling Sasha Levin
2019-12-27 17:43 ` [PATCH AUTOSEL 4.19 66/84] fs: avoid softlockups in s_inodes iterators Sasha Levin
2019-12-27 17:43 ` [PATCH AUTOSEL 4.19 67/84] net: qlogic: Fix error paths in ql_alloc_large_buffers() Sasha Levin
2019-12-27 17:43 ` [PATCH AUTOSEL 4.19 68/84] net: nfc: nci: fix a possible sleep-in-atomic-context bug in nci_uart_tty_receive() Sasha Levin
2019-12-27 17:43 ` [PATCH AUTOSEL 4.19 69/84] net: stmmac: Do not accept invalid MTU values Sasha Levin
2019-12-27 17:43 ` [PATCH AUTOSEL 4.19 70/84] net: stmmac: xgmac: Clear previous RX buffer size Sasha Levin
2019-12-27 17:43 ` [PATCH AUTOSEL 4.19 71/84] net: stmmac: RX buffer size must be 16 byte aligned Sasha Levin
2019-12-27 17:43 ` [PATCH AUTOSEL 4.19 72/84] net: stmmac: Always arm TX Timer at end of transmission start Sasha Levin
2019-12-27 17:43 ` [PATCH AUTOSEL 4.19 73/84] s390/purgatory: do not build purgatory with kcov, kasan and friends Sasha Levin
2019-12-27 17:43 ` [PATCH AUTOSEL 4.19 74/84] drm/exynos: gsc: add missed component_del Sasha Levin
2019-12-27 17:43 ` [PATCH AUTOSEL 4.19 75/84] net, sysctl: Fix compiler warning when only cBPF is present Sasha Levin
2019-12-27 17:43 ` [PATCH AUTOSEL 4.19 76/84] s390/dasd/cio: Interpret ccw_device_get_mdc return value correctly Sasha Levin
2019-12-27 17:43 ` [PATCH AUTOSEL 4.19 77/84] s390/dasd: fix memleak in path handling error case Sasha Levin
2019-12-27 17:43 ` [PATCH AUTOSEL 4.19 78/84] block: fix memleak when __blk_rq_map_user_iov() is failed Sasha Levin
2019-12-27 17:43 ` [PATCH AUTOSEL 4.19 79/84] parisc: Fix compiler warnings in debug_core.c Sasha Levin
2019-12-27 17:43 ` [PATCH AUTOSEL 4.19 80/84] net: hisilicon: Fix a BUG trigered by wrong bytes_compl Sasha Levin

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).