android_kernel_motorola_sm6375/drivers/misc
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Ola Jeppsson 556dfdb226 misc: fastrpc: Fix use-after-free race condition for maps
commit 96b328d119eca7563c1edcc4e1039a62e6370ecb upstream.

It is possible that in between calling fastrpc_map_get() until
map->fl->lock is taken in fastrpc_free_map(), another thread can call
fastrpc_map_lookup() and get a reference to a map that is about to be
deleted.

Rewrite fastrpc_map_get() to only increase the reference count of a map
if it's non-zero. Propagate this to callers so they can know if a map is
about to be deleted.

Fixes this warning:
refcount_t: addition on 0; use-after-free.
WARNING: CPU: 5 PID: 10100 at lib/refcount.c:25 refcount_warn_saturate
...
Call trace:
 refcount_warn_saturate
 [fastrpc_map_get inlined]
 [fastrpc_map_lookup inlined]
 fastrpc_map_create
 fastrpc_internal_invoke
 fastrpc_device_ioctl
 __arm64_sys_ioctl
 invoke_syscall

Fixes: c68cfb718c ("misc: fastrpc: Add support for context Invoke method")
Cc: stable <stable@kernel.org>
Signed-off-by: Ola Jeppsson <ola@snap.com>
Signed-off-by: Abel Vesa <abel.vesa@linaro.org>
Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Link: https://lore.kernel.org/r/20221124174941.418450-4-srinivas.kandagatla@linaro.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2023-01-24 07:18:00 +01:00
..
altera-stapl
c2port
cardreader misc: rtsx: Fix an error handling path in rtsx_pci_probe() 2022-08-25 11:17:52 +02:00
cb710 cb710: avoid NULL pointer subtraction 2021-10-20 11:40:13 +02:00
cxl cxl: Fix refcount leak in cxl_calc_capp_routing 2023-01-18 11:41:30 +01:00
echo
eeprom eeprom: ee1004: limit i2c reads to I2C_SMBUS_BLOCK_MAX 2022-02-16 12:52:52 +01:00
genwqe
habanalabs
ibmasm
lis3lv02d
lkdtm locking/refcount: Define constants for saturation and max refcount values 2022-07-29 17:14:16 +02:00
mei mei: me: add Ice Lake-N device id. 2021-10-20 11:40:13 +02:00
mic
ocxl misc: ocxl: fix possible name leak in ocxl_file_register_afu() 2023-01-18 11:41:23 +01:00
sgi-gru misc: sgi-gru: fix use-after-free error in gru_set_context_option, gru_fault and gru_handle_user_call_os 2023-01-18 11:41:24 +01:00
sgi-xp
ti-st
vmw_vmci misc/vmw_vmci: fix an infoleak in vmci_host_do_receive_datagram() 2022-11-25 17:42:20 +01:00
ad525x_dpot-i2c.c
ad525x_dpot-spi.c
ad525x_dpot.c
ad525x_dpot.h
apds990x.c
apds9802als.c
atmel-ssc.c misc: atmel-ssc: Fix IRQ check in ssc_probe 2022-06-22 14:11:22 +02:00
atmel_tclib.c
bh1770glc.c
cs5535-mfgpt.c
ds1682.c
dummy-irq.c
enclosure.c
fastrpc.c misc: fastrpc: Fix use-after-free race condition for maps 2023-01-24 07:18:00 +01:00
hmc6352.c
hpilo.c
hpilo.h
ibmvmc.c
ibmvmc.h
ics932s401.c
isl29003.c
isl29020.c
Kconfig
kgdbts.c kgdbts: fix return value of __setup handler 2022-04-15 14:18:20 +02:00
lattice-ecp3-config.c misc: lattice-ecp3-config: Fix task hung when firmware load failed 2022-01-27 09:19:39 +01:00
Makefile
pch_phub.c
pci_endpoint_test.c
phantom.c
pti.c
pvpanic.c
qcom-coincell.c
sram-exec.c
sram.c
sram.h
tifm_7xx1.c misc: tifm: fix possible memory leak in tifm_7xx1_switch_media() 2023-01-18 11:41:24 +01:00
tifm_core.c
tsl2550.c
vexpress-syscfg.c
vmw_balloon.c
xilinx_sdfec.c