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: <f343f406-111b-326f-3671-094e699a3aa6@collabora.com>
Date:   Fri, 6 Aug 2021 09:48:39 +0200
From:   Dafna Hirschfeld <dafna.hirschfeld@...labora.com>
To:     Irui Wang (王瑞) <Irui.Wang@...iatek.com>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
        "linux-media@...r.kernel.org" <linux-media@...r.kernel.org>,
        "linux-mediatek@...ts.infradead.org" 
        <linux-mediatek@...ts.infradead.org>
Cc:     "dafna3@...il.com" <dafna3@...il.com>,
        "tfiga@...omium.org" <tfiga@...omium.org>,
        Tiffany Lin (林慧珊) 
        <tiffany.lin@...iatek.com>,
        "eizan@...omium.org" <eizan@...omium.org>,
        Maoguang Meng (孟毛广) 
        <Maoguang.Meng@...iatek.com>,
        "kernel@...labora.com" <kernel@...labora.com>,
        "mchehab@...nel.org" <mchehab@...nel.org>,
        "hverkuil@...all.nl" <hverkuil@...all.nl>,
        Yunfei Dong (董云飞) 
        <Yunfei.Dong@...iatek.com>,
        Yong Wu (吴勇) <Yong.Wu@...iatek.com>,
        "hsinyi@...omium.org" <hsinyi@...omium.org>,
        "matthias.bgg@...il.com" <matthias.bgg@...il.com>,
        Andrew-CT Chen (陳智迪) 
        <Andrew-CT.Chen@...iatek.com>,
        "acourbot@...omium.org" <acourbot@...omium.org>
Subject: Re: [PATCH 4/5] media: mtk-vcodec: Add two error cases upon vpu irq
 handling



On 06.08.21 08:58, Irui Wang (王瑞) wrote:
> On Wed, 2021-08-04 at 16:27 +0200, Dafna Hirschfeld wrote:
>> 1. Fail if the function mtk_vcodec_fw_map_dm_addr
>> returns ERR pointer.
>> 2. Fail if the state from the vpu msg is either
>> VEN_IPI_MSG_ENC_STATE_ERROR or VEN_IPI_MSG_ENC_STATE_PART
>>
>> Signed-off-by: Dafna Hirschfeld <dafna.hirschfeld@...labora.com>
>> ---
>>   drivers/media/platform/mtk-vcodec/venc_vpu_if.c | 8 ++++++++
>>   1 file changed, 8 insertions(+)
>>
>> diff --git a/drivers/media/platform/mtk-vcodec/venc_vpu_if.c
>> b/drivers/media/platform/mtk-vcodec/venc_vpu_if.c
>> index 32dc844d16f9..234705ba7cd6 100644
>> --- a/drivers/media/platform/mtk-vcodec/venc_vpu_if.c
>> +++ b/drivers/media/platform/mtk-vcodec/venc_vpu_if.c
>> @@ -17,6 +17,8 @@ static int handle_enc_init_msg(struct venc_vpu_inst
>> *vpu, const void *data)
>>   	vpu->vsi = mtk_vcodec_fw_map_dm_addr(vpu->ctx->dev->fw_handler,
>>   					     msg->vpu_inst_addr);
>>   
>> +	if (IS_ERR(vpu->vsi))
>> +		return PTR_ERR(vpu->vsi);
>>   	/* Firmware version field value is unspecified on MT8173. */
>>   	if (vpu->ctx->dev->venc_pdata->chip == MTK_MT8173)
>>   		return 0;
>> @@ -42,6 +44,12 @@ static int handle_enc_encode_msg(struct
>> venc_vpu_inst *vpu, const void *data)
>>   	vpu->state = msg->state;
>>   	vpu->bs_size = msg->bs_size;
>>   	vpu->is_key_frm = msg->is_key_frm;
>> +	if (vpu->state == VEN_IPI_MSG_ENC_STATE_ERROR ||
>> +	    vpu->state == VEN_IPI_MSG_ENC_STATE_PART) {
>> +		mtk_vcodec_err(vpu, "bad ipi-enc-state: %s",
>> +			       vpu->state ==
>> VEN_IPI_MSG_ENC_STATE_ERROR ? "ERR" : "PART");
>> +		return -EINVAL;
>> +	}
> 
> Hi Dafna,
> 
> This state check is useless, the enc result will check in
> "vpu_enc_ipi_handler".
> 

Hi, thanks for reviewing. I see that the vpu_enc_ipi_handler only test the msg->status
and I see that the states are not tested anywhere except of "skip" state in the h264 enc.

Can't there be a scenario where msg->status is ok but the state is error?
I am testing the vp8 encoder on chromeos and at some point the encoder interrupts stop arriving
so I try to figure out why and report any possible error.

Thanks,
Dafna

> Thanks
> 
>>   	return 0;
>>   }
>>   

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ