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>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20240726072814.3534601-1-nichen@iscas.ac.cn>
Date: Fri, 26 Jul 2024 15:28:14 +0800
From: Chen Ni <nichen@...as.ac.cn>
To: laurent.pinchart@...asonboard.com,
	mchehab@...nel.org,
	gregkh@...uxfoundation.org,
	sakari.ailus@...ux.intel.com,
	hverkuil-cisco@...all.nl
Cc: linux-media@...r.kernel.org,
	linux-staging@...ts.linux.dev,
	linux-kernel@...r.kernel.org,
	Chen Ni <nichen@...as.ac.cn>
Subject: [PATCH] staging: media: omap4iss: add check for media_pad_remote_pad_first

Add check for the return value of media_pad_remote_pad_first() and
return the error if it fails in order to avoid NULL pointer dereference.

Fixes: b2e44430b634 ("media: mc-entity: Rename media_entity_remote_pad() to media_pad_remote_pad_first()")
Signed-off-by: Chen Ni <nichen@...as.ac.cn>
---
 drivers/staging/media/omap4iss/iss_csi2.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/staging/media/omap4iss/iss_csi2.c b/drivers/staging/media/omap4iss/iss_csi2.c
index 0e6c5bd81930..43851bbd0cc3 100644
--- a/drivers/staging/media/omap4iss/iss_csi2.c
+++ b/drivers/staging/media/omap4iss/iss_csi2.c
@@ -539,6 +539,9 @@ static int csi2_configure(struct iss_csi2_device *csi2)
 		return -EBUSY;
 
 	pad = media_pad_remote_pad_first(&csi2->pads[CSI2_PAD_SINK]);
+	if (!pad)
+		return -EPIPE;
+
 	sensor = media_entity_to_v4l2_subdev(pad->entity);
 	pdata = sensor->host_priv;
 
-- 
2.25.1


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ