mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* About commit 901ef845fa2469c ("selinux: allow per-file labeling for cgroupfs")
@ 2017-10-06 17:53 Waiman Long
  2017-10-10 14:06 ` Stephen Smalley
  0 siblings, 1 reply; 3+ messages in thread
From: Waiman Long @ 2017-10-06 17:53 UTC (permalink / raw)
  To: Antonio Murdaca; +Cc: Paul Moore, Stephen Smalley, selinux, Tejun Heo, lkml

Antonio,

I have a question about your 4.14 upstream commit 901ef845fa2469c
("selinux: allow per-file labeling for cgroupfs"). With that, I am no
longer able to mount the cgroup2 filesystem with a 4.14 kernel. The
problem is that your commit sets the SE_SBGENFS flag, which causes
selinux to lookup the genfs database for a filesystem type match.
However, the filesystem type "cgroup2" isn't in the genfs database in my
RHEL7 based test system. The "cgroup" filesystem type is in the genfs database,
so I have no problem with v1 cgroup mount.

Do you know where the genfs database is defined? I need some way to add cgroup2
as a valid genfs fstype, or I have to manually back out the commit in order to
do my cgroup2 testing.

Thanks,
Longman

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: About commit 901ef845fa2469c ("selinux: allow per-file labeling for cgroupfs")
  2017-10-10 14:06 ` Stephen Smalley
@ 2017-10-10 14:05   ` Waiman Long
  0 siblings, 0 replies; 3+ messages in thread
From: Waiman Long @ 2017-10-10 14:05 UTC (permalink / raw)
  To: Stephen Smalley, Antonio Murdaca
  Cc: Tejun Heo, selinux, lkml, Paul Moore, Miroslav Grepl

On 10/10/2017 10:06 AM, Stephen Smalley wrote:
> On Fri, 2017-10-06 at 13:53 -0400, Waiman Long wrote:
>> Antonio,
>>
>> I have a question about your 4.14 upstream commit 901ef845fa2469c
>> ("selinux: allow per-file labeling for cgroupfs"). With that, I am no
>> longer able to mount the cgroup2 filesystem with a 4.14 kernel. The
>> problem is that your commit sets the SE_SBGENFS flag, which causes
>> selinux to lookup the genfs database for a filesystem type match.
>> However, the filesystem type "cgroup2" isn't in the genfs database in
>> my
>> RHEL7 based test system. The "cgroup" filesystem type is in the genfs
>> database,
>> so I have no problem with v1 cgroup mount.
>>
>> Do you know where the genfs database is defined? I need some way to
>> add cgroup2
>> as a valid genfs fstype, or I have to manually back out the commit in
>> order to
>> do my cgroup2 testing.
> It is part of the policy; you could add it via a policy module ala:
> $ cat cgroup2.cil
> (genfscon cgroup2 / (system_u object_r cgroup_t ((s0) (s0))))
>
> $ sudo semodule -i cgroup2.cil

Thanks for the workaround. I will try that next time.

> That said, the fact that you can't even mount it without that is
> arguably a bug/regression.  I guess this is due to the ENOENT from
> security_genfs_sid being propagated all the way up instead of just
> leaving it unlabeled and permitting the mount to proceed.

Yes, the mount command got the ENOENT error and it printed out some
confusing message.

Cheers,
Longman

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: About commit 901ef845fa2469c ("selinux: allow per-file labeling for cgroupfs")
  2017-10-06 17:53 About commit 901ef845fa2469c ("selinux: allow per-file labeling for cgroupfs") Waiman Long
@ 2017-10-10 14:06 ` Stephen Smalley
  2017-10-10 14:05   ` Waiman Long
  0 siblings, 1 reply; 3+ messages in thread
From: Stephen Smalley @ 2017-10-10 14:06 UTC (permalink / raw)
  To: Waiman Long, Antonio Murdaca
  Cc: Tejun Heo, selinux, lkml, Paul Moore, Miroslav Grepl

On Fri, 2017-10-06 at 13:53 -0400, Waiman Long wrote:
> Antonio,
> 
> I have a question about your 4.14 upstream commit 901ef845fa2469c
> ("selinux: allow per-file labeling for cgroupfs"). With that, I am no
> longer able to mount the cgroup2 filesystem with a 4.14 kernel. The
> problem is that your commit sets the SE_SBGENFS flag, which causes
> selinux to lookup the genfs database for a filesystem type match.
> However, the filesystem type "cgroup2" isn't in the genfs database in
> my
> RHEL7 based test system. The "cgroup" filesystem type is in the genfs
> database,
> so I have no problem with v1 cgroup mount.
> 
> Do you know where the genfs database is defined? I need some way to
> add cgroup2
> as a valid genfs fstype, or I have to manually back out the commit in
> order to
> do my cgroup2 testing.

It is part of the policy; you could add it via a policy module ala:
$ cat cgroup2.cil
(genfscon cgroup2 / (system_u object_r cgroup_t ((s0) (s0))))

$ sudo semodule -i cgroup2.cil

That said, the fact that you can't even mount it without that is
arguably a bug/regression.  I guess this is due to the ENOENT from
security_genfs_sid being propagated all the way up instead of just
leaving it unlabeled and permitting the mount to proceed.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2017-10-10 14:05 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-10-06 17:53 About commit 901ef845fa2469c ("selinux: allow per-file labeling for cgroupfs") Waiman Long
2017-10-10 14:06 ` Stephen Smalley
2017-10-10 14:05   ` Waiman Long

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®