acrn-kernel/drivers
Zheng Wang 47b2e1a67e power: supply: da9150: Fix use after free bug in da9150_charger_remove due to race condition
[ Upstream commit 06615d11cc ]

In da9150_charger_probe, &charger->otg_work is bound with
da9150_charger_otg_work. da9150_charger_otg_ncb may be
called to start the work.

If we remove the module which will call da9150_charger_remove
to make cleanup, there may be a unfinished work. The possible
sequence is as follows:

Fix it by canceling the work before cleanup in the da9150_charger_remove

CPU0                  CPUc1

                    |da9150_charger_otg_work
da9150_charger_remove      |
power_supply_unregister  |
device_unregister   |
power_supply_dev_release|
kfree(psy)          |
                    |
                    | 	power_supply_changed(charger->usb);
                    |   //use

Fixes: c1a281e34d ("power: Add support for DA9150 Charger")
Signed-off-by: Zheng Wang <zyytlz.wz@163.com>
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2023-03-30 12:49:01 +02:00
..
accessibility
acpi ACPI: PPTT: Fix to avoid sleep in the atomic context when PPTT is absent 2023-03-22 13:34:04 +01:00
amba
android
ata ata: ahci: Revert "ata: ahci: Add Tiger Lake UP{3,4} AHCI controller" 2023-03-10 09:32:32 +01:00
atm
auxdisplay auxdisplay: hd44780: Fix potential memory leak in hd44780_remove() 2023-03-11 13:55:16 +01:00
base drivers: base: dd: fix memory leak with using debugfs_lookup() 2023-03-11 13:55:39 +01:00
bcma
block block: sunvdc: add check for mdesc_grab() returning NULL 2023-03-22 13:33:47 +01:00
bluetooth Bluetooth: btusb: Add VID:PID 13d3:3529 for Realtek RTL8821CE 2023-03-10 09:33:53 +01:00
bus bus: mhi: ep: Change state_lock to mutex 2023-03-17 08:50:19 +01:00
cdrom
char tpm/eventlog: Don't abort tpm_read_log on faulty ACPI address 2023-03-17 08:50:30 +01:00
clk clk: HI655X: select REGMAP instead of depending on it 2023-03-22 13:33:40 +01:00
clocksource clocksource/drivers/riscv: Patch riscv_clock_next_event() jump before first use 2023-03-10 09:33:03 +01:00
comedi
connector
counter
cpufreq cpufreq: davinci: Fix clk use after free 2023-03-10 09:33:01 +01:00
cpuidle cpuidle: psci: Iterate backwards over list in psci_pd_remove() 2023-03-22 13:34:04 +01:00
crypto crypto: qat - fix out-of-bounds read 2023-03-10 09:34:19 +01:00
cxl cxl/pmem: Fix nvdimm registration races 2023-03-10 09:34:20 +01:00
dax dax/kmem: Fix leak of memory-hotplug resources 2023-03-10 09:34:25 +01:00
dca
devfreq
dio
dma dmaengine: ptdma: check for null desc before calling pt_cmd_callback 2023-03-10 09:33:39 +01:00
dma-buf
edac
eisa
extcon
firewire
firmware firmware: xilinx: don't make a sleepable memory allocation from an atomic context 2023-03-22 13:33:56 +01:00
fpga fpga: microchip-spi: rewrite status polling in a time measurable way 2023-03-10 09:33:34 +01:00
fsi
gnss
gpio gpio: vf610: connect GPIO label to dev name 2023-03-10 09:33:18 +01:00
gpu drm/amd/display: Fix DP MST sinks removal issue 2023-03-30 12:49:00 +02:00
greybus
hid HID: uhid: Over-ride the default maximum data buffer value with our own 2023-03-17 08:50:17 +01:00
hsi
hte
hv
hwmon hwmon: (ltc2992) Set `can_sleep` flag for GPIO chip 2023-03-22 13:33:52 +01:00
hwspinlock
hwtracing hwtracing: hisi_ptt: Only add the supported devices to the filters list 2023-03-10 09:33:31 +01:00
i2c i2c: designware: fix i2c_dw_clk_rate() return size to be u32 2023-03-10 09:33:29 +01:00
i3c
idle cpuidle, intel_idle: Fix CPUIDLE_FLAG_IRQ_ENABLE *again* 2023-03-10 09:32:36 +01:00
iio iio: accel: mma9551_core: Prevent uninitialized variable in mma9551_read_config_word() 2023-03-11 13:55:35 +01:00
infiniband RDMA/cma: Distinguish between sockaddr_in and sockaddr_in6 by size 2023-03-11 13:55:40 +01:00
input Input: exc3000 - properly stop timer on shutdown 2023-03-17 08:50:19 +01:00
interconnect interconnect: qcom: qcm2290: Fix MASTER_SNOC_BIMC_NRT 2023-03-30 12:48:59 +02:00
iommu iommu: Attach device group to old domain in error path 2023-03-11 13:55:40 +01:00
ipack
irqchip irqchip/irq-bcm7120-l2: Set IRQ_LEVEL for level triggered interrupts 2023-03-10 09:33:07 +01:00
isdn
leds leds: simatic-ipc-leds-gpio: Make sure we have the GPIO providing driver 2023-03-10 09:33:26 +01:00
macintosh macintosh: windfarm: Use unsigned type for 1-bit bitfields 2023-03-17 08:50:31 +01:00
mailbox
mcb
md md: select BLOCK_LEGACY_AUTOLOAD 2023-03-22 13:33:58 +01:00
media media: m5mols: fix off-by-one loop termination error 2023-03-22 13:33:53 +01:00
memory memory: tegra30-emc: fix interconnect registration race 2023-03-22 13:33:56 +01:00
memstick
message
mfd mfd: arizona: Use pm_runtime_resume_and_get() to prevent refcnt leak 2023-03-11 13:55:32 +01:00
misc misc: vmw_balloon: fix memory leak with using debugfs_lookup() 2023-03-11 13:55:39 +01:00
mmc mmc: sdhci_am654: lower power-on failed message severity 2023-03-22 13:34:03 +01:00
most
mtd ubi: ubi_wl_put_peb: Fix infinite loop when wear-leveling work failed 2023-03-11 13:55:21 +01:00
mux
net net: phy: nxp-c45-tja11xx: fix MII_BASIC_CONFIG_REV bit 2023-03-22 13:34:04 +01:00
nfc nfc: st-nci: Fix use after free bug in ndlc_remove due to race condition 2023-03-22 13:33:46 +01:00
ntb
nubus
nvdimm cxl/pmem: Fix nvdimm registration races 2023-03-10 09:34:20 +01:00
nvme nvme-pci: add NVME_QUIRK_BOGUS_NID for Netac NV3000 2023-03-22 13:34:02 +01:00
nvmem
of
opp OPP: fix error checking in opp_migrate_dentry() 2023-03-10 09:33:01 +01:00
parisc
parport
pci PCI: s390: Fix use-after-free of PCI resources with per-function hotplug 2023-03-22 13:33:45 +01:00
pcmcia
peci
perf
phy phy: rockchip-typec: Fix unsigned comparison with less than zero 2023-03-11 13:55:40 +01:00
pinctrl pinctrl: at91: use devm_kasprintf() to avoid potential leaks 2023-03-10 09:33:59 +01:00
platform platform: x86: MLX_PLATFORM: select REGMAP instead of depending on it 2023-03-17 08:50:27 +01:00
pnp
power power: supply: da9150: Fix use after free bug in da9150_charger_remove due to race condition 2023-03-30 12:49:01 +02:00
powercap powercap: fix possible name leak in powercap_register_zone() 2023-03-10 09:32:56 +01:00
pps
ps3
ptp ptp: vclock: use mutex to fix "sleep on atomic" bug 2023-03-11 13:55:25 +01:00
pwm pwm: stm32-lp: fix the check on arr and cmp registers update 2023-03-11 13:55:17 +01:00
rapidio
ras
regulator regulator: core: Use ktime_get_boottime() to determine how long a regulator was off 2023-03-10 09:34:25 +01:00
remoteproc remoteproc/mtk_scp: Move clk ops outside send_lock 2023-03-10 09:34:26 +01:00
reset
rpmsg rpmsg: glink: Release driver_override 2023-03-10 09:33:45 +01:00
rtc rtc: allow rtc_read_alarm without read_alarm callback 2023-03-11 13:55:30 +01:00
s390 s390: vfio-ap: tighten the NIB validity check 2023-03-10 09:33:02 +01:00
sbus
scsi scsi: core: Fix a procfs host directory removal regression 2023-03-22 13:33:43 +01:00
sh
siox
slimbus
soc soc: mediatek: mtk-svs: keep svs alive if CONFIG_DEBUG_FS not supported 2023-03-22 13:33:53 +01:00
soundwire soundwire: cadence: Drain the RX FIFO after an IO timeout 2023-03-11 13:55:40 +01:00
spi spi: intel: Check number of chip selects after reading the descriptor 2023-03-17 08:50:20 +01:00
spmi
ssb
staging staging: rtl8723bs: Pass correct parameters to cfg80211_get_bss() 2023-03-17 08:50:16 +01:00
target
tc
tee
thermal thermal: intel: BXT_PMIC: select REGMAP instead of depending on it 2023-03-11 13:55:32 +01:00
thunderbolt
tty serial: 8250: ASPEED_VUART: select REGMAP instead of depending on it 2023-03-22 13:33:55 +01:00
ufs scsi: ufs: core: Fix device management cmd timeout flow 2023-03-10 09:34:00 +01:00
uio
usb usb: gadget: uvc: fix missing mutex_unlock() if kstrtou8() fails 2023-03-11 13:55:44 +01:00
vdpa vp_vdpa: fix the crash in hot unplug with vp_vdpa 2023-03-22 13:34:03 +01:00
vfio vfio/type1: restore locked_vm 2023-03-10 09:34:32 +01:00
vhost vhost-vdpa: free iommu domain after last use during cleanup 2023-03-22 13:33:44 +01:00
video fbdev: Fix incorrect page mapping clearance at fb_deferred_io_release() 2023-03-22 13:34:04 +01:00
virt virt/coco/sev-guest: Add throttling awareness 2023-03-22 13:34:06 +01:00
virtio
vlynq
w1
watchdog watchdog: sbsa_wdog: Make sure the timeout programming is within the limits 2023-03-11 13:55:24 +01:00
xen xen/grant-dma-iommu: Implement a dummy probe_device() callback 2023-03-10 09:33:02 +01:00
zorro
Kconfig
Makefile