From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by passt.top (Postfix) with ESMTP id 141ED5A0082 for ; Mon, 13 Feb 2023 02:22:11 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1676251331; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=qq2hD1LICZVMD9ygNRY0nASOLQKowbp/a8qgNCWalVM=; b=Vhbx7aigSHrij7H8K1eq/5ig71m3G6WxKcqrFvPI66xlqrngCmZp7Cemweokibh7m3sHUX DF5yxRcaOBYRdIaWPzzmOslRr0NxmvqnPLRvwpY40e0E0EAH/4/qRgS61rd0PAqU0oCAnY mmsVkpPveOZX8UBcsItIuapLZWNlgo4= Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-441-1qHCA7K3O96qSJBJSlc7VA-1; Sun, 12 Feb 2023 20:22:09 -0500 X-MC-Unique: 1qHCA7K3O96qSJBJSlc7VA-1 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.rdu2.redhat.com [10.11.54.1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 3B1563C0DDA9 for ; Mon, 13 Feb 2023 01:22:09 +0000 (UTC) Received: from maya.cloud.tilaa.com (unknown [10.33.32.3]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 1EC81401014C; Mon, 13 Feb 2023 01:22:09 +0000 (UTC) Date: Mon, 13 Feb 2023 02:15:11 +0100 From: Stefano Brivio To: Paul Holzinger Subject: Re: [PATCH] pasta: do not leak netlink sock into child Message-ID: <20230213021511.6c866cef@elisabeth> In-Reply-To: <20230207151046.76157-1-pholzing@redhat.com> References: <20230207151046.76157-1-pholzing@redhat.com> Organization: Red Hat MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.1 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Message-ID-Hash: RSBZV24UQXBWDWQWZYDV2FREQC5YGPJ4 X-Message-ID-Hash: RSBZV24UQXBWDWQWZYDV2FREQC5YGPJ4 X-MailFrom: sbrivio@redhat.com 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.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: On Tue, 7 Feb 2023 16:10:46 +0100 Paul Holzinger wrote: > When spawning a child command with pasta command... pasta should not > leak fds that it opened. Only the fds that were already open should be > given to the child. > > Run `pasta --config-net -- ls -l /proc/self/fd` from a terminal where > only stdin/out/err are open. The fd 3 was opend by ls to read the > /proc/self/fd dir. But fd 5 is the netlink socket that was opend in > pasta. To prevent such a leak we will open the socket with SOCK_CLOEXEC. > > Signed-off-by: Paul Holzinger Applied. -- Stefano