selinux.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Stephen Smalley <stephen.smalley.work@gmail.com>
To: "Richard W.M. Jones" <rjones@redhat.com>
Cc: selinux@vger.kernel.org, lautrbach@redhat.com
Subject: Re: [PATCH v3] setfiles: Add -A option to disable SELINUX_RESTORECON_ADD_ASSOC
Date: Thu, 11 Sep 2025 15:28:38 -0400	[thread overview]
Message-ID: <CAEjxPJ7FM0a59yYYmxES36YYUsfKx0XvRapiYuoybQH7X77krQ@mail.gmail.com> (raw)
In-Reply-To: <CAEjxPJ5wEHLwbn7Rf=whqzFBgh=AVsy2YTY1L4wOr6JcB5yE5Q@mail.gmail.com>

On Wed, Sep 10, 2025 at 10:14 AM Stephen Smalley
<stephen.smalley.work@gmail.com> wrote:
>
> On Wed, Sep 10, 2025 at 6:43 AM Richard W.M. Jones <rjones@redhat.com> wrote:
> >
> > SELINUX_RESTORECON_ADD_ASSOC tracks conflicts between inodes with
> > multiple hard links or bind mounts that have differing contexts.
> > However doing this involves building a large internal hashtable that
> > stores the full path of every file examined by setfiles.  For
> > filesystems that have very large numbers of files or long pathnames,
> > this uses a lot of memory, which makes SELinux relabelling in
> > constrained memory environments infeasible.
> >
> > This adds a new setfiles -A option that disables this tracking.
> >
> > For example, using setfiles to relabel a filesystem with 15 million
> > files took 3.7GB of RAM.  Using this option, the same filesystem can
> > be relabelled in 121MB (albeit with no warnings or errors possible for
> > conflicting labels, but for our use case we don't care about that.)
> >
> > Fixes: https://issues.redhat.com/browse/RHEL-111505
> > Signed-off-by: Richard W.M. Jones <rjones@redhat.com>
>
> Acked-by: Stephen Smalley <stephen.smalley.work@gmail.com>

Thanks, applied.

      reply	other threads:[~2025-09-11 19:28 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-09-10 10:42 [PATCH v3] setfiles: Add -A option to disable SELINUX_RESTORECON_ADD_ASSOC Richard W.M. Jones
2025-09-10 10:42 ` Richard W.M. Jones
2025-09-10 14:14   ` Stephen Smalley
2025-09-11 19:28     ` Stephen Smalley [this message]

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=CAEjxPJ7FM0a59yYYmxES36YYUsfKx0XvRapiYuoybQH7X77krQ@mail.gmail.com \
    --to=stephen.smalley.work@gmail.com \
    --cc=lautrbach@redhat.com \
    --cc=rjones@redhat.com \
    --cc=selinux@vger.kernel.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).