From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from gandalf.ozlabs.org (gandalf.ozlabs.org [150.107.74.76]) by passt.top (Postfix) with ESMTPS id 3FFEA5A0271 for ; Wed, 9 Aug 2023 11:57:26 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gibson.dropbear.id.au; s=201602; t=1691575040; bh=RA/ZxWuESMPlG0nw/rtrWFypliT5fD5O2oBEN9QB7pk=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=mcPDTNKRA8GnuEh94fP8/qlTK4enJI/QoaorXz5mD+rW66OVyQRJ+rIX4EOSYOBsK Tm+an5hhKkgY3a4IHLuOwJklEZ7ohu1iOgk2jnyV77m1Lhu6elxuf5/7hONpHW07H4 ZmFcHR5Z/55nlSKYUvfATZLNnI3SorojhSZ+Chu0= Received: by gandalf.ozlabs.org (Postfix, from userid 1007) id 4RLQTD4nTGz4wxn; Wed, 9 Aug 2023 19:57:20 +1000 (AEST) Date: Wed, 9 Aug 2023 19:54:58 +1000 From: David Gibson To: Laurent Vivier Subject: Re: [PATCH] tap: fix seq->p.count limit Message-ID: References: <20230809092342.2299907-1-lvivier@redhat.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="wfWIuob7mhcf54HP" Content-Disposition: inline In-Reply-To: <20230809092342.2299907-1-lvivier@redhat.com> Message-ID-Hash: RLZAXXVDDBMISPRLFWD33Y23GTMDA5Z2 X-Message-ID-Hash: RLZAXXVDDBMISPRLFWD33Y23GTMDA5Z2 X-MailFrom: dgibson@gandalf.ozlabs.org X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: passt-dev@passt.top X-Mailman-Version: 3.3.8 Precedence: list List-Id: Development discussion and patches for passt Archived-At: Archived-At: List-Archive: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: --wfWIuob7mhcf54HP Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Aug 09, 2023 at 11:23:42AM +0200, Laurent Vivier wrote: > The number of items in pool_l4_t is defined to UIO_MAXIOV, > not TAP_SEQS. TAP_SEQS is the number of the messages. >=20 > Fix the value used to compare seq->p.count with. >=20 > Fix: bb708111833e ("treewide: Packet abstraction with mandatory boundary = checks") > Signed-off-by: Laurent Vivier Reviewed-by: David Gibson > --- > tap.c | 8 ++++---- > 1 file changed, 4 insertions(+), 4 deletions(-) >=20 > diff --git a/tap.c b/tap.c > index e034f9468267..69bd19a2a91a 100644 > --- a/tap.c > +++ b/tap.c > @@ -678,7 +678,7 @@ resume: > seq->daddr.s_addr =3D iph->daddr; \ > } while (0) > =20 > - if (seq && L4_MATCH(iph, uh, seq) && seq->p.count < TAP_SEQS) > + if (seq && L4_MATCH(iph, uh, seq) && seq->p.count < UIO_MAXIOV) > goto append; > =20 > if (seq_count =3D=3D TAP_SEQS) > @@ -686,7 +686,7 @@ resume: > =20 > for (seq =3D tap4_l4 + seq_count - 1; seq >=3D tap4_l4; seq--) { > if (L4_MATCH(iph, uh, seq)) { > - if (seq->p.count >=3D TAP_SEQS) > + if (seq->p.count >=3D UIO_MAXIOV) > seq =3D NULL; > break; > } > @@ -840,7 +840,7 @@ resume: > } while (0) > =20 > if (seq && L4_MATCH(ip6h, proto, uh, seq) && > - seq->p.count < TAP_SEQS) > + seq->p.count < UIO_MAXIOV) > goto append; > =20 > if (seq_count =3D=3D TAP_SEQS) > @@ -848,7 +848,7 @@ resume: > =20 > for (seq =3D tap6_l4 + seq_count - 1; seq >=3D tap6_l4; seq--) { > if (L4_MATCH(ip6h, proto, uh, seq)) { > - if (seq->p.count >=3D TAP_SEQS) > + if (seq->p.count >=3D UIO_MAXIOV) > seq =3D NULL; > break; > } --=20 David Gibson | I'll have my music baroque, and my code david AT gibson.dropbear.id.au | minimalist, thank you. NOT _the_ _other_ | _way_ _around_! http://www.ozlabs.org/~dgibson --wfWIuob7mhcf54HP Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEEO+dNsU4E3yXUXRK2zQJF27ox2GcFAmTTYkcACgkQzQJF27ox 2GfDSw//dQxCtNOfxCVoVmDWonHAaf04fDewIJncTaWL23rDjBMPAmYj6L36RRsJ TTq17itrbWcMNnIb+jLvlRtSYYbxpUpfW+8n0HFKAzxtgDAo3K9N6uxJDBog3hIo zzWJBjvlIibmkWmxoghv8ELjdxPZkyO+B5ew6Flkv/KJBdHRHV6CHJzTo9Q0pQ69 tsMbCo0sJpVEkKSE7V0W7UaB0wUmbAZxTMzA/lL8+Y/m8O2kAXbBQTdPByNWrdzS wKeOZG2yJDkmCPafmQo6oICsA6G835I0PsptALwad1Oo8YYB4L/8yaQpjDbiIrMN awamLTVPp653NV90kbZOYofpblVEVoNuCFgI7Z2BRM1G2AJNmha0ZW3sPK+92feh 6BtNEXtCDk7mzXzGHXRf2kMzOcp0UNV0DVr6bX26A7LQkOjQkCT7W/89vjqKCP2c 6Qtk74FMj++2faATQ9JFRLXTPohv8MiZkRcni04cjmQSK1Ruw6+h7RaRTox8rhPq JW/DzPzqo8mHzmaaKTsjX17yyNa2BIHZx450cwZpxeRCUHA2UooxgqNpVJURMMSo MF726L0z+ZMtunW9enQSkQ19vruwv9lbxqkGvUpvgfpSBhcb4rlOtLWn69QHft0R WN3QPfKprqrWxnHlcgCE6Fu/2ajbgjEJDFyHrtUvO+OQ5FuvUZA= =cY5U -----END PGP SIGNATURE----- --wfWIuob7mhcf54HP--