Skip to content

"Segmentation fault (core dumped)" when trying to create new context #17

@emanruse

Description

@emanruse

STR:

  1. Follow the build instructions from the README to build on a Linux system:
autoreconf -i
./configure
make
sudo cp ./seinfo ./sesearch ./sepolicy-inject /usr/local/bin  # optional

The result is successful.
Then, using a sepolicy file from unpacked Android boot.img:

  1. Test to inject a policy as described in the README:
$ sepolicy-inject -s vdc -t devpts -c chr_file -p read,write -P sepolicy -o sepolicy2
(Android M policy compatibility mode)
libsepol.policydb_index_others: security:  1 users, 2 roles, 577 types, 0 bools
libsepol.policydb_index_others: security: 1 sens, 1024 cats
libsepol.policydb_index_others: security:  87 classes, 5374 rules, 0 cond rules
Success

So, this works.

Now, I want to create a new context. For the sake of testing I name it tezzzt:

  1. Run this command
$ sepolicy-inject -s tezzzt -t devpts -c chr_file -p read,write -P sepolicy -o sepolicy2
(Android M policy compatibility mode)
libsepol.policydb_index_others: security:  1 users, 2 roles, 577 types, 0 bools
libsepol.policydb_index_others: security: 1 sens, 1024 cats
libsepol.policydb_index_others: security:  87 classes, 5374 rules, 0 cond rules
type tezzzt does not exist, creating
Segmentation fault (core dumped)

The problem:

seplicy-inject says it is creating the non-existing source context but for some reason this ends up with a segmentation fault. I have no clue how to fix this and how to create a new context in the sepolicy.

Please advise.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions