From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from imap.gmail.com [173.194.76.109] by localhost with POP3 (fetchmail-6.3.26) for (single-drop); Thu, 23 May 2024 03:48:55 +0200 (CEST) Received: by 2002:a05:6a11:2489:b0:55f:c3c0:ed08 with SMTP id sg9csp1026648pxb; Wed, 22 May 2024 18:48:34 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCUKBg5OgLKTs0f9NkNXyPC9PPs/Qr/rjLPhdkby2vwpXjTGn/VDHx+esrISDt3/ZxDo/rxYzHqcjte848SBNgwGSinuxo5imhc= X-Google-Smtp-Source: AGHT+IHd+L/jvXOXQ9OIIsJUWdR8qW+8e/y6vEG0/ltXJPX3Aq2F1Hein2FQKxrxgKxs7jBOfYyp X-Received: by 2002:a25:68d4:0:b0:de4:6f1e:c9bb with SMTP id 3f1490d57ef6-df4e0bccac4mr4116092276.26.1716428914219; Wed, 22 May 2024 18:48:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1716428914; cv=none; d=google.com; s=arc-20160816; b=GmLraxdI5cpMRwE+auoXoK8+yTwxh40gBBWZ71MrImMHZy3AR8FY4hWqeBnHab46Nm RW3Vvkjnc6HxzIp8GDlq3QEGGVSUyTsaE2zDCJcDTUiO+vnygzG13O9ejbQSV+J1fN+y mFWpVJlJgfEpe4yTcNo1myJJOPmpoTLxb8HNNMGphcdStMCstqFhjDWuclDX4aYeHVTE oLTjThVu3LL5KOK7in13enMU+qbHKmJ7tZsI5d8tHhpzAHM2I/dJwdjvkcv3icdT6pKw 6lgsy6URGtgWPq0yhMfUhC3yO2IUcPfQVtcYyPgsRoVE/UFxCC6Bx/Bo1nlcO74VIjYE QVWw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:dkim-signature:delivered-to; bh=LT/i8s65eFs2cYwJtXXQ36HL9omozm/KnxePNzJQjuI=; fh=xYkst1351HdxJpVn+aDOJfMAHrKlAdcbZbZgF6iSq8Q=; b=JpieJ68fg0TJMzFqIEyMj8fHPHe+f1r/YiyC3bQMFSQoQ6oy8pR5w9cRgd2dfI9TWI TyVsza49BK6QM0AlJ+71H/+tw0sYtbfB15JIE0VYE6He1srDPazLv4ahuw5R5Lwaxaug UBb+B8Cjev/lYN6EjRHfzujbgbChh6w8HAzNAhVLR4lf4O6nMD9Qzq1pNLoHM8V5U2ix 46ziaIJEpx1hthJte4UKfU8L6pkKrvFCD+rfuYPp2v3uqliPBxgEKHl5zSB91XTikcQR hwv/AsNjZFDMOGulfhN5szQNV/FUE8/NryPqQXQpWXvHCKbcxWFjoF83ybmFI5dXTay6 14Og==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=temperror (no key for signature) header.i=@gibson.dropbear.id.au header.s=202312 header.b=kieSxalo; spf=pass (google.com: domain of dgibson@gandalf.ozlabs.org designates 150.107.74.76 as permitted sender) smtp.mailfrom=dgibson@gandalf.ozlabs.org Return-Path: Received: from us-smtp-inbound-delivery-1.mimecast.com (us-smtp-delivery-1.mimecast.com. [170.10.128.131]) by mx.google.com with ESMTPS id d75a77b69052e-43e3d3d3034si12946411cf.692.2024.05.22.18.48.33 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 22 May 2024 18:48:33 -0700 (PDT) Received-SPF: pass (google.com: domain of dgibson@gandalf.ozlabs.org designates 150.107.74.76 as permitted sender) client-ip=150.107.74.76; Authentication-Results: mx.google.com; dkim=temperror (no key for signature) header.i=@gibson.dropbear.id.au header.s=202312 header.b=kieSxalo; spf=pass (google.com: domain of dgibson@gandalf.ozlabs.org designates 150.107.74.76 as permitted sender) smtp.mailfrom=dgibson@gandalf.ozlabs.org Received: from mx-prod-mc-03.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-101-Bk4nXufVPCmcUXuSbeobHw-1; Wed, 22 May 2024 21:48:31 -0400 X-MC-Unique: Bk4nXufVPCmcUXuSbeobHw-1 Received: from mx-prod-int-02.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-02.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.15]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 1BE391955F1E for ; Thu, 23 May 2024 01:48:31 +0000 (UTC) Received: by mx-prod-int-02.mail-002.prod.us-west-2.aws.redhat.com (Postfix) id 0AD52197F03A; Thu, 23 May 2024 01:48:31 +0000 (UTC) Received: from mx-prod-mc-05.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-mc-05.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.49]) by mx-prod-int-02.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 0818B197F037 for ; Thu, 23 May 2024 01:48:30 +0000 (UTC) Received: from us-smtp-inbound-delivery-1.mimecast.com (us-smtp-delivery-1.mimecast.com [205.139.110.120]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 6B2B01954B17 for ; Thu, 23 May 2024 01:48:30 +0000 (UTC) Received: from mail.ozlabs.org (gandalf.ozlabs.org [150.107.74.76]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-632-g5Wld_lRPvKNW-Ur-L6AiA-1; Wed, 22 May 2024 21:48:26 -0400 X-MC-Unique: g5Wld_lRPvKNW-Ur-L6AiA-1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gibson.dropbear.id.au; s=202312; t=1716428901; bh=LT/i8s65eFs2cYwJtXXQ36HL9omozm/KnxePNzJQjuI=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=kieSxaloCmBdmMrShWU1NFbJRsYu54Z2COwowThd9QQ+gtiQFDAsRyHGpUIgb68S4 SoLPx+9oHsC0hvTTWAvUi7UGr2HUwzGy+eisOay/VGzxv5A8sYygzbjrMQEzKv/IwQ YG16UemJ9SAeI2/JVOs0Owf3G9jefLaAjlSAiPDGL2FvI6aYLro0o2SN2KmZB9JLjF dPEqa8Q2ntD6ukeTAnF/YUfawWAskhZT+MN5MNRwH/173Jbpw87JFa/EAQ5dVuKhMB VfF7TnyXPxO/USUINOcNHGxLPVhm+MXa1Qok2eobge74lMtAdHqwCx3V2kVCs/G9iQ NPJYIC6S+qb1Q== Received: by gandalf.ozlabs.org (Postfix, from userid 1007) id 4VlB050mCvz4wx5; Thu, 23 May 2024 11:48:21 +1000 (AEST) Date: Thu, 23 May 2024 11:48:16 +1000 From: David Gibson To: Stefano Brivio Cc: passt-dev@passt.top, "'Richard W . M . Jones'" , Minxi Hou Subject: Re: [PATCH 3/8] passt, tap: Don't use -1 as uninitialised value for fd_tap_listen Message-ID: References: <20240522205911.261325-1-sbrivio@redhat.com> <20240522205911.261325-4-sbrivio@redhat.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="E6u6s9DUVNiVFUK0" Content-Disposition: inline In-Reply-To: <20240522205911.261325-4-sbrivio@redhat.com> X-Scanned-By: MIMEDefang 3.0 on 10.30.177.15 List-Id: --E6u6s9DUVNiVFUK0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, May 22, 2024 at 10:59:06PM +0200, Stefano Brivio wrote: > This is a remnant from the time we kept access to the original > filesystem and we could reinitialise the listening AF_UNIX socket. >=20 > Since commit 0515adceaa8f ("passt, pasta: Namespace-based sandboxing, > defer seccomp policy application"), however, we can't re-bind the > listening socket once we're up and running. >=20 > Drop the -1 initalisation and the corresponding check. >=20 > Signed-off-by: Stefano Brivio Reviewed-by: David Gibson > --- > passt.c | 2 +- > tap.c | 3 +-- > 2 files changed, 2 insertions(+), 3 deletions(-) >=20 > diff --git a/passt.c b/passt.c > index 771b8a7..1df1dc4 100644 > --- a/passt.c > +++ b/passt.c > @@ -211,7 +211,7 @@ int main(int argc, char **argv) > =20 > isolate_initial(); > =20 > - c.pasta_netns_fd =3D c.fd_tap =3D c.fd_tap_listen =3D -1; > + c.pasta_netns_fd =3D c.fd_tap =3D -1; > =20 > sigemptyset(&sa.sa_mask); > sa.sa_flags =3D 0; > diff --git a/tap.c b/tap.c > index 177fe26..cb6df5a 100644 > --- a/tap.c > +++ b/tap.c > @@ -1304,8 +1304,7 @@ void tap_sock_init(struct ctx *c) > } > =20 > if (c->mode =3D=3D MODE_PASST) { > - if (c->fd_tap_listen =3D=3D -1) > - tap_sock_unix_init(c); > + tap_sock_unix_init(c); > =20 > /* In passt mode, we don't know the guest's MAC address until it > * sends us packets. Use the broadcast address so that our --=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 --E6u6s9DUVNiVFUK0 Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEEO+dNsU4E3yXUXRK2zQJF27ox2GcFAmZOoF8ACgkQzQJF27ox 2GeXOQ//X77zJDZYxb9LbDgjU/9yQTazMZ3QP44wm5kUw+VtMVGQzm4erdpjigjE l+dJUpg0WWwaRTvJZR8EXfFNwD+dla7E8EeKB8A8Dtt/LjMG8AvUol93e6pXzU8O WqDwgl2LzzPIZBoPtj9nlp8Zh7mHKdl4wIU5Ajx7xg0YL8vm8oZdTMM79bix0RqG aqVyFvm05XkWlhyInGt++zFIphCoB/FJl8CHCfozFPBL/hMQMSEiN3IiuzzbnJWV DlhCPoIJJTWnXOJjR3Pu7u+pzhHlXzFvCXD0DuuiRpTmeVcuFtTtZbw7Mfivrh9j f3bPd/nKcsMkgtNP8nHNbjgHrRYN2EcLiRGzvUH1ANq+Vg1EKdWRgPkr+gKjjQ6D JNY8couSHXm9quIOrOnsAbQL5MYGw6LcT/RRtfxIYGkvU4ZN6tabAIE5mOjy3S9P uvqCmQPDHjnl7hr51SSt1ya5AFnTgr+OiIcvHPZUetI2MgPHPXgsAKb+4w2U5ScQ F6idl2+2uy1w2ne1IiHdTJgZUkJZNbv0rszhqDS52ZHxh0lzRRiWiH1kiPWXx22v ny8xHmYL5OMMs06BSqru827QHMlGYaeUsLj0FG/lJyPOQ72NIxF1zjZsXtkxoMXk VIMigKBH0Ryi1YMPbMv6TFXfOFUN7xCG/6yRfaA4QNUUYd6BkqY= =SQHG -----END PGP SIGNATURE----- --E6u6s9DUVNiVFUK0--