From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: passt.top; dmarc=pass (p=quarantine dis=none) header.from=redhat.com Authentication-Results: passt.top; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=UQ49FuBc; dkim-atps=neutral Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by passt.top (Postfix) with ESMTPS id 783C45A0262 for ; Sun, 29 Mar 2026 14:02:34 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1774785753; 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=7GqDYClk5xC7GsALa6YF+86RnpSIjaQCeeofbGFSTJo=; b=UQ49FuBcv5Bs3y6cmewlVvImDRMwsTpTkx0zm+622GmkRXN3GZUWI0sSBYlDJsDYwkXC+/ 1TwrcZLD4vwFSXGKAA3eK1l5hBkJsP6042egjm8DuwsJBt1I2bvrJtqf6TwCh0dvi71mql 19t7Xi95goJANkdmhf7UZ5//56FNCtg= Received: from mail-wm1-f71.google.com (mail-wm1-f71.google.com [209.85.128.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-498-OAJcG-GJN2WSK5BhUfICbg-1; Sun, 29 Mar 2026 08:02:31 -0400 X-MC-Unique: OAJcG-GJN2WSK5BhUfICbg-1 X-Mimecast-MFC-AGG-ID: OAJcG-GJN2WSK5BhUfICbg_1774785750 Received: by mail-wm1-f71.google.com with SMTP id 5b1f17b1804b1-48535f4d5e1so40594345e9.0 for ; Sun, 29 Mar 2026 05:02:31 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1774785749; x=1775390549; h=date:content-transfer-encoding:mime-version:organization:references :in-reply-to:message-id:subject:cc:to:from:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=7GqDYClk5xC7GsALa6YF+86RnpSIjaQCeeofbGFSTJo=; b=c6UJXLxoClGAsbBDybFiTvHinJnLgC5iE1xRrIlR0Q86dWXkt5ieKh55PJVtP1MpaI MtgtRfZZTTL7psIhjoQ+TR6as2oZzFqysZGuEGXiokQpkR6HO2Nyi1o9zQiJwd76jgOG TAM4EiKqVaT0qyQCBoHQ2Nfs560L3/pZ+iXgqzMsp7EnGgfnpQPDbOIUpBgLnuHjbZt2 8TKuyD9Zxzbn3ANuqGU8lAPmzZbOTVPAQBJMQsdxBF2X1OFViHNv+dZDxcmAvgtiJOjc VScdwRru1lo/rZa78M9eULBt2d26XERoWPHPKsrYmWnfuQrdmjmVhvux+FANBE/7z1Sv U9mw== X-Gm-Message-State: AOJu0YyWXOyyqanbgYbX/lnOiWoaeogP37Z3a9U88OFnUnA9/2Vnyjjz h4V2ltV9ECqpJIrzL6mhiZ0edOHtmeF1b4STqmCOwCacyhIdOAwbg7I4NqZMtKJkq8H792orOqR l0a7YsCDB7mIRlUFJuIN1asGZGESFbLgtBinM0XrJcbcV1ZEwukXs029yf7qhLBJb X-Gm-Gg: ATEYQzyqEiu+hT8GgYzE55xq5zV+t0Kzq8kg4L2Kc4/eSJG5yeNZukJ3yphKJQsQ6K0 qATeCkhD32Z/1QVgGMyzP6PHYb0Nklvr+Si0vj/19M3i1q/9IALcF2Ph8dgwimqOLkN4EbZZpKJ aWBGh6kjEPKXm9sNjK5JM0dEJDwaudqOuvCbVabfRpqjzOErvJgEUuZDou4SUinZY2/qfZwc3M5 +lIC0IOuasLltPGNiK6yDgYq1UDmZj8SaoZpxzsc7hZQX0w9Woq9lxU2+wm0PWiJVmrrYCQj6k5 8Zs6vyd4Moq3qnpG/ou6ycdnY8DE/aXWzAtadaW0T1asdI53PHbyj3pHc/VuO89EF1nO+kBdbfb bde4pZad+6V5F8sPbUvf+Kkjv8oAt+09M X-Received: by 2002:a05:600c:6094:b0:486:fd71:e609 with SMTP id 5b1f17b1804b1-48727f1fc05mr140403705e9.25.1774785749182; Sun, 29 Mar 2026 05:02:29 -0700 (PDT) X-Received: by 2002:a05:600c:6094:b0:486:fd71:e609 with SMTP id 5b1f17b1804b1-48727f1fc05mr140402955e9.25.1774785748309; Sun, 29 Mar 2026 05:02:28 -0700 (PDT) Received: from maya.myfinge.rs (ifcgrfdd.trafficplex.cloud. [2a10:fc81:a806:d6a9::1]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-48730688694sm96806915e9.11.2026.03.29.05.02.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 29 Mar 2026 05:02:27 -0700 (PDT) From: Stefano Brivio To: David Gibson Subject: Re: [PATCH 15/18] pif: Limit pif names to IFNAMSIZ (16) bytes Message-ID: <20260329140226.18e910fb@elisabeth> In-Reply-To: <20260327043430.1785787-16-david@gibson.dropbear.id.au> References: <20260327043430.1785787-1-david@gibson.dropbear.id.au> <20260327043430.1785787-16-david@gibson.dropbear.id.au> Organization: Red Hat X-Mailer: Claws Mail 4.2.0 (GTK 3.24.49; x86_64-pc-linux-gnu) MIME-Version: 1.0 Date: Sun, 29 Mar 2026 14:02:27 +0200 (CEST) X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: wxPaAwp9b2GUr5zcxLnhScm3QDb-oYxU7vAmdAYHxGA_1774785750 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Message-ID-Hash: GNPYYCTEFTZRUCNPCQYUFL273Z2UXKSU X-Message-ID-Hash: GNPYYCTEFTZRUCNPCQYUFL273Z2UXKSU 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.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: On Fri, 27 Mar 2026 15:34:27 +1100 David Gibson wrote: > All current pif names are quite short, and we expect them to remain short > when/if we allow arbitrary pifs. However, because of the structure of > the current code we don't enforce any limit on the length. > > This will become more important with dynamic configuration updates, so > start enforcing a length limit. Specifically we allow pif names to be up > to IFNAMSIZ bytes, including the terminating \0. This is semi-arbitrary - > there's no particular reason we have to use the same length limit as > kernel netif names. However, when we do allow arbitrary pifs, we expect > that we might support a similar number to the number of kernel interfaces. > It might make sense to use names matching kernel interface names in that > future. So, re-use IFNAMSIZ to avoid surprise. And what if... we used 128 instead, which is reasonably longer than UNIX_PATH_MAX (108, which despite the application usage in POSIX 2024.1: https://pubs.opengroup.org/onlinepubs/9799919799/basedefs/sys_un.h.html is still commonly used a path length limit, also by passt itself)? At that point we could embed UNIX domain socket paths as PIF name (possibly with some additional specifier) which _might_ be useful to forward UNIX sockets in the https://bugs.passt.top/show_bug.cgi?id=200 sense. It's not the only way to implement it, but perhaps it's one possibility that might make sense for what we know now? What do you think? It also has the advantage of being sufficiently longer than IFNAMSIZ, so that should we ever need to have stuff like "container_A:eth0" in a PIF name, we could have it as well. -- Stefano