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

About Closing SELinux #8

Open
YeJZ opened this issue Apr 26, 2022 · 3 comments
Open

About Closing SELinux #8

YeJZ opened this issue Apr 26, 2022 · 3 comments

Comments

@YeJZ
Copy link

YeJZ commented Apr 26, 2022

Hi, here is my reprodued exploit on Pixel 6:

image

I noticed that we need to manually execute setenforce 0 after using magisk to escalate to ROOT.

But in mymod.c, I see that the KO file already has the code to set SELINUX to Permissive mode.

image

Why do we need to manually set setenforce to 0 when selinux is already set to permissive in the KO file?

@polygraphene
Copy link
Owner

Because you are in a permissive domain.
Permissive domain means permissive mode only when you are in that domain. The kernel module put vendor_modprobe onto a permissive domain.

You need setenforce 0 if you want all domains on the system to be permissive. But I don' think you need that because u:r:magisk:s0 is also a permissive domain. When you run su command, all operations is executed on the permissive domain.

@YeJZ
Copy link
Author

YeJZ commented Apr 26, 2022

OK.I see a lot of chcon conmand in the script named Start-Root,so it is the reason that u:r:magisk:S0 is a permissive domain, Right? And we can execute chcon command only if we are already in a permissive domain, that's why we need to set vendor_modprobe onto permissive domain first.

@polygraphene
Copy link
Owner

polygraphene commented Apr 27, 2022

OK.I see a lot of chcon conmand in the script named Start-Root,so it is the reason that u:r:magisk:S0 is a permissive domain, Right?

Yes.

And we can execute chcon command only if we are already in a permissive domain, that's why we need to set vendor_modprobe onto permissive domain first.

Yes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants