linux-stable/drivers/i2c/busses
Vincent Whitchurch 84e1d0bf1d i2c: virtio: disable timeout handling
If a timeout is hit, it can result is incorrect data on the I2C bus
and/or memory corruptions in the guest since the device can still be
operating on the buffers it was given while the guest has freed them.

Here is, for example, the start of a slub_debug splat which was
triggered on the next transfer after one transfer was forced to timeout
by setting a breakpoint in the backend (rust-vmm/vhost-device):

 BUG kmalloc-1k (Not tainted): Poison overwritten
 First byte 0x1 instead of 0x6b
 Allocated in virtio_i2c_xfer+0x65/0x35c age=350 cpu=0 pid=29
 	__kmalloc+0xc2/0x1c9
 	virtio_i2c_xfer+0x65/0x35c
 	__i2c_transfer+0x429/0x57d
 	i2c_transfer+0x115/0x134
 	i2cdev_ioctl_rdwr+0x16a/0x1de
 	i2cdev_ioctl+0x247/0x2ed
 	vfs_ioctl+0x21/0x30
 	sys_ioctl+0xb18/0xb41
 Freed in virtio_i2c_xfer+0x32e/0x35c age=244 cpu=0 pid=29
 	kfree+0x1bd/0x1cc
 	virtio_i2c_xfer+0x32e/0x35c
 	__i2c_transfer+0x429/0x57d
 	i2c_transfer+0x115/0x134
 	i2cdev_ioctl_rdwr+0x16a/0x1de
 	i2cdev_ioctl+0x247/0x2ed
 	vfs_ioctl+0x21/0x30
 	sys_ioctl+0xb18/0xb41

There is no simple fix for this (the driver would have to always create
bounce buffers and hold on to them until the device eventually returns
the buffers), so just disable the timeout support for now.

Fixes: 3cfc883804 ("i2c: virtio: add a virtio i2c frontend driver")
Acked-by: Jie Deng <jie.deng@intel.com>
Signed-off-by: Vincent Whitchurch <vincent.whitchurch@axis.com>
Acked-by: Michael S. Tsirkin <mst@redhat.com>
Reviewed-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Wolfram Sang <wsa@kernel.org>
2021-11-23 10:55:48 +01:00
..
i2c-acorn.c
i2c-ali15x3.c i2c: Use separate MODULE_AUTHOR() statements for multiple authors 2020-07-04 08:25:13 +02:00
i2c-ali1535.c i2c: ali1535: mention that the device should not be disabled 2021-07-02 09:14:46 +02:00
i2c-ali1563.c i2c: busses: i2c-ali1563: File headers are not good candidates for kernel-doc 2021-05-27 21:29:26 +02:00
i2c-altera.c i2c: altera: Fix formatting issue in struct and demote unworthy kernel-doc headers 2021-06-03 22:25:24 +02:00
i2c-amd-mp2-pci.c i2c: switch from 'pci_' to 'dma_' API 2021-10-02 09:48:53 +02:00
i2c-amd-mp2-plat.c i2c: amd-mp2-plat: ACPI: Use ACPI_COMPANION() directly 2021-11-07 14:57:41 +01:00
i2c-amd-mp2.h i2c: amd-mp2: Remove unused macro 2021-02-01 23:01:50 +01:00
i2c-amd756-s4882.c
i2c-amd756.c
i2c-amd8111.c i2c: amd8111: Fix coding style issues 2021-04-15 22:24:11 +02:00
i2c-aspeed.c i2c: aspeed: disable additional device addresses on ast2[56]xx 2021-05-27 21:44:19 +02:00
i2c-at91-core.c i2c: at91: mark PM ops as __maybe unused 2021-08-11 15:54:01 +02:00
i2c-at91-master.c i2c: at91-master: : use proper DMAENGINE API for termination 2021-08-11 15:12:18 +02:00
i2c-at91-slave.c
i2c-at91.h i2c: at91: remove legacy DMA left overs 2020-11-03 21:34:40 +01:00
i2c-au1550.c
i2c-axxia.c
i2c-bcm-iproc.c i2c: iproc: fix race between client unreg and tasklet 2021-08-10 22:40:55 +02:00
i2c-bcm-kona.c i2c: bcm-kona: Fix return value in probe() 2021-09-29 23:05:05 +02:00
i2c-bcm2835.c i2c: bcm2835: Simplify with dev_err_probe() 2020-09-18 23:02:03 +02:00
i2c-brcmstb.c i2c: remove unused 'version.h' include in drivers 2021-04-08 23:12:38 +02:00
i2c-cadence.c i2c: cadence: Implement save restore 2021-08-25 23:07:05 +02:00
i2c-cbus-gpio.c
i2c-cht-wc.c i2c: cht-wc: Replace of_node by NULL 2021-06-20 22:47:24 +02:00
i2c-cp2615.c i2c: cp2615: check for allocation failure in cp2615_i2c_recv() 2021-06-20 23:13:34 +02:00
i2c-cpm.c i2c: cpm: Fix i2c_ram structure 2020-09-27 15:14:16 +02:00
i2c-cros-ec-tunnel.c
i2c-davinci.c i2c: davinci: Simplify with dev_err_probe() 2021-06-23 18:23:55 +02:00
i2c-designware-baytrail.c
i2c-designware-common.c i2c: designware: Use DIV_ROUND_CLOSEST() macro 2021-08-11 16:43:25 +02:00
i2c-designware-core.h i2c: designware: Fix indentation in the header 2021-08-11 16:43:32 +02:00
i2c-designware-master.c i2c: busses: i2c-designware-master: Fix misnaming of 'i2c_dw_init_master()' 2021-05-27 21:32:12 +02:00
i2c-designware-pcidrv.c i2c: designware: Fix return value check in navi_amd_register_client() 2021-04-08 22:47:48 +02:00
i2c-designware-platdrv.c i2c: designware: Use DIV_ROUND_CLOSEST() macro 2021-08-11 16:43:25 +02:00
i2c-designware-slave.c i2c: designware: slave should do WRITE_REQUESTED before WRITE_RECEIVED 2020-11-06 16:02:00 +01:00
i2c-digicolor.c i2c: busses: Replace spin_lock_irqsave with spin_lock in hard IRQ 2021-02-12 08:21:57 +01:00
i2c-diolan-u2c.c
i2c-dln2.c
i2c-eg20t.c i2c: busses: i2c-eg20t: Fix 'bad line' issue and provide description for 'msgs' param 2021-05-27 21:33:10 +02:00
i2c-elektor.c Merge branch 'i2c/for-5.12' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux 2021-02-22 09:02:24 -08:00
i2c-emev2.c i2c: emev2: add IRQ check 2021-04-14 10:20:00 +02:00
i2c-exynos5.c i2c: exynos5: correct top kerneldoc 2021-04-06 22:32:33 +02:00
i2c-fsi.c i2c: fsi: Prevent adding adapters for ports without dts nodes 2020-07-24 21:31:33 +02:00
i2c-gpio.c i2c: gpio: fix MODULE_LICENCE 2021-01-05 17:30:45 +01:00
i2c-highlander.c i2c: highlander: add IRQ check 2021-08-03 22:48:39 +02:00
i2c-hisi.c i2c: add support for HiSilicon I2C controller 2021-04-10 21:54:05 +02:00
i2c-hix5hd2.c i2c: hix5hd2: fix IRQ check 2021-08-19 19:18:24 +02:00
i2c-hydra.c
i2c-i801.c i2c: i801: Fix interrupt storm from SMB_ALERT signal 2021-11-23 10:43:50 +01:00
i2c-ibm_iic.c
i2c-ibm_iic.h
i2c-icy.c i2c: icy: Remove unused variable new_fwnode in icy_probe() 2021-05-25 21:21:32 +02:00
i2c-img-scb.c i2c: img-scb: fix reference leak when pm_runtime_get_sync fails 2021-04-14 09:49:06 +02:00
i2c-imx-lpi2c.c i2c: imx-lpi2c: fix reference leak when pm_runtime_get_sync fails 2021-04-14 09:49:09 +02:00
i2c-imx.c i2c: imx: : use proper DMAENGINE API for termination 2021-08-11 15:15:30 +02:00
i2c-iop3xx.c i2c: iop3xx: fix deferred probing 2021-08-19 19:18:17 +02:00
i2c-iop3xx.h
i2c-isch.c
i2c-ismt.c i2c: switch from 'pci_' to 'dma_' API 2021-10-02 09:48:53 +02:00
i2c-jz4780.c Merge branch 'i2c/for-5.13' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux 2021-04-30 13:01:02 -07:00
i2c-kempld.c i2c: kempld: deprecate class based instantiation 2021-09-29 23:07:02 +02:00
i2c-lpc2k.c
i2c-meson.c i2c: meson: fixup rate calculation with filter delay 2020-10-08 11:57:23 +02:00
i2c-mlxbf.c i2c: mlxbf: add IRQ check 2021-04-14 10:20:45 +02:00
i2c-mlxcpld.c i2c: mlxcpld: Allow flexible polling time setting for I2C transactions 2021-10-11 12:32:00 +02:00
i2c-mpc.c i2c: mpc: Poll for MCF 2021-07-20 22:32:01 +02:00
i2c-mt65xx.c i2c: mediatek: Dump i2c/dma register when a timeout occurs 2021-10-11 12:40:05 +02:00
i2c-mt7621.c
i2c-mv64xxx.c i2c: mv64xxx: Fix random system lock caused by runtime PM 2021-04-15 22:13:19 +02:00
i2c-mxs.c i2c: mxs: : use proper DMAENGINE API for termination 2021-08-11 15:16:01 +02:00
i2c-nforce2-s4985.c
i2c-nforce2.c
i2c-nomadik.c i2c: busses: i2c-nomadik: Fix formatting issue pertaining to 'timeout' 2021-05-27 21:27:48 +02:00
i2c-npcm7xx.c i2c: npcm7xx: Clear LAST bit after a failed transaction. 2020-09-27 20:05:27 +02:00
i2c-nvidia-gpu.c i2c: nvidia-gpu: Constify the software node 2021-04-10 21:43:01 +02:00
i2c-ocores.c i2c: busses: i2c-ocores: Place the expected function names into the documentation headers 2021-05-27 21:33:41 +02:00
i2c-octeon-core.c i2c: octeon: check correct size of maximum RECV_LEN packet 2021-01-17 12:26:55 +01:00
i2c-octeon-core.h
i2c-octeon-platdrv.c
i2c-omap.c i2c: omap: fix reference leak when pm_runtime_get_sync fails 2021-04-14 09:49:17 +02:00
i2c-opal.c treewide: Use fallthrough pseudo-keyword 2020-08-23 17:36:59 -05:00
i2c-owl.c i2c: owl: Add compatible for the Actions Semi S500 I2C controller 2020-12-09 21:23:21 +01:00
i2c-parport.c i2c: parport: Switch to use module_parport_driver() 2021-08-10 23:07:37 +02:00
i2c-pasemi-core.c i2c: pasemi: Set enable bit for Apple variant 2021-10-11 11:45:56 +02:00
i2c-pasemi-core.h i2c: pasemi: Set enable bit for Apple variant 2021-10-11 11:45:56 +02:00
i2c-pasemi-pci.c i2c: pasemi: Set enable bit for Apple variant 2021-10-11 11:45:56 +02:00
i2c-pasemi-platform.c i2c: pasemi: Add Apple platform driver 2021-10-11 11:45:48 +02:00
i2c-pca-isa.c isa: Make the remove callback for isa drivers return void 2021-01-26 07:42:27 +01:00
i2c-pca-platform.c i2c: pca-platform: drop two members from driver data that are assigned to only 2020-12-02 21:29:31 +01:00
i2c-piix4.c i2c: Use separate MODULE_AUTHOR() statements for multiple authors 2020-07-04 08:25:13 +02:00
i2c-pnx.c i2c: busses: i2c-pnx: Provide descriptions for 'alg_data' data structure 2021-05-27 21:34:08 +02:00
i2c-powermac.c i2c: powermac: remove uncertainty about SMBUS_BLOCK transfers 2021-03-18 11:59:57 +01:00
i2c-pxa-pci.c
i2c-pxa.c i2c: pxa: drop unneeded MODULE_ALIAS 2021-10-02 09:32:06 +02:00
i2c-qcom-cci.c i2c: qcom-cci: add sm8250 compatible 2021-05-25 21:14:04 +02:00
i2c-qcom-geni.c i2c: qcom-geni: Suspend and resume the bus during SYSTEM_SLEEP_PM ops 2021-06-04 22:32:58 +02:00
i2c-qup.c i2c: qup: move to use request_irq by IRQF_NO_AUTOEN flag 2021-10-29 21:57:33 +02:00
i2c-rcar.c i2c: rcar: enable interrupts before starting transfer 2021-09-29 23:02:59 +02:00
i2c-riic.c i2c: riic: Add RZ/G2L support 2021-06-20 22:40:44 +02:00
i2c-rk3x.c i2c: rk3x: Simplify with dev_err_probe() 2020-09-27 19:58:56 +02:00
i2c-robotfuzz-osif.c i2c: robotfuzz-osif: fix control-request directions 2021-06-24 22:08:00 +02:00
i2c-s3c2410.c i2c: s3c2410: fix IRQ check 2021-08-19 19:18:24 +02:00
i2c-scmi.c i2c: i2c-scmi: Drop unused ACPI_MODULE_NAME definition 2021-03-18 12:11:45 +01:00
i2c-sh7760.c i2c: sh7760: fix IRQ error path 2021-04-17 22:00:58 +02:00
i2c-sh_mobile.c i2c: sh_mobile: : use proper DMAENGINE API for termination 2021-08-11 15:22:24 +02:00
i2c-sibyte.c i2c: Use separate MODULE_AUTHOR() statements for multiple authors 2020-07-04 08:25:13 +02:00
i2c-simtec.c
i2c-sis96x.c
i2c-sis630.c
i2c-sis5595.c
i2c-sprd.c i2c: sprd: fix reference leak when pm_runtime_get_sync fails 2021-04-14 09:49:20 +02:00
i2c-st.c i2c: busses: i2c-st: Fix copy/paste function misnaming issues 2021-05-27 21:39:35 +02:00
i2c-stm32.c i2c: stm32: Simplify with dev_err_probe() 2020-09-21 11:45:43 +02:00
i2c-stm32.h
i2c-stm32f4.c i2c: busses: i2c-stm32f4: Remove incorrectly placed ' ' from function name 2021-05-27 21:39:57 +02:00
i2c-stm32f7.c i2c: stm32f7: add SMBus-Alert support 2021-05-25 21:48:19 +02:00
i2c-sun6i-p2wi.c i2c: sun6i-pw2i: Prefer strscpy over strlcpy 2021-08-17 21:37:40 +02:00
i2c-synquacer.c i2c: synquacer: fix deferred probing 2021-08-17 21:41:32 +02:00
i2c-taos-evm.c
i2c-tegra-bpmp.c i2c: tegra-bpmp: Demote kernel-doc abuses 2021-06-03 22:31:42 +02:00
i2c-tegra.c i2c: tegra: Ensure that device is suspended before driver is removed 2021-10-29 21:51:31 +02:00
i2c-thunderx-pcidrv.c
i2c-tiny-usb.c
i2c-uniphier-f.c
i2c-uniphier.c
i2c-versatile.c
i2c-via.c
i2c-viapro.c i2c: busses: Use fallthrough pseudo-keyword 2020-07-23 22:04:08 +02:00
i2c-viperboard.c
i2c-virtio.c i2c: virtio: disable timeout handling 2021-11-23 10:55:48 +01:00
i2c-wmt.c
i2c-xgene-slimpro.c i2c: xgene-slimpro: Fix wrong pointer passed to PTR_ERR() 2021-11-06 22:09:37 +01:00
i2c-xiic.c i2c: xiic: Fix RX IRQ busy check 2021-09-14 12:22:54 +02:00
i2c-xlp9xx.c i2c: xlp9xx: fix main IRQ check 2021-08-25 23:04:17 +02:00
i2c-xlr.c i2c: xlr: Fix a resource leak in the error handling path of 'xlr_i2c_probe()' 2021-10-29 22:04:35 +02:00
Kconfig i2c: pasemi: Add Apple platform driver 2021-10-11 11:45:48 +02:00
Makefile i2c: pasemi: Add Apple platform driver 2021-10-11 11:45:48 +02:00
scx200_acb.c i2c: busses: Use fallthrough pseudo-keyword 2020-07-23 22:04:08 +02:00