linux/drivers/misc
Daniel Okazaki 6d8b56ec0c eeprom: at24: fix memory corruption race condition
commit f42c97027f upstream.

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: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2024-05-02 16:35:28 +02:00
..
altera-stapl misc: add HAS_IOPORT dependencies 2023-05-29 15:05:00 +01:00
bcm-vk tty: bcm: convert to u8 and size_t 2023-12-08 12:02:37 +01:00
c2port c2port: replace deprecated strncpy with strscpy 2023-10-05 13:34:05 +02:00
cardreader misc: rtsx: Fix rts5264 driver status incorrect when card removed 2024-04-27 17:12:58 +02:00
cb710
cxl powerpc: Add PVN support for HeXin C2000 processor 2023-12-01 21:15:33 +11:00
echo
eeprom eeprom: at24: fix memory corruption race condition 2024-05-02 16:35:28 +02:00
genwqe mm, treewide: rename MAX_ORDER to MAX_PAGE_ORDER 2024-01-08 15:27:15 -08:00
ibmasm ibmasm: convert to new timestamp accessors 2023-10-18 13:26:16 +02:00
lis3lv02d misc: lis3lv02d_i2c: Fix regulators getting en-/dis-abled twice on suspend/resume 2024-03-04 07:59:43 +01:00
lkdtm lkdtm: Add kfence read after free crash type 2023-12-01 09:51:43 -08:00
mchp_pci1xxxx misc: microchip: pci1xxxx: Fix some NULL vs IS_ERR() bugs 2023-08-12 12:58:56 +02:00
mei mei: me: disable RPL-S on SPS and IGN firmwares 2024-04-27 17:13:00 +02:00
ocxl powerpc updates for 6.8 2024-01-08 16:22:47 -08:00
pvpanic pvpanic: Kill duplicate PCI_VENDOR_ID_REDHAT definition 2024-01-04 17:01:14 +01:00
sgi-gru arch: Remove Itanium (IA-64) architecture 2023-09-11 08:13:17 +00:00
sgi-xp sysctl-6.7-rc1 2023-11-01 20:51:41 -10:00
ti-st drivers: misc: ti-st: replace deprecated strncpy with strscpy 2023-10-05 13:34:04 +02:00
uacce uacce: make uacce_class constant 2023-10-27 08:51:00 +02:00
vmw_vmci VMCI: Fix possible memcpy() run-time warning in vmci_datagram_invoke_guest_handler() 2024-04-13 13:10:12 +02:00
ad525x_dpot-i2c.c misc: Switch i2c drivers back to use .probe() 2023-05-29 15:04:52 +01:00
ad525x_dpot-spi.c
ad525x_dpot.c
ad525x_dpot.h
apds990x.c misc: Switch i2c drivers back to use .probe() 2023-05-29 15:04:52 +01:00
apds9802als.c misc: Switch i2c drivers back to use .probe() 2023-05-29 15:04:52 +01:00
atmel-ssc.c misc: atmel-ssc: Use devm_platform_get_and_ioremap_resource() 2023-08-04 15:38:45 +02:00
bh1770glc.c misc: Switch i2c drivers back to use .probe() 2023-05-29 15:04:52 +01:00
cs5535-mfgpt.c
ds1682.c misc: Switch i2c drivers back to use .probe() 2023-05-29 15:04:52 +01:00
dummy-irq.c
dw-xdata-pcie.c dw-xdata: Remove usage of the deprecated ida_simple_*() API 2023-12-31 11:09:26 +00:00
enclosure.c drivers: remove struct module * setting from struct class 2023-03-17 15:16:27 +01:00
fastrpc.c misc: fastrpc: Pass proper arguments to scm call 2024-03-05 14:30:06 +00:00
gehc-achc.c
hi6421v600-irq.c misc: hi6421-spmi-pmic: Remove redundant dev_err() 2023-08-04 15:39:10 +02:00
hisi_hikey_usb.c
hmc6352.c misc: Switch i2c drivers back to use .probe() 2023-05-29 15:04:52 +01:00
hpilo.c misc: hpilo: make ilo_class a static const structure 2023-08-11 21:41:36 +02:00
hpilo.h
ibmvmc.c Char/Misc and other driver changes for 6.7-rc1 2023-11-03 14:51:08 -10:00
ibmvmc.h
ics932s401.c misc: Switch i2c drivers back to use .probe() 2023-05-29 15:04:52 +01:00
isl29003.c misc: Switch i2c drivers back to use .probe() 2023-05-29 15:04:52 +01:00
isl29020.c misc: Switch i2c drivers back to use .probe() 2023-05-29 15:04:52 +01:00
Kconfig misc: nsm: remove selecting the non-existing config CBOR 2023-12-15 17:07:41 +01:00
kgdbts.c
lattice-ecp3-config.c
Makefile misc: Add Nitro Secure Module driver 2023-11-28 19:05:16 +00:00
nsm.c misc: Add Nitro Secure Module driver 2023-11-28 19:05:16 +00:00
open-dice.c misc: open-dice: Fix spurious lockdep warning 2024-01-30 16:20:54 -08:00
pch_phub.c
pci_endpoint_test.c Merge branch 'pci/misc' 2024-01-15 12:10:41 -06:00
phantom.c misc: phantom: make phantom_class constant 2023-10-25 11:07:11 +02:00
qcom-coincell.c misc: Explicitly include correct DT includes 2023-08-04 15:39:04 +02:00
smpro-errmon.c misc: smpro-errmon: Remove the unneeded include <linux/i2c.h> 2023-05-31 19:00:10 +01:00
smpro-misc.c misc: smpro-misc: Add Ampere's Altra SMpro misc driver 2022-11-10 19:03:03 +01:00
sram-exec.c mm: Introduce set_memory_rox() 2022-12-15 10:37:26 -08:00
sram.c misc: Explicitly include correct DT includes 2023-08-04 15:39:04 +02:00
sram.h misc: sram: Improve and simplify clk handling 2023-03-09 17:31:53 +01:00
tifm_7xx1.c misc: tifm: fix possible memory leak in tifm_7xx1_switch_media() 2022-11-23 19:55:26 +01:00
tifm_core.c driver core: make struct bus_type.uevent() take a const * 2023-01-27 13:45:52 +01:00
tps6594-esm.c Merge 6.5-rc6 into char-misc-next 2023-08-13 22:14:51 +02:00
tps6594-pfsm.c misc: tps6594: Remove redundant dev_err_probe() for platform_get_irq_byname() 2023-08-12 12:58:40 +02:00
tsl2550.c misc: Switch i2c drivers back to use .probe() 2023-05-29 15:04:52 +01:00
vcpu_stall_detector.c misc: Explicitly include correct DT includes 2023-08-04 15:39:04 +02:00
vmw_balloon.c vmw_balloon: dynamically allocate the vmw-balloon shrinker 2023-10-04 10:32:25 -07:00
xilinx_sdfec.c misc: Explicitly include correct DT includes 2023-08-04 15:39:04 +02:00
xilinx_tmr_inject.c misc: Explicitly include correct DT includes 2023-08-04 15:39:04 +02:00
xilinx_tmr_manager.c misc: Explicitly include correct DT includes 2023-08-04 15:39:04 +02:00