From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: passt.top; dmarc=fail (p=quarantine dis=none) header.from=redhat.com 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 C14595A0265 for ; Mon, 16 Nov 2026 00:24:20 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1794785059; 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=vC7dCZcnM6cP/M/j9un6AGso/YXzYA9qNiBbZ+AbZ/w=; b=f2TPjajsbOs6b8mpeck6G5WCIgvJy9r3d0cU3MPmNsMH76iqPJSkEMul08Zdv7ZeIglNUr X7PeG+e7wzCpYvEG+UqHFb8L8nZzcv+r7plkuFEzZMwD2bVCjdG8MpCoehqLVKo+fa+oOG ob39TLZyhJFK2UV6Eabm0okjjV6YSy8= Received: from mail-wr1-f71.google.com (mail-wr1-f71.google.com [209.85.221.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-658-DuVf8vLCMEm1fxC4Qi5IIg-1; Sun, 15 Nov 2026 18:24:18 -0500 X-MC-Unique: DuVf8vLCMEm1fxC4Qi5IIg-1 X-Mimecast-MFC-AGG-ID: DuVf8vLCMEm1fxC4Qi5IIg_1794785057 Received: by mail-wr1-f71.google.com with SMTP id ffacd0b85a97d-48e1d839ddaso1699748f8f.3 for ; Sun, 15 Nov 2026 15:24:18 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1794785057; x=1795389857; h=date:content-transfer-encoding:content-type: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:content-type;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a05:6000:1ac5:b0:490:71a7:6f3c with SMTP id ffacd0b85a97d-49c7325b963mr21793167f8f.55.1794785056936; Sun, 15 Nov 2026 15:24:16 -0800 (PST) X-Received: by 2002:a05:6000:1ac5:b0:490:71a7:6f3c with SMTP id ffacd0b85a97d-49c7325b963mr21793132f8f.55.1794785056395; Sun, 15 Nov 2026 15:24:16 -0800 (PST) Received: from maya.myfinge.rs (ifcgrfdd.trafficplex.cloud. [2a10:fc81:a806:d6a9::1]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-49c5f1c0e47sm15504670f8f.14.2026.11.15.15.24.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 15 Nov 2026 15:24:15 -0800 (PST) From: Stefano Brivio To: Nicholas Rodrigues Lordello Subject: Re: CAP_NET_BIND_SERVICE does not allow binding to low ports Message-ID: <20261116002414.09b82be6@elisabeth> In-Reply-To: References: Organization: Red Hat X-Mailer: Claws Mail 4.2.0 (GTK 3.24.49; x86_64-pc-linux-gnu) MIME-Version: 1.0 Date: Mon, 16 Nov 2026 00:24:15 +0100 (CET) X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: 1qm1XyWN9pSpk3IxgXWVDOSRuM5xmDNOkaUsWWMGOU8_1794785057 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Message-ID-Hash: 7RM2SVIC6X66G5HWMRJVWBHYAMOPEFFK X-Message-ID-Hash: 7RM2SVIC6X66G5HWMRJVWBHYAMOPEFFK 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-user@passt.top X-Mailman-Version: 3.3.8 Precedence: list List-Id: "For passt users: support, questions and answers" Archived-At: Archived-At: List-Archive: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: Hi Nick, Sorry for the delay. I finally found a moment to look into this: On Wed, 14 Oct 2026 14:32:43 +0000 Nicholas Rodrigues Lordello wrote: > Hey all, > > Just wanted to report what is either a documentation issur, or an > issue in `passt` proper. The `man` pages document the following for > binding to low numbered (i.e. service ports): > > or the CAP_NET_BIND_SERVICE Linux capability is granted, see > services(5) and capabilities(7). > > [...] > > To grant this capability, you can issue, as root: > > for p in $(which passt passt.avx2); do > setcap 'cap_net_bind_service=+ep' "${p}" > done > > However, this does not work: > > # setcap 'cap_net_bind_service=+ep' /usr/local/bin/passt > # setcap 'cap_net_bind_service=+ep' /usr/local/bin/passt.avx2 > $ /usr/local/bin/passt -f -t 123 > Listen failed for HOST TCP port */123: Permission denied > Couldn't listen on requsted ports > [1] > > The reason I'm asking is that `krun` uses `passt` for port forwarding > and is having issues with service ports [1]. The current work-around is > to set the `net.ipv4.ip_unprivileged_port_start` sysctl to a lower > number in the container where `passt` is run, but since `passt` is > started already with `CAP_NET_BIND_SERVICE` it would be nice for that > to work and not require the `sysctl` work-around. > > Anyway, curious to know if this is documentation issue or actually > something that should be working but isn't (or a local setup issue). ...ideally we'd like it to work (not for automatic port forwards, and also not for runtime ones, that is, configured via pesto(1)), but: https://archives.passt.top/passt-dev/Y0YshqEtFoCRlLH9@yekko/ on the other hand, there would be a way to fix it, by reordering things a bit and postponing isolation steps. This was my draft from 4 years ago: https://archives.passt.top/passt-dev/20221013125017.195769cf@elisabeth/ now things changed quite a bit, but what would need to be done is essentially to move the isolate_user() call *after* the initial fwd_listen_init() call. There might be a few implications, I don't think it's as simple as moving that single call, but I think it should be doable. -- Stefano