linux-stable/drivers/misc
Daniel Okazaki c850f71fca eeprom: at24: fix memory corruption race condition
[ Upstream commit f42c97027f ]

If the eeprom is not accessible, an nvmem device will be registered, the
read will fail, and the device will be torn down. If another driver
accesses the nvmem device after the teardown, it will reference
invalid memory.

Move the failure point before registering the nvmem device.

Signed-off-by: Daniel Okazaki <dtokazaki@google.com>
Fixes: b20eb4c1f0 ("eeprom: at24: drop unnecessary label")
Cc: stable@vger.kernel.org
Link: https://lore.kernel.org/r/20240422174337.2487142-1-dtokazaki@google.com
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2024-05-17 11:47:57 +02:00
..
altera-stapl
c2port
cardreader
cb710
cxl cxl: Fix refcount leak in cxl_calc_capp_routing 2023-01-14 10:16:06 +01:00
echo
eeprom eeprom: at24: fix memory corruption race condition 2024-05-17 11:47:57 +02:00
genwqe
habanalabs
ibmasm
lis3lv02d
lkdtm
mei mei: me: disable RPL-S on SPS and IGN firmwares 2024-05-02 16:23:39 +02:00
ocxl
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-14 10:15:57 +01:00
sgi-xp
ti-st misc: st_core: Do not call kfree_skb() under spin_lock_irqsave() 2023-11-20 11:06:53 +01:00
uacce
vmw_vmci VMCI: Fix possible memcpy() run-time warning in vmci_datagram_invoke_guest_handler() 2024-04-13 12:59:57 +02:00
Kconfig
Makefile
ad525x_dpot-i2c.c
ad525x_dpot-spi.c
ad525x_dpot.c
ad525x_dpot.h
apds990x.c
apds9802als.c
atmel-ssc.c
atmel_tclib.c
bh1770glc.c
cs5535-mfgpt.c
ds1682.c
dummy-irq.c
enclosure.c
fastrpc.c misc: fastrpc: Mark all sessions as invalid in cb_remove 2024-02-23 08:42:26 +01:00
hisi_hikey_usb.c
hmc6352.c
hpilo.c
hpilo.h
ibmvmc.c
ibmvmc.h
ics932s401.c
isl29003.c
isl29020.c
kgdbts.c
lattice-ecp3-config.c
pch_phub.c
pci_endpoint_test.c misc: pci_endpoint_test: Add deviceID for J721S2 PCIe EP device support 2023-12-08 08:46:14 +01:00
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-14 10:15:57 +01:00
tifm_core.c
tsl2550.c
vmw_balloon.c
xilinx_sdfec.c