diff options
| author | Maxime Bélair <maxime.belair@canonical.com> | 2026-09-01 16:07:15 +0200 |
|---|---|---|
| committer | John Johansen <john.johansen@canonical.com> | 2026-10-29 08:30:53 -0700 |
| commit | e667fc72f7f4a54674962c324048ca2cc58bc703 (patch) | |
| tree | d0f7d28d17360ab3942db19b3dbcb76b1d4947b2 /scripts/Makefile.thinlto | |
| parent | 449195a4bb7d9c456c02b871eec6905edb449bd2 (diff) | |
| download | linux-e667fc72f7f4a54674962c324048ca2cc58bc703.tar.gz linux-e667fc72f7f4a54674962c324048ca2cc58bc703.zip | |
apparmor: convert duplicated dfa transitions to match_char()
For historical reasons several matchers duplicate the dfa character
transition instead of using match_char().
This is because aa_dfa_match_until() and aa_dfa_matchn_until() were
written on a branch that did not yet have match_char(), and copied code
from aa_dfa_match(). leftmatch_fb() used the same pattern.
When match_char() added support for diff-encoded states, the change was
never ported to these copies.
match_char() resolves a diff encoded state by using def[state] and
retrying the same character, until it reaches a state with a valid
transition. The copies instead do a simple `state = def[state];` after
the character is consumed, so on a diff encoded state one byte is dropped
and the walk continues from the diff parent in the wrong state.
This makes an unnamed px/Px/cx/Cx transition resolve to no profile, and
exec fails with
apparmor="DENIED" operation="exec" info="profile transition not found"
Convert the three copies to match_char(). For a dfa with no diff
encoded state this is a no-op.
This bug is latent until the kernel advertises policy/diff-encode.
Closes: https://gitlab.com/apparmor/apparmor/-/work_items/663
Fixes: 21f606610502 ("apparmor: improve overlapping domain attachment resolution")
Fixes: 031dcc8f4e84f ("apparmor: dfa add support for state differential encoding")
Signed-off-by: Maxime Bélair <maxime.belair@canonical.com>
Signed-off-by: John Johansen <john.johansen@canonical.com>
Diffstat (limited to 'scripts/Makefile.thinlto')
0 files changed, 0 insertions, 0 deletions
