kernel-hacking-2024-linux-s.../drivers/i2c
Mans Rullgard 40e0520059 i2c: core: check returned size of emulated smbus block read
If the i2c bus driver ignores the I2C_M_RECV_LEN flag (as some of
them do), it is possible for an I2C_SMBUS_BLOCK_DATA read issued
on some random device to return an arbitrary value in the first
byte (and nothing else).  When this happens, i2c_smbus_xfer_emulated()
will happily write past the end of the supplied data buffer, thus
causing Bad Things to happen.  To prevent this, check the size
before copying the data block and return an error if it is too large.

Fixes: 209d27c3b1 ("i2c: Emulate SMBus block read over I2C")
Signed-off-by: Mans Rullgard <mans@mansr.com>
[wsa: use better errno]
Signed-off-by: Wolfram Sang <wsa@kernel.org>
2020-06-26 10:18:35 +02:00
..
algos
busses i2c: fsi: Fix the port number field in status register 2020-06-26 00:25:05 +02:00
muxes Merge branch 'i2c/for-current-fixed' into i2c/for-5.8 2020-05-20 15:27:45 +02:00
i2c-boardinfo.c
i2c-core-acpi.c i2c: acpi: Drop double check for ACPI companion device 2020-05-28 18:01:20 +02:00
i2c-core-base.c i2c: remove deprecated i2c_new_device API 2020-06-19 09:20:28 +02:00
i2c-core-of.c
i2c-core-slave.c
i2c-core-smbus.c i2c: core: check returned size of emulated smbus block read 2020-06-26 10:18:35 +02:00
i2c-core.h i2c: reword explanation about atomic transfers 2020-05-20 15:25:55 +02:00
i2c-dev.c
i2c-mux.c
i2c-slave-eeprom.c i2c: slave-eeprom: update documentation to recent changes 2020-05-28 18:06:10 +02:00
i2c-smbus.c i2c: smbus: Add a way to instantiate SPD EEPROMs automatically 2020-05-29 12:53:04 +02:00
i2c-stub.c
Kconfig treewide: replace '---help---' in Kconfig files with 'help' 2020-06-14 01:57:21 +09:00
Makefile