Article View: linux.kernel.netdev
Article #8387Re: [PATCH 0/8] userns: per-namespace capability bounding set and opt-in netns loopback
From: Andy Lutomirski
Date: Wed, 28 Oct 2026 22:56
Date: Wed, 28 Oct 2026 22:56
83 lines
16821 bytes
16821 bytes
On Wed, Oct 28, 2026 at 3:18 PM Hallgrimur H. Gunnarsson <halg@google.com> wrote: > > When an unprivileged process creates a new user namespace, it is granted > a full set of capabilities (CAP_FULL_SET) scoped to that namespace. > While these capabilities are isolated to the namespace, they allow > unprivileged local users to reach deep kernel subsystems (most notably > networking configuration and raw sockets via CAP_NET_ADMIN and > CAP_NET_RAW) that historically assumed a trusted caller and have > accounted for a large share of local privilege escalation > vulnerabilities. > > Many workloads and sandboxes use unprivileged user namespaces strictly > for basic UID/GID, mount, PID, or network isolation and never need > high-risk capabilities like CAP_NET_ADMIN or CAP_NET_RAW. Likewise, > system administrators often want a host-wide policy ceiling restricting > which capabilities unprivileged user namespaces may acquire, without > disabling unprivileged user namespaces altogether. > > Prior work by Jonathan Calmels [1] proposed addressing this via a sixth > per-thread capability set (cap_userns) alongside a global sysctl mask. > During that discussion [1, 2], feedback (e.g. from Casey Schaufler) > suggested that rather than adding another per-thread capability set and > prctl() interface, capability restrictions could be integrated directly > into struct user_namespace and configured via clone3(). At the same > time, as noted in [1], a clone3() flag alone is not sufficient for > administrators who need to enforce a host-wide ceiling on unprivileged > user namespaces without modifying every userspace callsite. > > This series combines both pieces of feedback: it embeds a capability > bounding set (cap_bset) directly into struct user_namespace, reusing > the existing task cap_bset, cap_permitted, and cap_effective sets on > namespace entry, and provides both a system-wide sysctl ceiling for > unprivileged user namespaces and a CLONE_NEWUSER_BSET flag for > voluntary per-namespace restriction via clone3(). Why should the task's cap masks affect this? *Maybe* cap_bset makes sense, but I'm struggling a bit to see why cap_permitted and cap_effective should matter. Also, I think that Docker in non-userns mode restricts cap_bset, and the purpose of that restriction is rather at odds with interpreting it as a restriction on newly created user namespaces for purposes of vulnerability mitigation. > > In addition, because restricting CAP_NET_ADMIN at user namespace > creation time prevents userspace from bringing up the loopback > interface in new network namespaces, the series first introduces > an opt-in flag to automatically enable loopback on network namespace > creation: > > 1. Opt-in loopback activation on netns creation (Patch 1) > > New network namespaces start with the loopback interface (lo) DOWN by > default, requiring CAP_NET_ADMIN over the owning user namespace to > bring it up. To block external network access while preserving > localhost networking, sandboxes commonly create an isolated network > namespace with only the loopback interface enabled. > The whole unshare/clone flag situation is getting out of hand, IMO. And this new thing makes logical sense but is really about reducing exposure. Perhaps we should instead have a small list associated with a userns (extensible in the future) of things that the ns's admin (i.e. whoever has CAP_SYS_ADMIN relative to the ns) may do. That list could include: - Create loopback with sensible defaults for ipv4 and/or ipv6 (i see no obvious reason to separate them) - Create tun/tap interfaces in that ns (and attach them, etc) And add a very simple new API to do these things. Actually, the tun/tap could just use the normal mechanism. Thoughts? -- Andy Lutomirski AMA Capital Management, LLC
Technical Details
Message-ID:
<CALCETrW9ygriu54gxiHFLEd5+hJminQo0r8Jwd63wR69Dj4W7w@mail.gmail.com>Path:
mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-353074-linux-kernel-netdev=dewy.ruReferences:
<20261028221705.3915340-1-halg@google.com>Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-353074-linux-kernel-netdev=dewy.ru
From: luto@amacapital.net (Andy Lutomirski)
Newsgroups: linux.kernel.netdev
Subject: Re: [PATCH 0/8] userns: per-namespace capability bounding set and
opt-in netns loopback
Date: Wed, 28 Oct 2026 15:56:11 -0700
Organization: Usenet Network
Message-ID: <CALCETrW9ygriu54gxiHFLEd5+hJminQo0r8Jwd63wR69Dj4W7w@mail.gmail.com>
References: <20261028221705.3915340-1-halg@google.com>
MIME-Version: 1.0
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
Injection-Info: usenet.network;
logging-data="1889248"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:BdPqDrTwdhotjdZ9B7QwrgKHoDM= sha256:HkDjc+13WeJISDK0DfwlRNxQUpGRI9XMbRPqt7KbCP4=
sha1:7GFCvHgVNpWi8IXxz5SooYAhumc= sha256:x1Sie8q8v2+M7IOp7yN/k2omRB4q/w/0TUJOj7KP61k=
List-ID: <netdev.vger.kernel.org>
X-Mailpost-Empty-Hdrs: X-Spam-Level
X-Received: from localhost (localhost [127.0.0.1])
by mail.dewy.ru (Postfix) with ESMTP id 6905C125C4E; Thu, 29 Oct 2026 01:59:27 +0300 (MSK)
X-Virus-Scanned: Debian amavisd-new at usenet.network
X-Spam-Flag: NO
X-Spam-Score: -2.95
X-Spam-Status: No, score=-2.95 tagged_above=-9999 required=6.31
tests=[DCC_REPUT_70_89=0.1, DKIM_SIGNED=0.1, DKIM_VALID=-0.1,
HEADER_FROM_DIFFERENT_DOMAINS=0.25, MAILING_LIST_MULTI=-1,
RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001]
autolearn=ham autolearn_force=no
X-Authentication-Results: mail.dewy.ru (amavisd-new); dkim=pass (2048-bit key)
header.d=amacapital-net.20260707.gappssmtp.com
X-Received: from mail.dewy.ru ([127.0.0.1])
by localhost (mail.dewy.ru [127.0.0.1]) (amavisd-new, port 10024)
with ESMTP id j8JRMj3VwbMJ;
Thu, 29 Oct 2026 01:59:24 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.234.253.10; helo=sea.lore.kernel.org; envelope-from=netdev+bounces-353074-linux-kernel-netdev=dewy.ru@vger.kernel.org; receiver=<UNKNOWN>
X-Authentication-Results: OpenDMARC; dmarc=none (p=none dis=none) header.from=amacapital.net
X-Received: from sea.lore.kernel.org (sea.lore.kernel.org [172.234.253.10])
by mail.dewy.ru (Postfix) with ESMTPS id 43259125C4C; Thu, 29 Oct 2026 01:59:16 +0300 (MSK)
X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92])
by sea.lore.kernel.org (Postfix) with ESMTP id 402A925BFC; Wed, 28 Oct 2026 22:56:27 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org; arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1
X-ARC-Seal: i=3; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=pass;
t=1793228186;
b=LB+sYWyX2b5FW7mw33tW5gv8Xz9tSI1xq2hcnQ4rO3Wup/7lm37YaWAv7qFggQ58tGxS
yEhY7Emf582X7IPCeo1rUzSpP7rNIDwuCVx+N1NtrRQB0xwh6HDsdQrOKxssBjjJOiDN2
vm80wfQR8Q2ZVDjlsefaZQ9igwgEIa7iaIG3KQWN2AVvbwr2yLbFhizefkCZfYoZA5EtS
oBQhZb4GxfGp1RWF/LRF0epTXXtYxfNWjBf4MiaqZHqhD3Xw5FVvbdhqFKRyHcb2Mw27U
OLgBfyD6rRXm8dYrI9zgfZauDJhY6O6VtrqGQVCRIAQ4RuYRqpwatuxGLaRnLE0goTw==
X-ARC-Message-Signature: i=3; d=subspace.kernel.org; s=arc20261015;
a=rsa-sha256; c=relaxed/relaxed; t=1793228186;
h=X-Original-To:Received:DMARC-Filter:Received:DKIM-Signature:
X-Google-DKIM-Signature:X-Forwarded-Encrypted:X-Gm-Message-State:
X-Gm-Gg:X-Received:X-Mailing-List:List-Id:List-Post:List-Help:
List-Subscribe:List-Unsubscribe:List-Owner:Precedence:MIME-Version:
References:In-Reply-To:From:Date:X-Gm-Features:Message-ID:Subject:To:
Cc:Content-Type:Content-Transfer-Encoding;
bh=V0MpBzACJCm623um40rfrBkC0GCIrNAzwGLFIF9vVVM=;
b=pz/zx+A2mjJ6h7NJr8EG3nLjdkQky2Xb4rFKWK/OcPt361cHATcPARk05NwO7PdvXhAX
Z+kpZwWcnqTGHwzEPWeXh1iM96lLWbpmsfizKBXtVpQcUF2qF+AewEzhKU2Wi4K+cMCHL
DNZ2ihZ8htdO9+h5iTx1HeabYAJjfTyLfMoPc6YMKRSANK40SxJhp73YnD+3pmA2tJie7
kZZxu+R881WRtMHERuWKMFfIKgqeo62kSiSUkoqriSHTUFK9E5n3LWWnfE+q8EOgOi0x8
TihcovRETAQioYJUKDpZlU26MnaX05keOgPgQbA6/KxhvBoXYfbTfp6FTkIkthNdBFQ==
X-ARC-Authentication-Results: i=3; smtp.subspace.kernel.org;
dkim=pass header.d=amacapital-net.20260707.gappssmtp.com header.i=@amacapital-net.20260707.gappssmtp.com header.a=rsa-sha256 header.s=20260707 header.b=bZOSlVJG;
dmarc=none header.from=amacapital.net;
spf=pass smtp.mailfrom=amacapital.net;
arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1
X-Received: from localhost.localdomain (localhost [127.0.0.1])
by smtp.subspace.kernel.org (Postfix) with ESMTP id 58C43606A32C;
Wed, 28 Oct 2026 22:56:26 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org;
dkim=pass (2048-bit key, unprotected) header.d=amacapital-net.20260707.gappssmtp.com header.i=@amacapital-net.20260707.gappssmtp.com header.a=rsa-sha256 header.s=20260707 header.b=bZOSlVJG
X-Authentication-Results: smtp.subspace.kernel.org; arc=pass header.oldest-pass=0 smtp.remote-ip=209.85.167.45
X-ARC-Seal: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=pass;
t=1793228185;
b=00Ngb9SoxhbpyYB4vS/UiflJyme5DEliCkVa7EDgDzomGjFw/h/BrX8cUVLkmDoF67ZO
smm/wa5v9pyTxV6IsJrxFPxoYoh76M+i/c9lxIWtQtW6utP5qTfVWjd7aVGgh1NoEb4ZT
734MVzC5dobygHULgAwAvChQQSkQ8UvuY7j2KAfRlp3dqWZ4n3Yx/oGhm/9SRFe6Ju7xw
YcP3WJcMnZLWyJLV7c+O59joi9OiYhGrEeJ8X3JgZJKcnQQwhNAS9G0Jp+9YXqiIbYoNR
yaMb+V0g5NnXlDHrZW61cFMG4iDgR/nV9I9Qva0wyuP57dvvyii82Df6W5eQaOXtLcA==
X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015;
a=rsa-sha256; c=relaxed/relaxed; t=1793228185;
h=DMARC-Filter:Received:DKIM-Signature:X-Google-DKIM-Signature:
X-Forwarded-Encrypted:X-Gm-Message-State:X-Gm-Gg:X-Received:
MIME-Version:References:In-Reply-To:From:Date:X-Gm-Features:
Message-ID:Subject:To:Cc:Content-Type:Content-Transfer-Encoding;
bh=V0MpBzACJCm623um40rfrBkC0GCIrNAzwGLFIF9vVVM=;
b=JvSCdcESv+EY7NuLddKdfIKe3FkqO9ZiS5yQk8lmaT13FU6bgMXA1QfKY3LkkYRSJjaz
oIteARbTtnAjhuMK5xvxCQL4TfvjRoAkYE3hCj2CovdbXvMkIS+twGCxKusSC08iJ7U4O
Uk5Agog7LGUlyNrsrlNTHsPUKfusvK93cFiS5x7ZoEZhrU2/gIDBAKr0LD7OjiyfML/Nr
kgY20ALDE1ubt+tOnncrfoG5tFcAkLqx0YAaXGllfv2rfjTa+SAjHaZvEPOyFGNDuuasF
ZlAW5BfSoi/nNTCA/xQWeFkyvEAuYU1hqcyTs6oMIcKFz0XtgiI8We+h87jyVxn2FBA==
X-ARC-Authentication-Results: i=2; smtp.subspace.kernel.org;
dmarc=none header.from=amacapital.net;
spf=pass smtp.mailfrom=amacapital.net;
dkim=pass header.d=amacapital-net.20260707.gappssmtp.com header.i=@amacapital-net.20260707.gappssmtp.com header.a=rsa-sha256 header.s=20260707 header.b=bZOSlVJG;
arc=pass header.oldest-pass=0 smtp.remote-ip=209.85.167.45
X-Received: from mail-lf1-f45.google.com (mail-lf1-f45.google.com [209.85.167.45])
(using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)
key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256)
(No client certificate requested)
by smtp.subspace.kernel.org (Postfix) with ESMTPS id 0822C606A322
for <netdev@vger.kernel.org>; Wed, 28 Oct 2026 22:56:24 +0000 (UTC)
X-DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 0822C606A322
X-Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=amacapital.net
X-Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=amacapital.net
X-Received: by mail-lf1-f45.google.com with SMTP id 2adb3069b0e04-5bcb6faf862so1634863e87.2
for <netdev@vger.kernel.org>; Wed, 28 Oct 2026 15:56:24 -0700 (PDT)
X-ARC-Seal: i=1; a=rsa-sha256; t=1793228183; cv=none;
d=google.com; s=arc-20260327;
b=q/ZJ9hRq8ySjGz4dgo1HRTvmh4KoEJ2WI7GE4pVVMsc1ulS2BB9tAK+bX8jfIBQDuW
MTVsWkYfwXYp9bMZlaFtHi59O1WjFHCedgMGuD5QGxymkeq8q88Pl+h1mg/CJmm1GHmF
lpYFG47wHCaaBmCCBrG1o/j/mpXxJcr2vOgcJXotKEechUDPkOnyk9LmW5dImZfFKNR/
yePa7wmrp4NlQ/HrpjkHYGpqnf7bAMgH0os7OQ5ZAglaJ1IDSHaIpSfv4V+OF+vX4t/a
74D8/y0OK3GDJYRaimazxmH01jTA/BueeyovQhkinuln6o+EOWV3Ry9HvD5zgHRRaiMI
cGCA==
X-ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20260327;
h=content-transfer-encoding:cc:to:subject:message-id:date:from
:in-reply-to:references:mime-version:dkim-signature;
bh=V0MpBzACJCm623um40rfrBkC0GCIrNAzwGLFIF9vVVM=;
fh=7OW6CBCC00Q/qGwNUnn8aJNM+za438VreD6uKSfDM4w=;
b=IEsdM6h6mXc4NWyUh4mn88duW39fFPCxYoT0j6MIhZYdVc2XsyJMUiWuIpfRVhBZaF
/eifM3iDN2xPt0gdfC4VLww/KmSuEXNlqlLGRcrHSY8k/WllCgoQmzGE74K+SeGhusz4
BiypFyBDLgBfkKu8+S86TTMOb0jLNcaVh3r26FvEKlBJVdL3sVQwBNUcReb/2DYrr+1y
QkakYagHDnrp3uBPdAERiZJRGkIAMQunzCGEJ3mZ+oQp7o8qTl4KQfF0AyYoZxRE1NHc
y1lSTzTtoybNRddbJnr2CnPskfec/Qw/4M4h01TR2c8OYXecDH6ADzXIa5e6JlumW+JN
CTbQ==;
darn=vger.kernel.org
X-ARC-Authentication-Results: i=1; mx.google.com; arc=none
X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=amacapital-net.20260707.gappssmtp.com; s=20260707; t=1793228183; x=1793832983; darn=vger.kernel.org;
h=content-transfer-encoding:content-type:cc:to:subject:message-id
:date:from:in-reply-to:references:mime-version:from:to:cc:subject
:date:message-id:reply-to:content-type;
bh=V0MpBzACJCm623um40rfrBkC0GCIrNAzwGLFIF9vVVM=;
b=bZOSlVJGtHEYwYd8P/JXTJGc0heKbmZ4zF6gCQsfAWUdj+V8lveZo37a35kI44zsZG
8r9p4GP3JXlJVRf/lRQCeD7DpNu+EpwjtNRy8B/mAQWg4VrhYeyQL+tDoFWr1hQ8Js/1
WmBu61FcofxUa9iC2o9+OqMJhIY2ZxGCvswPzn8Prxv7xx3PhcvCqjngxpEz26C3Zh5+
QCDR/cnpyszjYnYa+NJ3GR//R0d+Eo5+XTYFDLb2ivFHUdLHCDDXia/PshsMR6SOBMAE
M4o+rVXHudqK4Y3GjiNjn4cOkyeetgJTVfYAYDZGmr6blu+DiQE+KChOyTySu65qfvrn
wIcw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=1e100.net; s=20260707; t=1793228183; x=1793832983;
h=content-transfer-encoding:content-type:cc:to:subject:message-id
:date:from:in-reply-to:references:mime-version:x-gm-gg
:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to
:content-type;
bh=V0MpBzACJCm623um40rfrBkC0GCIrNAzwGLFIF9vVVM=;
b=0kVL6sTFBYRXz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:b0:5bf:c239:71ad with SMTP id
2adb3069b0e04-5bfcad69127mr1282221e87.38.1793228183136; Wed, 28 Oct 2026
15:56:23 -0700 (PDT)
X-Mailing-List: netdev@vger.kernel.org
X-List-Post: <mailto:netdev@vger.kernel.org>
X-List-Help: <mailto:netdev+help@vger.kernel.org>
X-List-Subscribe: <mailto:netdev+subscribe@vger.kernel.org>
X-List-Unsubscribe: <mailto:netdev+unsubscribe@vger.kernel.org>
X-List-Owner: <mailto:netdev+owner@vger.kernel.org>
X-Precedence: list
X-In-Reply-To: <20261028221705.3915340-1-halg@google.com>
X-Gm-Features: AclHuK_P2NrO86m_OPGwNSCuxqmiVp7fbTt4tlVfFApQPbneLnvcqCjpUTpk6N8
X-Cc: Christian Brauner <brauner@kernel.org>, Alexander Viro <viro@zeniv.linux.org.uk>,
Paul Moore <paul@paul-moore.com>, Serge Hallyn <sergeh@kernel.org>, Kees Cook <kees@kernel.org>,
"David S . Miller" <davem@davemloft.net>, Eric Dumazet <edumazet@google.com>,
Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>, Jan Kara <jack@suse.cz>,
James Morris <jmorris@namei.org>, Simon Horman <horms@kernel.org>, Jonathan Corbet <corbet@lwn.net>,
Shuah Khan <skhan@linuxfoundation.org>, Randy Dunlap <rdunlap@infradead.org>,
Jann Horn <jannh@google.com>, Günther Noack <gnoack@google.com>,
KP Singh <kpsingh@kernel.org>, Jonathan Calmels <jcalmels@3xx0.net>,
Casey Schaufler <casey@schaufler-ca.com>, linux-fsdevel@vger.kernel.org,
linux-security-module@vger.kernel.org, linux-api@vger.kernel.org,
containers@lists.linux.dev, netdev@vger.kernel.org, linux-doc@vger.kernel.org,
linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org