From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [212.224.123.68]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by lists.proxmox.com (Postfix) with ESMTPS id 3081770769 for ; Thu, 24 Jun 2021 16:09:53 +0200 (CEST) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 1E042D5CA for ; Thu, 24 Jun 2021 16:09:23 +0200 (CEST) Received: from proxmox-new.maurer-it.com (proxmox-new.maurer-it.com [94.136.29.106]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by firstgate.proxmox.com (Proxmox) with ESMTPS id 037BDD5BE for ; Thu, 24 Jun 2021 16:09:22 +0200 (CEST) Received: from proxmox-new.maurer-it.com (localhost.localdomain [127.0.0.1]) by proxmox-new.maurer-it.com (Proxmox) with ESMTP id C9C2742F6E for ; Thu, 24 Jun 2021 16:09:21 +0200 (CEST) From: Wolfgang Bumiller To: pve-devel@lists.proxmox.com Date: Thu, 24 Jun 2021 16:09:17 +0200 Message-Id: <20210624140917.14556-1-w.bumiller@proxmox.com> X-Mailer: git-send-email 2.30.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-SPAM-LEVEL: Spam detection results: 0 AWL 0.729 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record Subject: [pve-devel] [PATCH container] disable btrfs ioctl in user namespaces X-BeenThere: pve-devel@lists.proxmox.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Proxmox VE development discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Jun 2021 14:09:53 -0000 Changes the seccomp profile to return EPERM on every btrfs ioctl. Signed-off-by: Wolfgang Bumiller --- src/PVE/LXC.pm | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/PVE/LXC.pm b/src/PVE/LXC.pm index 93286f6..393da1b 100644 --- a/src/PVE/LXC.pm +++ b/src/PVE/LXC.pm @@ -435,6 +435,15 @@ sub make_seccomp_config { my $rules = { keyctl => ['errno 38'], + + # Disable btrfs ioctrls since they don't work particularly well in user namespaces. + # Particularly, without the mount option to enable rmdir removing snapshots, user + # namespaces can create snapshots but neither `show` or `delete` them, which is quite + # horrible, so for now, just disable this entirely: + # + # BTRFS_IOCTL_MAGIC 0x94, _IOC type shift is 8, + # so `(req & 0xFF00) == 0x9400` is a btrfs ioctl and gets an EPERM + ioctl => ['errno 1 [1,0x9400,SCMP_CMP_MASKED_EQ,0xff00]'], }; my $raw_conf = ''; -- 2.30.2