Re: [PATCH 1/2 v2] libsepol: Copy a chain of type alias references
Stephen Smalley <[email protected]>
| Newsgroups | org.kernel.vger.selinux |
|---|---|
| Message-ID | <CAEjxPJ4HqYb08LPJSmrAVWR=M_gQ1DqrMZSqkhuYWH_+j_R_nw@mail.gmail.com> |
On Tue, Aug 11, 2026 at 3:22 PM James Carter <[email protected]> wrote: > > For a policy with multiple modules it is possible for there to be > a chain of type alias references where an alias in one module refers > to an alias in another module which refers an alias in a third > module and so on. When expanding a policy with this sort of chain, > a situation can arise where an alias being copied references an > alias that has yet to be copied. Since the value of an alias is set > to the typemap of its primary and the typemap of its primary has not > been set yet, this alias will end up with an invalid value of 0 and > return an error. > > When copying aliases, skip over aliases that refer to an alias that > has yet to be copied and keep repeating the copying of aliases until > none have been skipped or the maximum number of repeats has been > exceeded. > > Signed-off-by: James Carter <[email protected]> > Acked-by: Stephen Smalley <[email protected]> > --- > v2: Move MAX_ALIAS_REPEATS to private.h Thanks, both patches merged.