linux-stable/drivers/i2c
Jean Delvare dfa8929e11 i2c: i801: Don't generate an interrupt on bus reset
commit e4d8716c3d upstream.

Now that the i2c-i801 driver supports interrupts, setting the KILL bit
in a attempt to recover from a timed out transaction triggers an
interrupt. Unfortunately, the interrupt handler (i801_isr) is not
prepared for this situation and will try to process the interrupt as
if it was signaling the end of a successful transaction. In the case
of a block transaction, this can result in an out-of-range memory
access.

This condition was reproduced several times by syzbot:
https://syzkaller.appspot.com/bug?extid=ed71512d469895b5b34e
https://syzkaller.appspot.com/bug?extid=8c8dedc0ba9e03f6c79e
https://syzkaller.appspot.com/bug?extid=c8ff0b6d6c73d81b610e
https://syzkaller.appspot.com/bug?extid=33f6c360821c399d69eb
https://syzkaller.appspot.com/bug?extid=be15dc0b1933f04b043a
https://syzkaller.appspot.com/bug?extid=b4d3fd1dfd53e90afd79

So disable interrupts while trying to reset the bus. Interrupts will
be enabled again for the following transaction.

Fixes: 636752bcb5 ("i2c-i801: Enable IRQ for SMBus transactions")
Reported-by: syzbot+b4d3fd1dfd53e90afd79@syzkaller.appspotmail.com
Signed-off-by: Jean Delvare <jdelvare@suse.de>
Acked-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Cc: Jarkko Nikula <jarkko.nikula@linux.intel.com>
Tested-by: Jarkko Nikula <jarkko.nikula@linux.intel.com>
Signed-off-by: Wolfram Sang <wsa@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-06-03 08:36:19 +02:00
..
algos i2c: algo: pca: Reapply i2c bus settings after reset 2020-09-23 10:46:34 +02:00
busses i2c: i801: Don't generate an interrupt on bus reset 2021-06-03 08:36:19 +02:00
muxes i2c: mux: demux-pinctrl: Fix an error handling path in 'i2c_demux_pinctrl_probe()' 2020-05-27 16:42:52 +02:00
i2c-boardinfo.c
i2c-core-acpi.c i2c: core: Restore acpi_walk_dep_device_list() getting called after registering the ACPI i2c devs 2020-10-29 09:07:14 +01:00
i2c-core-base.c i2c: turn recovery error on init to debug 2021-04-16 11:57:49 +02:00
i2c-core-of.c i2c: core: fix use after free in of_i2c_notify 2019-12-17 20:37:32 +01:00
i2c-core-slave.c i2c: slave: add sanity check when unregistering 2020-08-21 09:47:59 +02:00
i2c-core-smbus.c
i2c-core.h
i2c-dev.c i2c: dev: Fix the race between the release of i2c_dev and cdev 2020-05-27 16:42:50 +02:00
i2c-mux.c i2c/mux, locking/core: Annotate the nested rt_mutex usage 2018-09-05 09:26:29 +02:00
i2c-slave-eeprom.c
i2c-smbus.c
i2c-stub.c
Kconfig
Makefile