android_kernel_xiaomi_sm8450/drivers/misc
Jonas Malaco a37960df7e eeprom: ee1004: limit i2c reads to I2C_SMBUS_BLOCK_MAX
commit c0689e46be23160d925dca95dfc411f1a0462708 upstream.

Commit effa453168a7 ("i2c: i801: Don't silently correct invalid transfer
size") revealed that ee1004_eeprom_read() did not properly limit how
many bytes to read at once.

In particular, i2c_smbus_read_i2c_block_data_or_emulated() takes the
length to read as an u8.  If count == 256 after taking into account the
offset and page boundary, the cast to u8 overflows.  And this is common
when user space tries to read the entire EEPROM at once.

To fix it, limit each read to I2C_SMBUS_BLOCK_MAX (32) bytes, already
the maximum length i2c_smbus_read_i2c_block_data_or_emulated() allows.

Fixes: effa453168a7 ("i2c: i801: Don't silently correct invalid transfer size")
Cc: stable@vger.kernel.org
Reviewed-by: Heiner Kallweit <hkallweit1@gmail.com>
Signed-off-by: Jonas Malaco <jonas@protocubo.io>
Link: https://lore.kernel.org/r/20220203165024.47767-1-jonas@protocubo.io
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-02-16 12:54:27 +01:00
..
altera-stapl
c2port
cardreader misc: alcor_pci: fix inverted branch condition 2021-07-20 16:05:50 +02:00
cb710 cb710: avoid NULL pointer subtraction 2021-10-20 11:45:00 +02:00
cxl cxl: Rework error message for incompatible slots 2020-08-25 01:31:32 +10:00
echo
eeprom eeprom: ee1004: limit i2c reads to I2C_SMBUS_BLOCK_MAX 2022-02-16 12:54:27 +01:00
genwqe
habanalabs habanalabs/gaudi: fix LBW RR configuration 2021-10-09 14:40:56 +02:00
ibmasm misc/libmasm/module: Fix two use after free in ibmasm_init_one 2021-07-20 16:05:38 +02:00
lis3lv02d platform/x86: hp_accel: Avoid invoking _INI to speed up resume 2021-06-03 09:00:39 +02:00
lkdtm lkdtm: Fix content of section containing lkdtm_rodata_do_nothing() 2022-01-27 10:53:43 +01:00
mei mei: me: add Ice Lake-N device id. 2021-10-20 11:44:59 +02:00
ocxl powerpc updates for 5.10 2020-10-16 12:21:15 -07:00
sgi-gru x86/platform/uv: Update Copyrights to conform to HPE standards 2020-10-07 09:10:07 +02:00
sgi-xp x86/platform/uv: Update Copyrights to conform to HPE standards 2020-10-07 09:10:07 +02:00
ti-st
uacce Char/Misc driver patches for 5.10-rc1 2020-10-15 10:01:51 -07:00
vmw_vmci VMCI: fix NULL pointer dereference when unmapping queue pair 2021-09-18 13:40:09 +02:00
ad525x_dpot-i2c.c
ad525x_dpot-spi.c
ad525x_dpot.c
ad525x_dpot.h
apds990x.c
apds9802als.c
atmel_tclib.c
atmel-ssc.c
bh1770glc.c
cs5535-mfgpt.c
ds1682.c
dummy-irq.c
enclosure.c
fastrpc.c misc: fastrpc: avoid double fput() on failed usercopy 2022-02-16 12:54:24 +01:00
hisi_hikey_usb.c misc: hisi_hikey_usb: delete a stray tab 2020-09-22 18:54:00 +02:00
hmc6352.c
hpilo.c
hpilo.h
ibmvmc.c
ibmvmc.h
ics932s401.c ics932s401: fix broken handling of errors when word reading fails 2021-05-26 12:06:56 +02:00
isl29003.c
isl29020.c
Kconfig misc: mic: remove the MIC drivers 2020-10-28 19:12:03 +01:00
kgdbts.c kgdb: fix gcc-11 warnings harder 2021-06-03 09:00:31 +02:00
lattice-ecp3-config.c misc: lattice-ecp3-config: Fix task hung when firmware load failed 2022-01-27 10:54:08 +01:00
Makefile misc: mic: remove the MIC drivers 2020-10-28 19:12:03 +01:00
pch_phub.c
pci_endpoint_test.c misc: pci_endpoint_test: fix return value of error branch 2020-12-30 11:53:45 +01:00
phantom.c
pti.c
pvpanic.c misc/pvpanic: Export module FDT device table 2021-03-17 17:06:31 +01:00
qcom-coincell.c
sram-exec.c
sram.c treewide: Change list_sort to use const pointers 2021-09-30 10:11:04 +02:00
sram.h
tifm_7xx1.c
tifm_core.c
tsl2550.c
vmw_balloon.c
xilinx_sdfec.c