* [PATCH 00/10] i2c: Fix Critical and High issues reported by Sashiko
@ 2026-12-03 18:31 Lee Jones
2026-12-03 18:31 ` [PATCH 01/10] i2c: imx-lpi2c: Clear rx_cmd_buf pointer after freeing in lpi2c_imx_dma_xfer() Lee Jones
0 siblings, 1 reply; 2+ messages in thread
From: Lee Jones @ 2026-12-03 18:31 UTC (permalink / raw)
To: lee, Sumit Semwal, Christian König, Philipp Stanner,
linux-media, dri-devel, linaro-mm-sig
Cc: linux-kernel, Clément Le Goffic, Niklas Söderlund,
Aaro Koskinen, Akash Asthana, Alain Volmat, Alexandre Torgue,
Andi Shyti, Andreas Kemnade, Asmaa Mnebhi, Bakulchandra Shah,
Carlos Munoz, Carlos Song, Cedric Madianga, Dong Aisheng,
Elie Morisse, Fabio Estevam, Felipe Balbi, Frank Li, Gao Pan,
Greg Kroah-Hartman, Hans de Goede, Imre Deak, imx, Israel Cepeda,
Janusz Krzysztofik, Juha Yrjola, Kevin Hilman, Khalil Blaiech,
linux-arm-kernel, linux-arm-msm, linux-i2c, linux-omap,
linux-renesas-soc, linux-stm32, Maxime Coquelin,
Mukesh Kumar Savaliya, Nishant Menon, Pengutronix Kernel Team,
Pierre-Yves MORDRET, Piyush Malgujar, Robert Richter,
Roger Quadros, Roja Rani Yarubandi, Sakari Ailus, Sascha Hauer,
Shubhrajyoti D, Shyam Sundar S K, Siemens Networks,
Suneel Garapati, Syed Khasim, Tony Lindgren, Vadim Pasternak,
Vignesh R, Viken Dadhaniya, Wolfram Sang
These issues were reported by Sashiko.
Cc: "Clément Le Goffic" <clement.legoffic@foss.st.com>
Cc: "Niklas Söderlund" <niklas.soderlund+renesas@ragnatech.se>
Cc: Aaro Koskinen <aaro.koskinen@iki.fi>
Cc: Akash Asthana <akashast@codeaurora.org>
Cc: Alain Volmat <alain.volmat@foss.st.com>
Cc: Alexandre Torgue <alexandre.torgue@foss.st.com>
Cc: Andi Shyti <andi.shyti@kernel.org>
Cc: Andreas Kemnade <andreas@kemnade.info>
Cc: Asmaa Mnebhi <asmaa@nvidia.com>
Cc: Bakulchandra Shah <Nehal-bakulchandra.shah@amd.com>
Cc: Carlos Munoz <carlos@kenati.com>
Cc: Carlos Song <carlos.song@nxp.com>
Cc: Cedric Madianga <cedric.madianga@gmail.com>
Cc: Dong Aisheng <aisheng.dong@nxp.com>
Cc: Elie Morisse <syniurge@gmail.com>
Cc: Fabio Estevam <festevam@gmail.com>
Cc: Felipe Balbi <balbi@ti.com>
Cc: Frank Li <Frank.Li@nxp.com>
Cc: Gao Pan <pandy.gao@nxp.com>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Hans de Goede <hansg@kernel.org>
Cc: Imre Deak <imre.deak@nokia.com>
Cc: imx@lists.linux.dev
Cc: Israel Cepeda <israel.a.cepeda.lopez@intel.com>
Cc: Janusz Krzysztofik <jmkrzyszt@gmail.com>
Cc: Juha Yrjola <juha.yrjola@solidboot.com>
Cc: Kevin Hilman <khilman@baylibre.com>
Cc: Khalil Blaiech <kblaiech@nvidia.com>
Cc: linux-arm-kernel@lists.infradead.org
Cc: linux-arm-msm@vger.kernel.org
Cc: linux-i2c@vger.kernel.org
Cc: linux-media@vger.kernel.org
Cc: linux-omap@vger.kernel.org
Cc: linux-renesas-soc@vger.kernel.org
Cc: linux-stm32@st-md-mailman.stormreply.com
Cc: Maxime Coquelin <mcoquelin.stm32@gmail.com>
Cc: Mukesh Kumar Savaliya <mukesh.savaliya@oss.qualcomm.com>
Cc: Nishant Menon <nm@ti.com>
Cc: Pengutronix Kernel Team <kernel@pengutronix.de>
Cc: Pierre-Yves MORDRET <pierre-yves.mordret@foss.st.com>
Cc: Piyush Malgujar <pmalgujar@marvell.com>
Cc: Robert Richter <rric@kernel.org>
Cc: Roger Quadros <rogerq@kernel.org>
Cc: Roja Rani Yarubandi <rojay@codeaurora.org>
Cc: Sakari Ailus <sakari.ailus@linux.intel.com>
Cc: Sascha Hauer <s.hauer@pengutronix.de>
Cc: Shubhrajyoti D <shubhrajyoti@ti.com>
Cc: Shyam Sundar S K <shyam-sundar.s-k@amd.com>
Cc: Siemens Networks <michael.lawnick.ext@nsn.com>
Cc: Suneel Garapati <sgarapati@marvell.com>
Cc: Syed Khasim <x0khasim@ti.com>
Cc: Tony Lindgren <tony@atomide.com>
Cc: Vadim Pasternak <vadimp@mellanox.com>
Cc: Vignesh R <vigneshr@ti.com>
Cc: Viken Dadhaniya <viken.dadhaniya@oss.qualcomm.com>
Cc: Wolfram Sang <wsa+renesas@sang-engineering.com>
Lee Jones (10):
i2c: imx-lpi2c: Clear rx_cmd_buf pointer after freeing in
lpi2c_imx_dma_xfer()
i2c: qcom-geni: Clear dma_buf pointer after releasing DMA buffer
i2c: sh_mobile: Terminate DMA before freeing bounce buffer in
sh_mobile_xfer()
i2c: omap: Check buf_len before buffer accesses in data transfer
helpers
i2c: stm32f7: Prevent duplicate execution of
stm32f7_i2c_dma_callback()
i2c: stm32f7: Allocate smbus_buf separately for DMA safety
i2c: usbio: Validate full reply length in split-read loop
i2c: amd-mp2: Synchronise IRQ completion with command timeout
i2c: mlxbf: Reject zero-length SMBus reads to prevent stack overflow
i2c: octeon: Guard to_pci_dev() with dev_is_pci() in
octeon_i2c_set_clock()
drivers/i2c/busses/i2c-amd-mp2-pci.c | 29 ++++++++++++++----
drivers/i2c/busses/i2c-amd-mp2-plat.c | 5 ----
drivers/i2c/busses/i2c-amd-mp2.h | 3 ++
drivers/i2c/busses/i2c-imx-lpi2c.c | 4 ++-
drivers/i2c/busses/i2c-mlxbf.c | 8 +++++
drivers/i2c/busses/i2c-octeon-core.c | 3 +-
drivers/i2c/busses/i2c-omap.c | 14 ++++++---
drivers/i2c/busses/i2c-qcom-geni.c | 2 ++
drivers/i2c/busses/i2c-sh_mobile.c | 18 ++++++-----
drivers/i2c/busses/i2c-stm32f7.c | 43 ++++++++++++++++++++++-----
drivers/i2c/busses/i2c-usbio.c | 4 +--
11 files changed, 99 insertions(+), 34 deletions(-)
--
2.56.1.911.g883d8bcb20-goog
^ permalink raw reply [flat|nested] 2+ messages in thread* [PATCH 01/10] i2c: imx-lpi2c: Clear rx_cmd_buf pointer after freeing in lpi2c_imx_dma_xfer()
2026-12-03 18:31 [PATCH 00/10] i2c: Fix Critical and High issues reported by Sashiko Lee Jones
@ 2026-12-03 18:31 ` Lee Jones
0 siblings, 0 replies; 2+ messages in thread
From: Lee Jones @ 2026-12-03 18:31 UTC (permalink / raw)
To: lee, Dong Aisheng, Andi Shyti, Frank Li, Sascha Hauer,
Pengutronix Kernel Team, Fabio Estevam, Carlos Song, Gao Pan,
linux-i2c, imx, linux-arm-kernel
Cc: linux-kernel, stable
lpi2c_imx->dma persists across transfers. On a DMA read, the
disable_dma path frees dma->rx_cmd_buf without clearing the pointer.
If a subsequent DMA read fails in lpi2c_dma_config() or
lpi2c_dma_submit() before lpi2c_imx_alloc_rx_cmd_buf() runs, the
cleanup path calls kfree(dma->rx_cmd_buf) a second time on the stale
pointer.
Reset dma->rx_cmd_buf to NULL immediately after freeing it.
Fixes: a09c8b3f9047 ("i2c: imx-lpi2c: add eDMA mode support for LPI2C")
Closes: https://sashiko.dev/#/bug/linux-17d925e1-8c99-4efb-a920-2c90ce2b53b5
Cc: stable@vger.kernel.org
Signed-off-by: Lee Jones <lee@kernel.org>
---
drivers/i2c/busses/i2c-imx-lpi2c.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/drivers/i2c/busses/i2c-imx-lpi2c.c b/drivers/i2c/busses/i2c-imx-lpi2c.c
index ecf2bed01b29..f911b3b7367e 100644
--- a/drivers/i2c/busses/i2c-imx-lpi2c.c
+++ b/drivers/i2c/busses/i2c-imx-lpi2c.c
@@ -1097,8 +1097,10 @@ static int lpi2c_imx_dma_xfer(struct lpi2c_imx_struct *lpi2c_imx,
/* Disable I2C DMA function */
writel(0, lpi2c_imx->base + LPI2C_MDER);
- if (dma->dma_msg_flag & I2C_M_RD)
+ if (dma->dma_msg_flag & I2C_M_RD) {
kfree(dma->rx_cmd_buf);
+ dma->rx_cmd_buf = NULL;
+ }
if (ret)
i2c_put_dma_safe_msg_buf(dma->dma_buf, msg, false);
--
2.56.1.911.g883d8bcb20-goog
^ permalink raw reply related [flat|nested] 2+ messages in thread
end of thread, other threads:[~2026-12-03 18:32 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-12-03 18:31 [PATCH 00/10] i2c: Fix Critical and High issues reported by Sashiko Lee Jones
2026-12-03 18:31 ` [PATCH 01/10] i2c: imx-lpi2c: Clear rx_cmd_buf pointer after freeing in lpi2c_imx_dma_xfer() Lee Jones
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox