public inbox for pve-devel@lists.proxmox.com
 help / color / mirror / Atom feed
From: jlcusinato <jlcusinato@neverhack.com>
To: pve-devel@lists.proxmox.com
Cc: felix@ranovus.com, crandler@crandland.de, dreadfulbunny@proton.me
Subject: [PATCH pve-container] fix #7864: lxc: honour pool privileges when creating containers with tags
Date: Tue, 27 Oct 2026 11:32:35 +0100	[thread overview]
Message-ID: <20261027103626.767361-4-jlcusinato@neverhack.com> (raw)
In-Reply-To: <20261027103626.767361-1-jlcusinato@neverhack.com>

From: Jean-Leon CUSINATO <jlcusinato@neverhack.com>

check_ct_modify_config_perm() passes $pool to every other
check_vm_perm() call, but the tags branch called
assert_tag_permissions() without it, so the VM.Config.Options check
always resolved against /vms/$vmid.

Unlike for an existing container, where the pool ACL already resolves
onto /vms/$vmid, the create path is hit: the LXC create API accepts
tags as a config property and hands the raw parameters, including
tags, to check_ct_modify_config_perm() before the container joins the
pool. A caller whose privileges come solely from /pool/<pool>
therefore fails to create containers with tags:

  403 Permission check failed (/vms/<vmid>, VM.Config.Options)

Pass the pool through, matching the neighbouring checks.

Fixes: 7a57f63 ("check_ct_modify_config_perm: check for tags permissions with 'assert_tag_permissions'")
Reported-by: dreadfulbunny <dreadfulbunny@proton.me>
Signed-off-by: Felix Winterhalter <felix@ranovus.com>
---

Compared to the Bugzilla attachment (2058): the 'currently latent'
premise in the original message is wrong - the LXC create API does
accept tags and container create fails the same way (data point in
bug comment #7, 2026-10-27), so the subject now starts with
'fix #7864:' and the message describes the create path;
Fixes:/Reported-by: trailers added. Code identical, rebased onto
current master.

Resend note (submitted by Jean-Léon CUSINATO
<jlcusinato@neverhack.com>):

These patches originate from bug 7864 [0]: code by Felix Winterhalter
<felix@ranovus.com> (the versions attached there, informally reviewed
by a Proxmox maintainer in comment #4, who asked for a posting on this
list) plus crandler's follow-up finding (comment #5) and dreadfulbunny's
data point on the container create path (comment #7). Neither original
author has been active on the bug since September 2026, and the list
never received a posting despite that request, so I am submitting them
here with their attribution intact in the commit messages
(Signed-off-by / Reported-by). All contributors are CCed. My individual
CLA has been submitted to and recorded by Proxmox
(office@proxmox.com, October 2026), who asked for the patches to be
posted here. Not runtime-tested (no test node available); verification
is code-level only. Feedback, especially testing, welcome.

Series merge order: 1) pve-guest-common, then 2) qemu-server and
3) pve-container (the latter two only rely on the new optional $pool
parameter introduced in 1).

[0] https://bugzilla.proxmox.com/show_bug.cgi?id=7864

 src/PVE/LXC.pm | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/src/PVE/LXC.pm b/src/PVE/LXC.pm
index 44ae4fa..f7c9b5b 100644
--- a/src/PVE/LXC.pm
+++ b/src/PVE/LXC.pm
@@ -1743,7 +1743,9 @@ sub check_ct_modify_config_perm {
         } elsif ($opt eq 'tags') {
             my $old = $oldconf->{$opt};
             my $new = $delete ? '' : $newconf->{$opt};
-            PVE::GuestHelpers::assert_tag_permissions($vmid, $old, $new, $rpcenv, $authuser);
+            PVE::GuestHelpers::assert_tag_permissions(
+                $vmid, $old, $new, $rpcenv, $authuser, $pool,
+            );
         } else {
             $rpcenv->check_vm_perm($authuser, $vmid, $pool, ['VM.Config.Options']);
         }
-- 
2.56.0




      parent reply	other threads:[~2026-10-27 10:43 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-27 10:32 [PATCH 0/3] fix #7864: allow pool-scoped privileges to create VMs with tags jlcusinato
2026-10-27 10:32 ` [PATCH pve-guest-common] fix #7864: guest helpers: allow pool-scoped privileges for tag permission checks jlcusinato
2026-10-27 10:32 ` [PATCH qemu-server] fix #7864: api: create vm: honour pool privileges when setting tags jlcusinato
2026-10-27 10:32 ` jlcusinato [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20261027103626.767361-4-jlcusinato@neverhack.com \
    --to=jlcusinato@neverhack.com \
    --cc=crandler@crandland.de \
    --cc=dreadfulbunny@proton.me \
    --cc=felix@ranovus.com \
    --cc=pve-devel@lists.proxmox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal