Linux ARM-MSM sub-architecture
 help / color / mirror / Atom feed
* [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 02/10] i2c: qcom-geni: Clear dma_buf pointer after releasing DMA buffer 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 02/10] i2c: qcom-geni: Clear dma_buf pointer after releasing DMA buffer
  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, Mukesh Kumar Savaliya, Viken Dadhaniya, Andi Shyti,
	Sumit Semwal, Christian König, Philipp Stanner,
	Roja Rani Yarubandi, Akash Asthana, Wolfram Sang, linux-i2c,
	linux-arm-msm, linux-media, dri-devel, linaro-mm-sig
  Cc: linux-kernel, stable

geni_i2c_rx_msg_cleanup() and geni_i2c_tx_msg_cleanup() release
gi2c->dma_buf without setting it back to NULL.  If a subsequent
transfer fails geni_se_{rx,tx}_dma_prep() and falls back to FIFO mode,
gi2c->dma_buf retains the stale pointer from the previous transfer,
causing the cleanup helper to unprepare and free the buffer a second
time.

Set gi2c->dma_buf to NULL after releasing it in both cleanup functions.

Fixes: 357ee8841d0b ("i2c: qcom-geni: Store DMA mapping data in geni_i2c_dev struct")
Closes: https://sashiko.dev/#/bug/linux-d60db3da-ca85-40ac-8a6c-62b1d80be7ac
Cc: stable@vger.kernel.org
Signed-off-by: Lee Jones <lee@kernel.org>
---
 drivers/i2c/busses/i2c-qcom-geni.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/i2c/busses/i2c-qcom-geni.c b/drivers/i2c/busses/i2c-qcom-geni.c
index 926bc484ead2..6779719bbefa 100644
--- a/drivers/i2c/busses/i2c-qcom-geni.c
+++ b/drivers/i2c/busses/i2c-qcom-geni.c
@@ -505,6 +505,7 @@ static void geni_i2c_rx_msg_cleanup(struct geni_i2c_dev *gi2c,
 			geni_i2c_rx_fsm_rst(gi2c);
 		geni_se_rx_dma_unprep(&gi2c->se, gi2c->dma_addr, gi2c->xfer_len);
 		i2c_put_dma_safe_msg_buf(gi2c->dma_buf, cur, !gi2c->err);
+		gi2c->dma_buf = NULL;
 	}
 }
 
@@ -517,6 +518,7 @@ static void geni_i2c_tx_msg_cleanup(struct geni_i2c_dev *gi2c,
 			geni_i2c_tx_fsm_rst(gi2c);
 		geni_se_tx_dma_unprep(&gi2c->se, gi2c->dma_addr, gi2c->xfer_len);
 		i2c_put_dma_safe_msg_buf(gi2c->dma_buf, cur, !gi2c->err);
+		gi2c->dma_buf = NULL;
 	}
 }
 
-- 
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 02/10] i2c: qcom-geni: Clear dma_buf pointer after releasing DMA buffer Lee Jones

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox