All of lore.kernel.org
 help / color / mirror / Atom feed
* Question regarding restorecon and btrfs read-only snapshots
@ 2025-03-17 13:49 Cathy Hu
  2025-03-17 14:29 ` Petr Lautrbach
  0 siblings, 1 reply; 11+ messages in thread
From: Cathy Hu @ 2025-03-17 13:49 UTC (permalink / raw)
  To: selinux; +Cc: fvogt, selinux


[-- Attachment #1.1.1: Type: text/plain, Size: 1541 bytes --]

Hi all,

I have a question regarding restorecon and btrfs read-only snapshot handling.

restorecon is failing with "restorecon: Could not set context for <path>:  Read-only file system"
and return code 255 on btrfs read-only snapshots.

Currently we are setting <<none>> for those read-only btrfs snapshots in the selinux policy, as
we use restorecon in our autorelabelling [0] during boot and restorecon would fail with code 255 otherwise.
We do not want to ignore non-zero return codes, since issues might be overlooked.

However, this is also not optimal as we have to write every possible path into the policy or asking
users to set the <<none>> tag manually.

I was wondering if there was interest/plans in implementing to skip read-only btrfs subvolumes in restorecon
entirely or provide a different return code other than the catchall LABEL_FILE_KIND_INVALID?
Or is there another way that we did not see?

For more context, this is the bug on our side: https://bugzilla.suse.com/show_bug.cgi?id=1232226
There was also some comments about possible implementation, see comment 1 in the bug.

Thanks :)

Kind regards,

Cathy

[0] https://github.com/openSUSE/microos-tools/blob/master/selinux/selinux-autorelabel-generator

-- 
Cathy Hu <cahu@suse.de>
SELinux Security Engineer
GPG: 5873 CFD1 8C0E A6D4 9CBB F6C4 062A 1016 1505 A08A

SUSE Software Solutions Germany GmbH
Frankenstrasse 146
90461 Nürnberg

Geschäftsführer: Ivo Totev, Andrew McDonald, Werner Knoblich
(HRB 36809, AG Nürnberg)


[-- Attachment #1.1.2: OpenPGP public key --]
[-- Type: application/pgp-keys, Size: 6345 bytes --]

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

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

end of thread, other threads:[~2025-03-19 15:20 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-03-17 13:49 Question regarding restorecon and btrfs read-only snapshots Cathy Hu
2025-03-17 14:29 ` Petr Lautrbach
2025-03-17 14:55   ` Cathy Hu
2025-03-17 17:29     ` Petr Lautrbach
2025-03-18  8:17       ` Cathy Hu
2025-03-18 12:24       ` Stephen Smalley
2025-03-18 13:10         ` Petr Lautrbach
2025-03-19 13:16           ` Stephen Smalley
2025-03-19 13:25             ` Stephen Smalley
2025-03-19 14:35               ` William Roberts
2025-03-19 15:20                 ` Fabian Vogt

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.