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.133.124]) by passt.top (Postfix) with ESMTP id 67EBD5A0082 for ; Wed, 8 Feb 2023 14:01:28 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1675861286; 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=6IwIMC1WdaM+BmLrlSyh+TONRu/oNrmdn0748RYma8s=; b=GxtBOjRfJ+RUb5LZxHGE8NPkUptIS/cpY2IJhfVW0uF7OTNHMoEx++SKMeLfdzFko5clFk sUaYo6bJR0uNhzV+voNYs6Rs5uK4p2S9gWnY9glFUmnriBFAGOgTX5CPGpufj+VenMNiO3 vDZZC9LyTqPMX35S9c4e8ODawlhN2zU= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-510-4au3RKo6OtSTSvZfRMYK-g-1; Wed, 08 Feb 2023 08:01:22 -0500 X-MC-Unique: 4au3RKo6OtSTSvZfRMYK-g-1 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.rdu2.redhat.com [10.11.54.7]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 5D024100F90B for ; Wed, 8 Feb 2023 13:01:22 +0000 (UTC) Received: from maya.cloud.tilaa.com (ovpn-208-4.brq.redhat.com [10.40.208.4]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 31B54140EBF4; Wed, 8 Feb 2023 13:01:22 +0000 (UTC) Date: Wed, 8 Feb 2023 14:00:59 +0100 From: Stefano Brivio To: Paul Holzinger Subject: Re: [PATCH] pasta: do not leak netlink sock into child Message-ID: <20230208140059.7962d8dd@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.7 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Message-ID-Hash: 6LDXN4MJPCIZOYMOSMR2KW6MXKUI6DVX X-Message-ID-Hash: 6LDXN4MJPCIZOYMOSMR2KW6MXKUI6DVX 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 Thanks for the patch, and welcome to the git log! I'll push this out in a bit (still sorting some unrelated test failures first). -- Stefano