anolis-cloud-kernel/drivers/i2c
Wolfram Sang 4aed4f7cf2 i2c: smbus: fix NULL function pointer dereference
ANBZ: #20964

commit 5fd72404587d7db4acb2d241fd8c387afb0a7aec upstream.

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>
Fixes: CVE-2024-35984
Signed-off-by: Wang Yaxin <wang.yaxin@zte.com.cn>
Reviewed-by: Guixin Liu <kanie@linux.alibaba.com>
Link: https://gitee.com/anolis/cloud-kernel/pulls/5264
2025-05-19 03:51:47 +00:00
..
algos i2c: algo: pca: Reapply i2c bus settings after reset 2020-09-09 10:22:40 +02:00
busses anolis: sw_64: drive i2c for sw_64-8a 2024-10-30 15:51:51 +08:00
muxes i2c: mux: demux-pinctrl: do not deactivate a master that is not active 2022-04-08 14:40:22 +02:00
Kconfig i2c: add slave testunit driver 2020-09-21 11:02:17 +02:00
Makefile i2c: add slave testunit driver 2020-09-21 11:02:17 +02:00
i2c-boardinfo.c
i2c-core-acpi.c i2c: acpi: fix resource leak in reconfiguration device addition 2021-10-13 10:04:29 +02:00
i2c-core-base.c i2c: smbus: fix NULL function pointer dereference 2025-05-19 03:51:47 +00:00
i2c-core-of.c
i2c-core-slave.c i2c: slave: add sanity check when unregistering 2020-07-28 18:37:17 +02:00
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: acpi: Remove dead code, i.e. i2c_acpi_match_device() 2020-08-25 09:22:09 +02:00
i2c-dev.c i2c: dev: check return value when calling dev_set_name() 2025-03-27 05:39:22 +00:00
i2c-mux.c
i2c-slave-eeprom.c i2c: busses: Use fallthrough pseudo-keyword 2020-07-23 22:04:08 +02:00
i2c-slave-testunit.c i2c: add slave testunit driver 2020-09-21 11:02:17 +02:00
i2c-smbus.c i2c: smbus: add core function handling SMBus host-notify 2020-09-09 10:38:28 +02:00
i2c-stub.c