lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Message-Id: <20250818-imx8_isi-v1-1-e9cfe994c435@gocontroll.com>
Date: Mon, 18 Aug 2025 14:31:43 +0200
From: Maud Spierings via B4 Relay <devnull+maudspierings.gocontroll.com@...nel.org>
To: Laurent Pinchart <laurent.pinchart@...asonboard.com>, 
 Mauro Carvalho Chehab <mchehab@...nel.org>, Shawn Guo <shawnguo@...nel.org>, 
 Sascha Hauer <s.hauer@...gutronix.de>, 
 Pengutronix Kernel Team <kernel@...gutronix.de>, 
 Fabio Estevam <festevam@...il.com>, 
 Stefan Riedmueller <s.riedmueller@...tec.de>, 
 Jacopo Mondi <jacopo@...ndi.org>, Christian Hemp <c.hemp@...tec.de>, 
 Guoniu Zhou <guoniu.zhou@....com>
Cc: Dong Aisheng <aisheng.dong@....com>, linux-media@...r.kernel.org, 
 imx@...ts.linux.dev, linux-arm-kernel@...ts.infradead.org, 
 linux-kernel@...r.kernel.org, Maud Spierings <maudspierings@...ontroll.com>
Subject: [PATCH] media: nxp: imx8-isi: Check whether pad is non-NULL before
 access

From: Maud Spierings <maudspierings@...ontroll.com>

media_pad_remote_pad_first() can return NULL if no valid link is found.
Check for this possibility before dereferencing it in the next line.

Reported/investigated in [1]:

Link: https://lore.kernel.org/all/1536a61b-b405-4762-9fb4-7e257f95e49e@gocontroll.com/ [1]
Fixes: cf21f328fcaf ("media: nxp: Add i.MX8 ISI driver")
Signed-off-by: Maud Spierings <maudspierings@...ontroll.com>
---
I'm not sure if this should be a dev_dbg(), just following the pattern
around it for now, also not sure if EPIPE is the correct error.
---
 drivers/media/platform/nxp/imx8-isi/imx8-isi-crossbar.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/drivers/media/platform/nxp/imx8-isi/imx8-isi-crossbar.c b/drivers/media/platform/nxp/imx8-isi/imx8-isi-crossbar.c
index ede6cc74c0234049fa225ad82aaddaad64aa53d7..1ed8b031178b7d934b04a8752747f556bd1fc5a9 100644
--- a/drivers/media/platform/nxp/imx8-isi/imx8-isi-crossbar.c
+++ b/drivers/media/platform/nxp/imx8-isi/imx8-isi-crossbar.c
@@ -160,6 +160,13 @@ mxc_isi_crossbar_xlate_streams(struct mxc_isi_crossbar *xbar,
 	}
 
 	pad = media_pad_remote_pad_first(&xbar->pads[sink_pad]);
+
+	if (pad == NULL) {
+		dev_dbg(xbar->isi->dev, "no valid link found to pad %u\n",
+			sink_pad);
+		return ERR_PTR(-EPIPE);
+	}
+
 	sd = media_entity_to_v4l2_subdev(pad->entity);
 	if (!sd) {
 		dev_dbg(xbar->isi->dev,

---
base-commit: 3ac864c2d9bb8608ee236e89bf561811613abfce
change-id: 20250818-imx8_isi-954898628bb6

Best regards,
-- 
Maud Spierings <maudspierings@...ontroll.com>



Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ