Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
M
Magisk
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
Magisk
Commits
2fb49ad7
Commit
2fb49ad7
authored
Mar 19, 2022
by
LoveSy
Committed by
John Wu
Mar 19, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Don't always mock selinux enforce as "0"
parent
92f0e53f
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
1 deletion
+4
-1
selinux.cpp
native/jni/init/selinux.cpp
+4
-1
No files found.
native/jni/init/selinux.cpp
View file @
2fb49ad7
...
...
@@ -70,7 +70,6 @@ void MagiskInit::hijack_sepolicy() {
}
else
{
// We block using the "enforce" node
blocking_target
=
SELINUX_ENFORCE
;
actual_content
=
"0"
;
}
// Hijack the "load" and "enforce" node in selinuxfs to manipulate
...
...
@@ -169,6 +168,10 @@ void MagiskInit::hijack_sepolicy() {
xmount
(
"selinuxfs"
,
REAL_SELINUXFS
,
"selinuxfs"
,
0
,
nullptr
);
sepol
->
to_file
(
REAL_SELINUXFS
"/load"
);
if
(
strcmp
(
blocking_target
,
SELINUX_ENFORCE
)
==
0
)
{
actual_content
=
full_read
(
SELINUX_ENFORCE
);
}
// Write to mock blocking target ONLY after sepolicy is loaded. We need to make sure
// the actual init process is blocked until sepolicy is loaded, or else
// restorecon will fail and re-exec won't change context, causing boot failure.
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment