From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100]) by master.gitmailbox.com (Postfix) with ESMTP id 87A00401F8 for ; Mon, 21 Mar 2022 18:54:44 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id B5AB668A54D; Mon, 21 Mar 2022 20:54:41 +0200 (EET) Received: from relay7-d.mail.gandi.net (relay7-d.mail.gandi.net [217.70.183.200]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 89652680545 for ; Mon, 21 Mar 2022 20:54:34 +0200 (EET) Received: from localhost (213-47-68-29.cable.dynamic.surfer.at [213.47.68.29]) (Authenticated sender: michael@niedermayer.cc) by mail.gandi.net (Postfix) with ESMTPSA id 6439120005 for ; Mon, 21 Mar 2022 18:54:32 +0000 (UTC) Date: Mon, 21 Mar 2022 19:54:31 +0100 From: Michael Niedermayer To: FFmpeg development discussions and patches Message-ID: <20220321185431.GK2829255@pb2> References: <20220318174621.26974-1-michael@niedermayer.cc> <20220319173808.GA2829255@pb2> MIME-Version: 1.0 In-Reply-To: <20220319173808.GA2829255@pb2> Subject: Re: [FFmpeg-devel] [PATCH] avcodec/vp9_superframe_split_bsf: Check in size X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: FFmpeg development discussions and patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: FFmpeg development discussions and patches Content-Type: multipart/mixed; boundary="===============2997820981371367804==" Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: --===============2997820981371367804== Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="okFjbHNyxaMi/iVC" Content-Disposition: inline --okFjbHNyxaMi/iVC Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sat, Mar 19, 2022 at 06:38:08PM +0100, Michael Niedermayer wrote: > On Fri, Mar 18, 2022 at 06:56:19PM +0100, Andreas Rheinhardt wrote: > > Michael Niedermayer: > > > Fixes: Out of array read > > > Fixes: 45137/clusterfuzz-testcase-minimized-ffmpeg_BSF_VP9_SUPERFRAME= _SPLIT_fuzzer-4984270639202304 > > >=20 > > > Found-by: continuous fuzzing process https://github.com/google/oss-fu= zz/tree/master/projects/ffmpeg > > > Signed-off-by: Michael Niedermayer > > > --- > > > libavcodec/vp9_superframe_split_bsf.c | 2 +- > > > 1 file changed, 1 insertion(+), 1 deletion(-) > > >=20 > > > diff --git a/libavcodec/vp9_superframe_split_bsf.c b/libavcodec/vp9_s= uperframe_split_bsf.c > > > index ed0444561a..481484a4f0 100644 > > > --- a/libavcodec/vp9_superframe_split_bsf.c > > > +++ b/libavcodec/vp9_superframe_split_bsf.c > > > @@ -51,7 +51,7 @@ static int vp9_superframe_split_filter(AVBSFContext= *ctx, AVPacket *out) > > > return ret; > > > in =3D s->buffer_pkt; > > > =20 > > > - marker =3D in->data[in->size - 1]; > > > + marker =3D in->size ? in->data[in->size - 1] : 0; > > > if ((marker & 0xe0) =3D=3D 0xc0) { > > > int length_size =3D 1 + ((marker >> 3) & 0x3); > > > int nb_frames =3D 1 + (marker & 0x7); > >=20 > > There is a second place in this BSF where data might be read in the > > absence of data, namely if one of the frames in a superframe have size > > of zero (its attempted to read its profile; no actual read takes place > > due to the checks of the get_bits API, but it is nevertheless invalid > > data). See > > https://patchwork.ffmpeg.org/project/ffmpeg/patch/20200530160541.29517-= 7-andreas.rheinhardt@gmail.com/; The get bits API checks for NULL data, if data is not NULL it must be padded even when size is 0. Nothing against the 2nd check, but thats a seperate issue > > also see > > https://patchwork.ffmpeg.org/project/ffmpeg/patch/20200530160541.29517-= 11-andreas.rheinhardt@gmail.com/ please apply your bugfixes! especially if its about out or array accesses > > and > > https://patchwork.ffmpeg.org/project/ffmpeg/patch/20200530160541.29517-= 1-andreas.rheinhardt@gmail.com/ thats now found by the fuzzer too, in 45722 if you dont apply your fix i will post a fix thx [...] --=20 Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB The day soldiers stop bringing you their problems is the day you have stopp= ed=20 leading them. They have either lost confidence that you can help or conclud= ed=20 you do not care. Either case is a failure of leadership. - Colin Powell --okFjbHNyxaMi/iVC Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iF0EABEIAB0WIQSf8hKLFH72cwut8TNhHseHBAsPqwUCYjjJ5AAKCRBhHseHBAsP q/nHAJ4+zYcnAZCIav7XSm4/ADeRCqiS+wCeLPBut8enyQGl49iO9Q5jQSjP16Y= =zb3r -----END PGP SIGNATURE----- --okFjbHNyxaMi/iVC-- --===============2997820981371367804== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe". --===============2997820981371367804==--