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] [day] [month] [year] [list]
Message-ID: <d2e0935c-4794-e5de-4baf-7ac7c323eca9@oss.qualcomm.com>
Date: Thu, 16 Oct 2025 16:36:29 +0530
From: Dikshita Agarwal <dikshita.agarwal@....qualcomm.com>
To: Wangao Wang <wangao.wang@....qualcomm.com>,
        vikash.garodia@....qualcomm.com, abhinav.kumar@...ux.dev,
        bod@...nel.org, mchehab@...nel.org
Cc: linux-media@...r.kernel.org, linux-arm-msm@...r.kernel.org,
        linux-kernel@...r.kernel.org, quic_qiweil@...cinc.com,
        quic_renjiang@...cinc.com
Subject: Re: [PATCH v1] media: qcom: iris: Add sanity check for stop streaming



On 10/16/2025 12:55 PM, Wangao Wang wrote:
> Add sanity check in iris_vb2_stop_streaming. If inst->state is
> already IRIS_INST_ERROR, we should skip the stream_off operation
> because it would still send packets to the firmware.
> 
> In iris_vdec_kill_session, inst->state is set to IRIS_INST_ERROR
> and session_close is executed, which will kfree(inst_hfi_gen2->packet).
> If stop_streaming is called afterward, it will cause a crash.
> 
> Signed-off-by: Wangao Wang <wangao.wang@....qualcomm.com>
> ---
>  drivers/media/platform/qcom/iris/iris_vb2.c | 10 +++++++---
>  1 file changed, 7 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/media/platform/qcom/iris/iris_vb2.c b/drivers/media/platform/qcom/iris/iris_vb2.c
> index 139b821f7952..c1647fb4f0cc 100644
> --- a/drivers/media/platform/qcom/iris/iris_vb2.c
> +++ b/drivers/media/platform/qcom/iris/iris_vb2.c
> @@ -231,16 +231,20 @@ void iris_vb2_stop_streaming(struct vb2_queue *q)
>  		return;
>  
>  	mutex_lock(&inst->lock);
> +	if (inst->state == IRIS_INST_ERROR) {
> +		ret = -EBUSY;

ret is only used to trigger a state change to ERROR in this void API. Since
the instance is already in ERROR state, assigning ret = -EBUSY is redundant
and has no functional impact.

Thanks,
Dikshita
> +		goto error;
> +	}
>  
>  	if (!V4L2_TYPE_IS_OUTPUT(q->type) &&
>  	    !V4L2_TYPE_IS_CAPTURE(q->type))
> -		goto exit;
> +		goto error;
>  
>  	ret = iris_session_streamoff(inst, q->type);
>  	if (ret)
> -		goto exit;
> +		goto error;
>  
> -exit:
> +error:
>  	iris_helper_buffers_done(inst, q->type, VB2_BUF_STATE_ERROR);
>  	if (ret)
>  		iris_inst_change_state(inst, IRIS_INST_ERROR);

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ