Bug 2120604

Summary: Delegation to unprivileged users doesn't work for scopes in systemd
Product: Red Hat Enterprise Linux 9 Reporter: David Tardon <dtardon>
Component: systemdAssignee: Michal Sekletar <msekleta>
Status: CLOSED ERRATA QA Contact: Frantisek Sumsal <fsumsal>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 9.0CC: dtardon, msekleta, systemd-maint-list
Target Milestone: rcKeywords: FeatureBackport, Triaged
Target Release: ---Flags: pm-rhel: mirror+
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: systemd-250-11.el9 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2022-11-15 11:18:19 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description David Tardon 2022-08-23 11:29:21 UTC
This bug was initially created as a copy of Bug #2068575

I am copying this bug because: 
It applies to RHEL-9 too.


Description of problem:
When a process is started by using systemd-run for a user and delegation is requested the cgroup is owned by root and not the user. One of our software engineers has started the process upstream of working this through 
Version-Release number of selected component (if applicable):


How reproducible:
Always

Steps to Reproduce:
$ useradd test
$ systemd-run --uid=test -p Delegate=yes --scope --unit foo.scope --slice bar.slice /bin/bash
$ ls -ld /sys/fs/cgroup/bar.slice/foo.scope/
drwxr-xr-x. 2 root root 0 Dec  8 08:07 /sys/fs/cgroup/bar.slice/foo.scope/

Actual results:
Root owns cgroup

Expected results:
user that scope is delegated too should have ownership.

Additional info:

Upstream RFE has been created in systemd by Software engineer that we worked with initially when fleshing out ideas on how to work through some client questions.

https://github.com/systemd/systemd/issues/21683

Comment 2 Plumber Bot 2022-08-25 08:06:53 UTC
fix merged to github main branch -> https://github.com/redhat-plumbers/systemd-rhel9/pull/102

Comment 8 errata-xmlrpc 2022-11-15 11:18:19 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (systemd bug fix and enhancement update), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2022:8327