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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <d101876a72e6248c77ee5de0d1dc52687e225629.camel@mediatek.com>
Date:   Wed, 18 May 2022 20:06:48 +0800
From:   "yunfei.dong@...iatek.com" <yunfei.dong@...iatek.com>
To:     Hans Verkuil <hverkuil-cisco@...all.nl>,
        Alexandre Courbot <acourbot@...omium.org>,
        Nicolas Dufresne <nicolas@...fresne.ca>,
        AngeloGioacchino Del Regno 
        <angelogioacchino.delregno@...labora.com>,
        Benjamin Gaignard <benjamin.gaignard@...labora.com>,
        Tiffany Lin <tiffany.lin@...iatek.com>,
        Andrew-CT Chen <andrew-ct.chen@...iatek.com>,
        Mauro Carvalho Chehab <mchehab@...nel.org>,
        Rob Herring <robh+dt@...nel.org>,
        Matthias Brugger <matthias.bgg@...il.com>,
        Tomasz Figa <tfiga@...gle.com>
CC:     George Sun <george.sun@...iatek.com>,
        Xiaoyong Lu <xiaoyong.lu@...iatek.com>,
        Hsin-Yi Wang <hsinyi@...omium.org>,
        "Fritz Koenig" <frkoenig@...omium.org>,
        Daniel Vetter <daniel@...ll.ch>,
        dri-devel <dri-devel@...ts.freedesktop.org>,
        Irui Wang <irui.wang@...iatek.com>,
        "Steve Cho" <stevecho@...omium.org>, <linux-media@...r.kernel.org>,
        <devicetree@...r.kernel.org>, <linux-kernel@...r.kernel.org>,
        <linux-arm-kernel@...ts.infradead.org>,
        <linux-mediatek@...ts.infradead.org>,
        <Project_Global_Chrome_Upstream_Group@...iatek.com>
Subject: Re: [PATCH v6, 6/7] media: mediatek: vcodec: prevent kernel crash
 when scp ipi timeout

Dear Hans,

Thanks for your suggestion.

On Wed, 2022-05-18 at 13:34 +0200, Hans Verkuil wrote:
> 
> On 5/18/22 13:29, yunfei.dong@...iatek.com wrote:
> > Dear Hans,
> > 
> > Thanks for your review.
> > On Wed, 2022-05-18 at 11:37 +0200, Hans Verkuil wrote:
> > > Hi Yunfei,
> > > 
> > > On 5/13/22 11:25, Yunfei Dong wrote:
> > > > When SCP timeout during playing video, kernel crashes with
> > > > following
> > > > message. It's caused by accessing NULL pointer in
> > > > vpu_dec_ipi_handler.
> > > > This patch doesn't solve the root cause of NULL pointer, but
> > > > merely
> > > > prevent kernel crashed when encounter the NULL pointer.
> > > 
> > > Is the root cause being addressed as well? Where is the root
> > > cause?
> > > Is it
> > > in this driver or in the scp (i.e. the remoteproc) driver?
> > > 
> > > I need a bit more information to decide whether this series is
> > > ready
> > > to
> > > be merged for 5.20 or not.
> > > 
> > > Regards,
> > > 
> > > 	Hans
> > > 
> > 
> > Vpu will be NUll when scp(micro processor) is hang or crash. Need
> > to
> > keep kernel works well , so add this patch.
> 
> OK, I think this should be stated in the commit log, and also in the
> code
> (see below).
> 
> > 
> > Best Regards,
> > Yunfei Dong
> 
> <snip>
> 
> > > > diff --git
> > > > a/drivers/media/platform/mediatek/vcodec/vdec_vpu_if.c
> > > > b/drivers/media/platform/mediatek/vcodec/vdec_vpu_if.c
> > > > index 35f4d5583084..1041dd663e76 100644
> > > > --- a/drivers/media/platform/mediatek/vcodec/vdec_vpu_if.c
> > > > +++ b/drivers/media/platform/mediatek/vcodec/vdec_vpu_if.c
> > > > @@ -91,6 +91,11 @@ static void vpu_dec_ipi_handler(void *data,
> > > > unsigned int len, void *priv)
> > > >  	struct vdec_vpu_inst *vpu = (struct vdec_vpu_inst *)
> > > >  					(unsigned long)msg-
> > > > > ap_inst_addr;
> > > > 
> > > >  
> > > > +	if (!vpu) {
> > > > +		mtk_v4l2_err("ap_inst_addr is NULL");
> 
> E.g., either add a comment here or perhaps change the error message
> to:
> 
> "ap_inst_addr is NULL, did the SCP hang?"
> 
> Or something along those lines.
> 
I will change the message in next patch like below.

mtk_v4l2_err("ap_inst_addr is NULL, did the SCP hang or crash?");

> Shouldn't there be a \n at the end of this message as well? Or does
> mtk_v4l2_err add that?
> 
mtk_v4l2_err add '\n' in the end.
> Regards,
> 
> 	Hans
> 
Best Regards,
Yunfei Dong
> > > > +		return;
> > > > +	}
> > > > +
> > > >  	mtk_vcodec_debug(vpu, "+ id=%X", msg->msg_id);
> > > >  
> > > >  	vpu->failure = msg->status;

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ