From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from gandalf.ozlabs.org (mail.ozlabs.org [IPv6:2404:9400:2221:ea00::3]) by passt.top (Postfix) with ESMTPS id 3838A5A0268 for ; Fri, 18 Nov 2022 05:59:25 +0100 (CET) Received: by gandalf.ozlabs.org (Postfix, from userid 1007) id 4ND4MC18sXz4xZq; Fri, 18 Nov 2022 15:59:19 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gibson.dropbear.id.au; s=201602; t=1668747559; bh=ZaQdPXl16zJltSOZCxzU/v7hhBy8fKVXpOkBsMyjrf0=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=FfS4YR6+hHJguu5z7rtxs3FPBv4VGRphkYyM+/cdX3FM2fGyr2PyIXEoaCGWf3bH1 bL/0RkKGYNjeUiCaJb/EWiFBnBu8tPUN87RspMN011JZpY3zZ4Ects5HoFvlq1fY7w iyIom+4v7obCCHroTjjmdxW+ADmp6VOE4aVhCfYk= Date: Fri, 18 Nov 2022 12:32:53 +1100 From: David Gibson To: "Richard W.M. Jones" Subject: Re: [PATCH passt v2 4/7] passt, tap: Process data on the socket before HUP/ERR events Message-ID: References: <20221117184938.2270462-1-rjones@redhat.com> <20221117184938.2270462-5-rjones@redhat.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="cpIsC/XEge6jc5qJ" Content-Disposition: inline In-Reply-To: <20221117184938.2270462-5-rjones@redhat.com> Message-ID-Hash: IG5EXL7Y5AQVYD7TDS5AGHRP6COAM4KO X-Message-ID-Hash: IG5EXL7Y5AQVYD7TDS5AGHRP6COAM4KO 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: sbrivio@redhat.com, passt-dev@passt.top X-Mailman-Version: 3.3.3 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: --cpIsC/XEge6jc5qJ Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Nov 17, 2022 at 06:49:35PM +0000, Richard W.M. Jones wrote: > In the case where the client writes a packet and then closes the > socket, because we receive EPOLLIN|EPOLLRDHUP together we have a > choice of whether to close the socket immediately, or read the packet > and then close the socket. Choose the latter. >=20 > This should improve fuzzing coverage and arguably is a better choice > even for regular use since dropping packets on close is bad. >=20 > See-also: https://archives.passt.top/passt-dev/20221117171805.3746f53a@el= isabeth/ > Signed-off-by: Richard W.M. Jones Reviewed-by: David Gibson > --- > tap.c | 6 +++--- > 1 file changed, 3 insertions(+), 3 deletions(-) >=20 > diff --git a/tap.c b/tap.c > index 9998127..d97af6a 100644 > --- a/tap.c > +++ b/tap.c > @@ -1106,13 +1106,13 @@ void tap_handler(struct ctx *c, int fd, uint32_t = events, > return; > } > =20 > - if (events & (EPOLLRDHUP | EPOLLHUP | EPOLLERR)) > - goto reinit; > - > if ((c->mode =3D=3D MODE_PASST && tap_handler_passt(c, now)) || > (c->mode =3D=3D MODE_PASTA && tap_handler_pasta(c, now))) > goto reinit; > =20 > + if (events & (EPOLLRDHUP | EPOLLHUP | EPOLLERR)) > + goto reinit; > + > return; > reinit: > if (c->one_off) { --=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 --cpIsC/XEge6jc5qJ Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEEoULxWu4/Ws0dB+XtgypY4gEwYSIFAmN24L4ACgkQgypY4gEw YSKlPA//ZyhGRaWsWM0riWebrYygBu3hzwrPvqGhfI4M0JBRJuTWH17wm5iBEpxX +rokfr+Gx4hKnLIm6933bIkCxwONenElDQFQtVbA+EEGdEpJj4OcnuX8ywN1/8ZN qNQ4V9VqokgaB8AxWXgV9CjRF7Ac9FyypvTgrwvFnKT+jmBIgGKuhuwQsYc3SMgl O8/wY7GtrHEEp2MFH54xmGlywGNvbYMOY6CkmWkdLZBwr5LrzgTMDW1+GmKteMKp Nozhkb58MGdftf7gFd55wBS5BjXyfNRIsqtyJ9CCSBjg5Rki34J7pq9IhDM0Bk19 zY9l+gCZZb71qGZXG8F1z3e5KaHPvsppMs/Et5HBEd//eeyEwlccDysKZy4UWpdq Xy9kCC+F/Z26YZYzE1sp5AWQSjMeBw/VbV2I5G3RFwO6Mx1cuC/o/DbF8oPon+kC IW+AsCWStc7SuiAYNJ5XmyGXFuFvghY4tbsBpCVFS45M7y2oyAv6tKmpprMVx9Zm ni5ZABiwUpQMiGRjJvklpVp+KNjFVv6/+0qS5rUKphXQZgEII4kHJkZeAUQuZP9c mTsr1GqvwPcyQDAZyeAJXTAPvrWzkwB3go5Hss6ixMEU0f6ckv3v/ELhlMpARkPe Ap2XbOesYCee2m5WKHZsnEq9MnCKkbDdwHI63aeWus5gtd1YM6Y= =KnKf -----END PGP SIGNATURE----- --cpIsC/XEge6jc5qJ--