Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix bug in Checkmodule when downwriting to Module version 12 or lower. #273

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Commits on Nov 30, 2020

  1. Fix bug in policydb_write when attempting to correct policy for older…

    … versions.
    
    The current implementation fails as it doesn't remove scope declarations further in
    the modular policy.
    
    This fixes the problem by removing the offending entries in the hash table and
    the scope table.
    
    Steps to reproduce:
    
    Try to build the following module then make a module from an older release:
    module test 1.0.0;
    
    require {
      type default_t;
    }
    attribute_role new_atrole;
    checkmodule -M -m -c 12 -o test.mod test.te
    semodule_package -o test.pp -m test.mod
    semodule_package:  Error while reading policy module from test.mod
    
    Failure occurs when the current module gets written out with the scope declaration intact.
    This is due to policydb.c:3913 doing a hashtab search on a scope key that is not
    in the symbol table.
    
    Signed-off-by: Matthew Ife <[email protected]>
    Matthew Ife committed Nov 30, 2020
    Configuration menu
    Copy the full SHA
    ee4e1ed View commit details
    Browse the repository at this point in the history
  2. Smaller bugfixes and testing module works as imagined.

    Signed-off-by: Matthew Ife <[email protected]>
    Matthew Ife committed Nov 30, 2020
    Configuration menu
    Copy the full SHA
    5c8d727 View commit details
    Browse the repository at this point in the history
  3. Retab me.

    Signed-off-by: Matthew Ife <[email protected]>
    deleriux committed Nov 30, 2020
    Configuration menu
    Copy the full SHA
    2299634 View commit details
    Browse the repository at this point in the history