All of lore.kernel.org
 help / color / mirror / Atom feed
From: Petr Lautrbach <lautrbach@redhat.com>
To: selinux@vger.kernel.org
Cc: "Thiébaud Weksteen" <tweek@google.com>
Subject: Re: [PATCH] Add support for UTF-8 in file context labels
Date: Fri, 06 Mar 2026 09:48:05 +0100	[thread overview]
Message-ID: <87jyvps5ru.fsf@redhat.com> (raw)
In-Reply-To: <CA+zpnLcC6e74amyz+6pqau+zUBYLhYGSP4zRy133XUfC75Qbvw@mail.gmail.com>

Thiébaud Weksteen <tweek@google.com> writes:

> On Tue, Mar 3, 2026 at 11:39 PM Petr Lautrbach <lautrbach@redhat.com> wrote:
>>
>> - libselinux to be able to read UTF-8 spec entries
>> - libselinux to compile regexes with UTF strings and unicode properties
>
> Thanks Petr. I'm a bit worried about the performance impact here of
> always enabling UTF support. Were you able to run benchmarks on this
> change? Android's file_contexts [1] could be useful data here. If the
> impact is non-negligible, could this feature be behind an option for
> selabel_file, something like SELABEL_OPT_UTF?
>
> [1] https://cs.android.com/android/platform/superproject/+/android-latest-release:system/sepolicy/private/file_contexts

I've run perf on
`setfiles /etc/selinux/targeted/contexts/files/file_contexts /` and if I
get it right there's about 5% overhead in libpcre2 when it's used with
PCRE2_UTF.

I'll prepare another patch where support for UTF8 could be disabled
during build time, e.g.

    make LIBDIR=/usr/lib64 SHLIBDIR=/lib64 DISABLE_UTF=y install


Petr


      reply	other threads:[~2026-03-06  8:48 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-03-03 12:23 [PATCH] Add support for UTF-8 in file context labels Petr Lautrbach
2026-03-04  0:22 ` Thiébaud Weksteen
2026-03-06  8:48   ` Petr Lautrbach [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=87jyvps5ru.fsf@redhat.com \
    --to=lautrbach@redhat.com \
    --cc=selinux@vger.kernel.org \
    --cc=tweek@google.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.