android_kernel_motorola_sm6225/drivers/i2c
Heiner Kallweit dff1af8fec i2c: i801: fix potential race in i801_block_transaction_byte_by_byte
commit f78ca48a8ba9cdec96e8839351e49eec3233b177 upstream.

Currently we set SMBHSTCNT_LAST_BYTE only after the host has started
receiving the last byte. If we get e.g. preempted before setting
SMBHSTCNT_LAST_BYTE, the host may be finished with receiving the byte
before SMBHSTCNT_LAST_BYTE is set.
Therefore change the code to set SMBHSTCNT_LAST_BYTE before writing
SMBHSTSTS_BYTE_DONE for the byte before the last byte. Now the code
is also consistent with what we do in i801_isr_byte_done().

Reported-by: Jean Delvare <jdelvare@suse.com>
Closes: https://lore.kernel.org/linux-i2c/20230828152747.09444625@endymion.delvare/
Cc: stable@vger.kernel.org
Acked-by: Andi Shyti <andi.shyti@kernel.org>
Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
Reviewed-by: Jean Delvare <jdelvare@suse.de>
Signed-off-by: Wolfram Sang <wsa@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2023-11-28 16:46:35 +00:00
..
algos i2c: algo: pca: Reapply i2c bus settings after reset 2020-09-23 12:10:59 +02:00
busses i2c: i801: fix potential race in i801_block_transaction_byte_by_byte 2023-11-28 16:46:35 +00:00
muxes i2c: muxes: i2c-demux-pinctrl: Use of_get_i2c_adapter_by_node() 2023-11-08 11:22:16 +01:00
i2c-boardinfo.c
i2c-core-acpi.c i2c: acpi: fix resource leak in reconfiguration device addition 2021-10-13 10:10:52 +02:00
i2c-core-base.c i2c: Fix a potential use after free 2022-08-25 11:15:04 +02:00
i2c-core-of.c i2c: core: fix use after free in of_i2c_notify 2019-12-13 08:51:07 +01:00
i2c-core-slave.c i2c: slave: add sanity check when unregistering 2020-08-11 15:32:33 +02:00
i2c-core-smbus.c i2c: core: check returned size of emulated smbus block read 2020-06-30 23:17:13 -04:00
i2c-core.h
i2c-dev.c i2c: validate user data in compat ioctl 2022-01-05 12:34:59 +01:00
i2c-mux.c i2c: mux: Avoid potential false error message in i2c_mux_add_adapter 2023-10-25 11:16:53 +02:00
i2c-slave-eeprom.c
i2c-smbus.c
i2c-stub.c
Kconfig
Makefile