Re: [PATCH] semodule-utils: add bad-data tests for sefcontext_compile

Stephen Smalley <[email protected]> Wed, 29 Jul 2026 16:21:30 -0400
Newsgroups org.kernel.vger.selinux
Message-ID <CAEjxPJ7m2GX0mAG57URD6WkaSdpMd9H3uVD=y=e5F24N6H5tKg@mail.gmail.com>
On Wed, Jul 29, 2026 at 10:05 AM Stephen Smalley
<[email protected]> wrote:
>
> On Tue, Jul 28, 2026 at 9:21 AM Akhil Kohli <[email protected]> wrote:
> >
> > Extend the bad-data harness to validate file contexts after packaging:
> > wrong field count and NUL bytes are rejected by sefcontext_compile, invalid
> > contexts are rejected with -p, and unpackage'd .pp file contexts are
> > checked the same way.
> >
> > Adds 7 sefcontext_compile test steps on top of the semodule_package
> > harness. Adds bad_mls.mod.fc fixture. Preserve errexit restoration
> > (set -e after rc=$?) in shared helpers.
> >
> > Signed-off-by: Akhil Kohli <[email protected]>
>
> Acked-by: Stephen Smalley <[email protected]>

Merged.