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 8447E4265A for ; Mon, 21 Mar 2022 21:12:53 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 03BDF68AEAF; Mon, 21 Mar 2022 23:12:52 +0200 (EET) Received: from relay11.mail.gandi.net (relay11.mail.gandi.net [217.70.178.231]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id AEEB568B192 for ; Mon, 21 Mar 2022 23:12:45 +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 0FCD0100002 for ; Mon, 21 Mar 2022 21:12:44 +0000 (UTC) Date: Mon, 21 Mar 2022 22:12:44 +0100 From: Michael Niedermayer To: FFmpeg development discussions and patches Message-ID: <20220321211244.GP2829255@pb2> References: <20220318174621.26974-1-michael@niedermayer.cc> <20220319173808.GA2829255@pb2> <20220321185431.GK2829255@pb2> MIME-Version: 1.0 In-Reply-To: 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="===============8320221409458430315==" Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: --===============8320221409458430315== Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="YmspTQxCerTCwQ6z" Content-Disposition: inline --YmspTQxCerTCwQ6z Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Mar 21, 2022 at 09:59:00PM +0100, Andreas Rheinhardt wrote: > Michael Niedermayer: > > 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_SUPERFRAM= E_SPLIT_fuzzer-4984270639202304 > >>>> > >>>> Found-by: continuous fuzzing process https://github.com/google/oss-f= uzz/tree/master/projects/ffmpeg > >>>> Signed-off-by: Michael Niedermayer > >>>> --- > >>>> libavcodec/vp9_superframe_split_bsf.c | 2 +- > >>>> 1 file changed, 1 insertion(+), 1 deletion(-) > >>>> > >>>> diff --git a/libavcodec/vp9_superframe_split_bsf.c b/libavcodec/vp9_= superframe_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(AVBSFContex= t *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); > >>> > >>> 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.2951= 7-7-andreas.rheinhardt@gmail.com/; > >=20 > > The get bits API checks for NULL data, if data is not NULL it must be p= added > > even when size is 0. > > Nothing against the 2nd check, but thats a seperate issue >=20 > I know that there is no invalid read (and said as much) I read what you wrote to quick, i missed this >=20 > >=20 > >=20 > >>> also see > >>> https://patchwork.ffmpeg.org/project/ffmpeg/patch/20200530160541.2951= 7-11-andreas.rheinhardt@gmail.com/ > >=20 > > please apply your bugfixes! especially if its about out or array access= es > >=20 >=20 > Will do. thx [...] --=20 Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB Why not whip the teacher when the pupil misbehaves? -- Diogenes of Sinope --YmspTQxCerTCwQ6z Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iF0EABEIAB0WIQSf8hKLFH72cwut8TNhHseHBAsPqwUCYjjqTAAKCRBhHseHBAsP q4+OAJ4k2kA31E8Nd9XWK6owY9cl8aEaUwCfU71Gf6TUQtMSCpXlmz8yxOuWLc4= =IJw0 -----END PGP SIGNATURE----- --YmspTQxCerTCwQ6z-- --===============8320221409458430315== 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". --===============8320221409458430315==--