Skip to content
This repository was archived by the owner on May 24, 2023. It is now read-only.
This repository was archived by the owner on May 24, 2023. It is now read-only.

too many auto-generated attributes may slow down the context_struct_compute_av() in kernel #9

@stesen

Description

@stesen

I found that if using the checkpolicy tool to generate sepolicy with cil mode, a lot of "base_typeattr_xx" will be auto-generated. And each of them contain a lot of types. So the "ebitmap_for_each_positive_bit" loop in context_struct_compute_av() function will run 10x times more than policy directly generated from policy.conf file.

if I comment the libsepol's set_to_cil_attr() function and re-generate cil. Kernel runs fast and happy as the non-cil mode

So, why we need so many "base_typeattr_xx" ? Is it a safe way to remove those auto-generated attributes?

Activity

jwcart2

jwcart2 commented on Mar 21, 2017

@jwcart2
Contributor
stesen

stesen commented on Mar 22, 2017

@stesen
Author

Thankyou for your reply :)

I am working on android. the latest code shows that android will using CIL in the next version.

It seems that base_typeattr_x can decrease the policy size, but use more cpu resource. So do you have some advices? Is that a good choice to set a limit number for one "base_typeattr_"?

added a commit that references this issue on May 9, 2017
added a commit that references this issue on Nov 18, 2017
added a commit that references this issue on Nov 20, 2017
added a commit that references this issue on Nov 29, 2017
added a commit that references this issue on Dec 4, 2017
added a commit that references this issue on Jul 6, 2018
stesen

stesen commented on Sep 3, 2018

@stesen
Author

Thank You :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @stesen@jwcart2

        Issue actions

          too many auto-generated attributes may slow down the context_struct_compute_av() in kernel · Issue #9 · SELinuxProject/cil