public inbox for linux-btrfs@vger.kernel.org
 help / color / mirror / Atom feed
* SELinux on btrfs
@ 2014-04-01 14:50 Michael Schuerig
  0 siblings, 0 replies; 5+ messages in thread
From: Michael Schuerig @ 2014-04-01 14:50 UTC (permalink / raw)
  To: linux-btrfs


I'm currently considering to use SELinux on an existing system with 
btrfs filesystems. This would be my first with SELinux and I wouldn't 
expect everything to go smoothly. I'm already aware that SELinux's 
automatic labelling of files is not aware of subvolumes[*]. I already 
have quite a few read-only snapshots that I don't want to forfeit, 
however, I'm not at all sure how SELinux would interact with them.

Are there any other considerations I ought to be aware of?

Michael


[*] https://wiki.debian.org/SELinux/Setup#btrfs
-- 
Michael Schuerig
mailto:michael@schuerig.de
http://www.schuerig.de/michael/


^ permalink raw reply	[flat|nested] 5+ messages in thread
* Re: SELinux on btrfs
@ 2014-04-12 16:15 Chris Murphy
  2014-04-30  8:01 ` Russell Coker
  0 siblings, 1 reply; 5+ messages in thread
From: Chris Murphy @ 2014-04-12 16:15 UTC (permalink / raw)
  To: Btrfs BTRFS; +Cc: Michael Schuerig

>  I'm already aware that SELinux's automatic labelling of files is not aware of subvolumes[*]. 
> [*] https://wiki.debian.org/SELinux/Setup#btrfs

I'm not sure exactly what it means since there is always a subvolume (ID 5), and I don't understand why autorelabel behavior would differ from manually running fixfiles or restorecon. 

In any case, I just obliterated the labeling in /boot which is a Btrfs subvolume mounted at /boot. I then ran "restorecon -Rv /" and this finds the problems in /boot and fixes them. So I obliterated the labels in /boot again, and then did "touch /.autorelabel; reboot" and again /boot is fixed up.

*shrug* Maybe the issue is labeling unmounted subvolumes, as if they're not treated as folders? Nope, if I snapshot /boot as /boot/.bootsnap, and then only mess up the labels in .bootsnap, and then run a restorecon -Rv on /boot, it goes into .bootsnap and fixes its labels. So that's not it either.

> I already have quite a few read-only snapshots that I don't want to forfeit, however, I'm not at all sure how SELinux would interact with them.


If the default policy mismatches with the file context, the relabel or restorecon will want to change the context to the default, but won't be able to because it's a read-only subvolume. I merely get a non-fatal:

restorecon set context /boot/.bootsnap/grub2->system_u:object_r:boot_t:s0 failed:'Read-only file system'

And it proceeds to the next file.

This is not Btrfs specific, but is about autorelabeling, and better ways to go about it.
http://danwalsh.livejournal.com/38157.html



Chris Murphy

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

end of thread, other threads:[~2014-05-02  1:51 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-04-01 14:50 SELinux on btrfs Michael Schuerig
  -- strict thread matches above, loose matches on Subject: below --
2014-04-12 16:15 Chris Murphy
2014-04-30  8:01 ` Russell Coker
2014-04-30 16:04   ` Chris Murphy
2014-05-02  1:51     ` Russell Coker

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