IPMB does not use i2c reads, but ipmb_slave_cb() still has to set *val on I2C_SLAVE_READ_REQUESTED and I2C_SLAVE_READ_PROCESSED. It leaves it untouched, so a master that reads from the slave address gets whatever the bus driver had there. On aspeed the first byte is the address byte that was just received and every following byte is an uninitialised stack variable. Return 0xff, as ipmi_ipmb does since commit 9f235ccecd03 ("ipmi: ipmb: initialise event handler read bytes"). Fixes: 51bd6f291583 ("Add support for IPMB driver") Cc: stable@vger.kernel.org Signed-off-by: Eric Yun Lin Chiang --- Notes (not for the changelog): - Testing: a KUnit case on UML with KASAN, kept out of this patch and available on request, calls ipmb_slave_cb() for both read events with *val preset to 0xa5: before, it stays 0xa5; after, 0xff. A write of two bytes is stored the same way before and after. Built for ARM (aspeed_g5_defconfig plus IPMB_DEVICE_INTERFACE) with W=1, no new warnings. Not run on hardware. - Tool use: found, and this change and its test drafted, with the help of an AI coding assistant (Claude). drivers/char/ipmi/ipmb_dev_int.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/drivers/char/ipmi/ipmb_dev_int.c b/drivers/char/ipmi/ipmb_dev_int.c index 5edc2be85..4ccc75321 100644 --- a/drivers/char/ipmi/ipmb_dev_int.c +++ b/drivers/char/ipmi/ipmb_dev_int.c @@ -292,6 +292,12 @@ static int ipmb_slave_cb(struct i2c_client *client, ipmb_handle_request(ipmb_dev); break; + case I2C_SLAVE_READ_REQUESTED: + case I2C_SLAVE_READ_PROCESSED: + /* IPMB does not use reads, but the bus driver sends *val */ + *val = 0xff; + break; + default: break; } -- 2.53.0