From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-ed1-f51.google.com (mail-ed1-f51.google.com [209.85.208.51]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A48232248B3 for ; Mon, 19 Jan 2026 19:11:46 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.51 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768849908; cv=none; b=dyB8gzgI0RG74k1xTmdRxZYkrsYht3WzKgcszHmv+1WZNYoMqbV4u8Plm9PyBsm71QNwR8v2BRt8lOy/KzRJqgVLXG3gi40ftGjfKdneK6CjDvOu8vrCLUhSe7DnN5GCx5/SVsXAILKvQFe4AXq8qAa9qSyqwmzBVwKDE/nL69E= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768849908; c=relaxed/simple; bh=bI5IPQFJ+by3IIQyhZwdLpvLyRBSEgqkFjkzhjf0OBQ=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=Qxv8oNKy0NzgmyoXv/Rt4PAhpZP/c4XXxzpgw4MLKvJ9x6RWcwkRNOiNNCePC6qwG9So1Sj3qBLIH+PZr1Q2jYV9a4yHT1G3RBP8JSjEPmea/A1fMzcFPjv3cj29nT874yNj1Mz/WsUV9KwocW3ucPBGqa2JXVr6kfwcb9MtSBs= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=nfArtyt4; arc=none smtp.client-ip=209.85.208.51 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="nfArtyt4" Received: by mail-ed1-f51.google.com with SMTP id 4fb4d7f45d1cf-64bea6c5819so7655445a12.3 for ; Mon, 19 Jan 2026 11:11:46 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1768849905; x=1769454705; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=ihXpfk6s5RJismx/mSJFIyW5r33kfZuDg7he69hJB7c=; b=nfArtyt4u+CIABzgY0xV6AdfPUOgFskgqF9Z0nhJKd0yQ/iOWetQWhsRRSMl7gRAZQ /L+fR3+vM5da248Vi4A2crBvEaDbzRAH5Sl8fLWm87Xa//gfb16EezmnubogC9tb8EOV t0PnqoaHpwt1LvQNi91Wl4nJO9hMFbqLwpmsAMr2euh+u1D5bn4HeYZWJUTl/xnrKFhh ku/5LwHcPqN6yxN8slucjNb7vkT/CFCUIdOP3RIHUtqdeuT8IWhqJT9bgUlkeJOPtPS7 O4lw1k0xD/Pl6rpHzo4R/emucZ78g4PBn0wQTIw8hXVQa8P243OFiKGHmQRem8ERklYG dnBg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1768849905; x=1769454705; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=ihXpfk6s5RJismx/mSJFIyW5r33kfZuDg7he69hJB7c=; b=ohQEcc/8eOndWR3apNMFyai3gEPcQw0eOlaw/yYubA2ccjwg6uDVv0JXVa5GxoE2g/ uqFKxtZEqzuhfPgLNrhxcnXb5mhQMryrj/BAPE/m15UHIAxcZP48mPqjz56VUB9BHVBZ cE4nMHjngiiD+B3+qYYLqAgpmjh/PwpytsViVfxZvos0TFojn8LzXMMZ5FCo4JkdvyTT xM0eydrM/Nc0tu/fcpwKLk9q9nkRl5c+naYcgvgAzSjtKGx2gE7QEnEVE8PYxWtM4jXC YUYaEIa4z0ab2fTNRNl5WBtBaGYUZiGyRAdwzq4rI+ZBsUfgXJkcVxbnbKCi2UBy+zlO k/lg== X-Forwarded-Encrypted: i=1; AJvYcCXbgA8+Sd0T5CQiW/ALvrymiCAkiAgxLrgYU/MlTCcphrClndWx3M6DKnT+OvSgW0wC2swrFTtUKHKb3c8=@vger.kernel.org X-Gm-Message-State: AOJu0YxQ3ZzJC0Z5qa4lPHc44htD9Wp4E1UmNK9fzwgaHKfTqZWPDKoR /XLuF5Dk7ciliAAW3uojelA2L7zq4JyBjhDZYQZ+Mekr+muAD/1396nh X-Gm-Gg: AZuq6aKKo8gcVwBkN9t3nZS4WPfDrBa4o2zb21Kha+hvtOst0rUPm5U2KpsOOGgugQk acEdxakljO78kMfkKHRRjhNMRDACFBv7iuacBW8ZgEIYKvmqaJOlW8sLfdyrmRPNqog9cbDSywL XKMZS48YHh3w2QSFDvjGoyPhMGUtP/LZHQsQ/vBlrYUmEzIhwGiAVp30xnNwwnNtWF5v/Mwedzj Kfcgx9rLXMrl66IUhCg5fuTvjX7Ulk5SEraW0IiaF3RFXPzf5hwbiv/OYobqjy4Ml4h//2J1fRC v5LWGooRSXeV5IS7MNtp+0f9IuPzbo9tkAIeJWzoAChBa9Gc0wlLI5MqH7F6jyUNOWaVhZmEDI1 QN8VGGvGpG5whxE9EsmoSPAHHpnUm5YhfrxCJhK6wKyXj5J0wNMPZ1HtPM9CI/JhhHRO340/TlQ TWbFm7/WA= X-Received: by 2002:a05:6000:613:b0:432:586f:2ab9 with SMTP id ffacd0b85a97d-435699787cdmr17106815f8f.5.1768842854026; Mon, 19 Jan 2026 09:14:14 -0800 (PST) Received: from localhost ([212.73.77.104]) by smtp.gmail.com with UTF8SMTPSA id ffacd0b85a97d-43569922032sm25380858f8f.8.2026.01.19.09.14.11 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 19 Jan 2026 09:14:13 -0800 (PST) From: Askar Safin To: brauner@kernel.org Cc: amir73il@gmail.com, cyphar@cyphar.com, jack@suse.cz, jlayton@kernel.org, josef@toxicpanda.com, linux-fsdevel@vger.kernel.org, viro@zeniv.linux.org.uk, Lennart Poettering , David Howells , Zhang Yunkai , cgel.zte@gmail.com, Menglong Dong , linux-kernel@vger.kernel.org, initramfs@vger.kernel.org, containers@lists.linux.dev, linux-api@vger.kernel.org, news@phoronix.com, lwn@lwn.net, Jonathan Corbet , Rob Landley , emily@redcoat.dev, Christoph Hellwig Subject: Re: [PATCH 0/2] mount: add OPEN_TREE_NAMESPACE Date: Mon, 19 Jan 2026 20:11:01 +0300 Message-ID: <20260119171101.3215697-1-safinaskar@gmail.com> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20251229-work-empty-namespace-v1-0-bfb24c7b061f@kernel.org> References: <20251229-work-empty-namespace-v1-0-bfb24c7b061f@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Christian Brauner : > Extend open_tree() with a new OPEN_TREE_NAMESPACE flag. Similar to > OPEN_TREE_CLONE only the indicated mount tree is copied. Instead of > returning a file descriptor referring to that mount tree > OPEN_TREE_NAMESPACE will cause open_tree() to return a file descriptor > to a new mount namespace. In that new mount namespace the copied mount > tree has been mounted on top of a copy of the real rootfs. I want to point at security benefits of this. [[ TL;DR: [1] and [2] are very big changes to how mount namespaces work. I like them, and I think they should get wider exposure. ]] If this patchset ([1]) and [2] both land (they are both in "next" now and likely will be submitted to mainline soon) and "nullfs_rootfs" is passed on command line, then mount namespace created by open_tree(OPEN_TREE_NAMESPACE) will usually contain exactly 2 mounts: nullfs and whatever was passed to open_tree(OPEN_TREE_NAMESPACE). This means that even if attacker somehow is able to unmount its root and get access to underlying mounts, then the only underlying thing they will get is nullfs. Also this means that other mounts are not only hidden in new namespace, they are fully absent. This prevents attacks discussed here: [3], [4]. Also this means that (assuming we have both [1] and [2] and "nullfs_rootfs" is passed), there is no anymore hidden writable mount shared by all containers, potentially available to attackers. This is concern raised in [5]: > You want rootfs to be a NULLFS instead of ramfs. You don't seem to want it to > actually _be_ a filesystem. Even with your "fix", containers could communicate > with each _other_ through it if it becomes accessible. If a container can get > access to an empty initramfs and write into it, it can ask/answer the question > "Are there any other containers on this machine running stux24" and then coordinate. Note: as well as I understand all actual security bugs are already fixed in kernel, runc and similar tools. But still [1] and [2] reduce chances of similar bugs in the future, and this is very good thing. Also: [1] and [2] are pretty big changes to how mount namespaces work, so I added more people and lists to CC. This mail is answer to [1]. [1] https://lore.kernel.org/all/20251229-work-empty-namespace-v1-0-bfb24c7b061f@kernel.org/ [2] https://lore.kernel.org/all/20260112-work-immutable-rootfs-v2-0-88dd1c34a204@kernel.org/ [3] https://lore.kernel.org/all/rxh6knvencwjajhgvdgzmrkwmyxwotu3itqyreun3h2pmaujhr@snhuqoq44kkf/ [4] https://github.com/opencontainers/runc/pull/1962 [5] https://lore.kernel.org/all/cec90924-e7ec-377c-fb02-e0f25ab9db73@landley.net/ -- Askar Safin