All of lore.kernel.org
 help / color / mirror / Atom feed
From: Petr Lautrbach <lautrbach@redhat.com>
To: selinux@vger.kernel.org
Cc: Cathy Hu <cahu@suse.de>,
	fvogt@suse.com, selinux@suse.de,
	Stephen Smalley <stephen.smalley.work@gmail.com>
Subject: Re: Question regarding restorecon and btrfs read-only snapshots
Date: Tue, 18 Mar 2025 14:10:37 +0100	[thread overview]
Message-ID: <87msdi7acy.fsf@redhat.com> (raw)
In-Reply-To: <CAEjxPJ4DZs_1dPuO87UPpuvQL-PEq6zq9KA64SQvzsT1Mq8CqQ@mail.gmail.com>

Stephen Smalley <stephen.smalley.work@gmail.com> writes:

> On Mon, Mar 17, 2025 at 1:32 PM Petr Lautrbach <lautrbach@redhat.com> wrote:
>>
>> Cathy Hu <cahu@suse.de> writes:
>>
>> > On 17.03.25 15:29, Petr Lautrbach wrote:
>> >>
>> >> You could use `-e <directory>` to exclude read only subdirectories.
>> >>
>> >
>> > Yes that is possible, but also requires a manual change by the user to set
>> > this up together with the snapshot (same as telling them to add <<none>>),
>> > which we would like to avoid.
>>
>> Your -relabel.service's are generated and so can be restorecon options
>> there.
>>
>> Fedora uses fixfiles -
>> https://github.com/SELinuxProject/selinux/blob/main/policycoreutils/scripts/fixfiles
>> - which detects ro filesystems and skip them.
>
> We already have logic in libselinux/src/selinux_restorecon.c to
> exclude filesystems that lack seclabel support; should we augment this
> to also exclude read-only filesystems to avoid the need to work around
> this in all callers?
>

https://github.com/SELinuxProject/selinux/blob/main/libselinux/src/selinux_restorecon.c#L238

You're right, I didn't know about that.

I think it would make sense to exclude also `ro` mount points.

>>
>>
>>
>> > Is there a reason why these r-o subvolumes are not skipped by default?
>> > Could they be skipped without a problem and it is just missing the implementation?
>> >
>> > Thanks :)
>> >
>> > Kind regards,
>> > Cathy
>> >


  reply	other threads:[~2025-03-18 13:11 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
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

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=87msdi7acy.fsf@redhat.com \
    --to=lautrbach@redhat.com \
    --cc=cahu@suse.de \
    --cc=fvogt@suse.com \
    --cc=selinux@suse.de \
    --cc=selinux@vger.kernel.org \
    --cc=stephen.smalley.work@gmail.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 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.