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-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20260207212723.GN1376807@killaraus.ideasonboard.com>
Date: Sat, 7 Feb 2026 23:27:23 +0200
From: Laurent Pinchart <laurent.pinchart@...asonboard.com>
To: Alper Ak <alperyasinak1@...il.com>
Cc: Lad Prabhakar <prabhakar.mahadev-lad.rj@...renesas.com>,
	Mauro Carvalho Chehab <mchehab@...nel.org>,
	Hans Verkuil <hverkuil+cisco@...nel.org>,
	Tommaso Merciai <tommaso.merciai.xr@...renesas.com>,
	Daniel Scally <dan.scally+renesas@...asonboard.com>,
	Jacopo Mondi <jacopo.mondi@...asonboard.com>,
	Biju Das <biju.das.jz@...renesas.com>, linux-media@...r.kernel.org,
	linux-kernel@...r.kernel.org
Subject: Re: [PATCH] media: rzg2l-cru: Fix possible ERR_PTR deference

On Sat, Feb 07, 2026 at 12:48:39PM +0300, Alper Ak wrote:
> The media_pad_remote_pad_unique() can return ERR_PTR() on failure
> (-ENOTUNIQ or -ENOLINK), but the code was dereferencing the return
> value without checking for errors. Add IS_ERR() check before
> dereferencing the pointer.

Have you seen this happening ?

> Fixes: d7d72dae81d5 ("media: rzg2l-cru: Retrieve virtual channel information")
> Signed-off-by: Alper Ak <alperyasinak1@...il.com>
> ---
>  drivers/media/platform/renesas/rzg2l-cru/rzg2l-video.c | 6 ++++++
>  1 file changed, 6 insertions(+)
> 
> diff --git a/drivers/media/platform/renesas/rzg2l-cru/rzg2l-video.c b/drivers/media/platform/renesas/rzg2l-cru/rzg2l-video.c
> index 162e2ace6931..a34c2188df1a 100644
> --- a/drivers/media/platform/renesas/rzg2l-cru/rzg2l-video.c
> +++ b/drivers/media/platform/renesas/rzg2l-cru/rzg2l-video.c
> @@ -411,6 +411,12 @@ static int rzg2l_cru_get_virtual_channel(struct rzg2l_cru_dev *cru)
>  	int ret;
>  
>  	remote_pad = media_pad_remote_pad_unique(&cru->ip.pads[RZG2L_CRU_IP_SINK]);
> +	if (IS_ERR(remote_pad)) {
> +		ret = PTR_ERR(remote_pad);
> +		dev_err(cru->dev, "Failed to get remote source pad: %d\n", ret);
> +		return ret;
> +	}
> +
>  	ret = v4l2_subdev_call(cru->ip.remote, pad, get_frame_desc, remote_pad->index, &fd);
>  	if (ret < 0 && ret != -ENOIOCTLCMD) {
>  		dev_err(cru->dev, "get_frame_desc failed on IP remote subdev\n");

-- 
Regards,

Laurent Pinchart

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ