OpenCloudOS-Kernel/drivers/i2c
Wolfram Sang 59e5b20c22 i2c: smbus: fix NULL function pointer dereference
[ Upstream commit 91811a31b68d3765b3065f4bb6d7d6d84a7cfc9f ]

CVE-2024-35984

Baruch reported an OOPS when using the designware controller as target
only. Target-only modes break the assumption of one transfer function
always being available. Fix this by always checking the pointer in
__i2c_transfer.

Reported-by: Baruch Siach <baruch@tkos.co.il>
Closes: https://lore.kernel.org/r/4269631780e5ba789cf1ae391eec1b959def7d99.1712761976.git.baruch@tkos.co.il
Fixes: 4b1acc4333 ("i2c: core changes for slave support")
[wsa: dropped the simplification in core-smbus to avoid theoretical regressions]
Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Tested-by: Baruch Siach <baruch@tkos.co.il>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Huang Cun <cunhuang@tencent.com>
Signed-off-by: Jianping Liu <frankjpliu@tencent.com>
2024-11-28 14:55:53 +08:00
..
algos ock: sync codes to ock 5.4.119-20.0009.21 2024-06-11 20:27:38 +08:00
busses I2C driver support for Phytium Desktop CPUs 2024-11-28 12:26:14 +08:00
muxes tkernel: sync code to the same with tk4 pub/lts/0017-kabi 2024-06-12 13:13:20 +08:00
Kconfig docs: i2c: convert to ReST and add to driver-api bookset 2019-07-31 13:25:27 -06:00
Makefile i2c: don't use any __deprecated handling anymore 2018-08-24 17:26:43 +02:00
i2c-boardinfo.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 157 2019-05-30 11:26:37 -07:00
i2c-core-acpi.c tkernel: sync code to the same with tk4 pub/lts/0017-kabi 2024-06-12 13:13:20 +08:00
i2c-core-base.c i2c: smbus: fix NULL function pointer dereference 2024-11-28 14:55:53 +08:00
i2c-core-of.c i2c: core: fix use after free in of_i2c_notify 2019-11-15 22:01:13 +01:00
i2c-core-slave.c ock: sync codes to ock 5.4.119-20.0009.21 2024-06-11 20:27:38 +08:00
i2c-core-smbus.c ock: sync codes to ock 5.4.119-20.0009.21 2024-06-11 20:27:38 +08:00
i2c-core.h Merge branch 'i2c/for-5.3' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux 2019-07-15 21:10:39 -07:00
i2c-dev.c tkernel: sync code to the same with tk4 pub/lts/0017-kabi 2024-06-12 13:13:20 +08:00
i2c-mux.c i2c: mux: add sysfs header 2019-06-22 07:32:33 +02:00
i2c-slave-eeprom.c i2c: slave-eeprom: Add read only mode 2019-09-28 20:44:12 +02:00
i2c-smbus.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 157 2019-05-30 11:26:37 -07:00
i2c-stub.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 157 2019-05-30 11:26:37 -07:00