Skip to content

Commit

Permalink
improve: SELinux rules
Browse files Browse the repository at this point in the history
This commit is taken from JingMatrix/NeoZygisk@2bf90c1. Note that this will still cause issue with some modules due unused rules being taken out.
  • Loading branch information
ThePedroo committed Jan 6, 2025
1 parent 42ce44e commit c5f9b94
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 9 deletions.
12 changes: 4 additions & 8 deletions module/src/sepolicy.rule
Original file line number Diff line number Diff line change
@@ -1,19 +1,15 @@
type magisk_file file_type
typeattribute magisk_file mlstrustedobject
allow zygote magisk_file sock_file {read write}
type zygisk_file file_type
typeattribute zygisk_file mlstrustedobject
allow zygote zygisk_file sock_file {read write}

allow zygote magisk lnk_file read
allow zygote unlabeled file {read open}
allow zygote zygote capability sys_chroot
allow zygote su dir search
allow zygote su lnk_file read
allow zygote su file read
allow zygote su {lnk_file file} read

allow zygote adb_data_file dir search
allow zygote zygote process execmem
allow system_server system_server process execmem
allow zygote tmpfs file *
allow zygote appdomain_tmpfs file *

allow zygote mnt_vendor_file dir search
allow zygote fs_type filesystem unmount
2 changes: 1 addition & 1 deletion zygiskd/src/utils.c
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ int unix_listener_from_path(char *restrict path) {
return -1;
}

if (chcon(path, "u:object_r:magisk_file:s0") == -1) {
if (chcon(path, "u:object_r:zygisk_file:s0") == -1) {
LOGE("chcon: %s\n", strerror(errno));

return -1;
Expand Down

0 comments on commit c5f9b94

Please sign in to comment.