Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
libsepol/cil: Properly check for loops in sets
Commit 61fbdce (ibsepol/cil: Check for self-referential loops in sets) added checks for self-referential loops in user, role, type, and category sets. Unfortunately, this check ends up in an infinite loop if the set with the self-referential loop is used in a different set that is checked before the bad set. The problem with the old check is that only the initial datum is used for the check. Instead, use a stack to track all of the set datums that are currently involved as the check is made. A self-referential loop occurs if a duplicate datum is found for any of the datums in the stack. Signed-off-by: James Carter <jwcart2@gmail.com> Acked-by: Nicolas Iooss <nicolas.iooss@m4x.org>
- Loading branch information
Showing
1 changed file
with
32 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters