-
-
Notifications
You must be signed in to change notification settings - Fork 331
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
magisk: Better hiddens #166
base: master
Are you sure you want to change the base?
Conversation
MlgmXyysd
commented
Mar 11, 2022
•
edited
Loading
edited
- magisk: Better hidden SELinux Permissive state
- magisk: Spoof residual items in kernel cmdline to make some apps happy
- More tests may be required
Signed-off-by: Jaida Wu <mlgmxyysd@meowcat.org>
to make some apps happy Signed-off-by: Jaida Wu <mlgmxyysd@meowcat.org>
About the SELinux thing.. I forget the why of it now, but John intentionally switched from setting the prop to 0 (the correct value apparently, per above) to deleting the prop. |
Apps aren't normally supposed to be able to read cmdline, so why not |
Both are OK. Which do you think is better? |
I saw this, but don't understand why. |
In that case, I'd prefer chmod as it's much simpler and better matches the expected environment. |
Right, so there's definitely conflicting information about whether it should be 0 or 1 for enforcing. Maybe that's why he deleted it instead? My feel is it should stay the way John figured out. |
Signed-off-by: Jaida Wu <mlgmxyysd@meowcat.org>
Signed-off-by: Jaida Wu <mlgmxyysd@meowcat.org>
Some of those SELinux bind mounts and chmods might interfere with integral new Magisk stuff: topjohnwu/Magisk@2fb49ad References: |
How about this?
or add
|
Live policy patching causes kernel panic on several vendors. Also, no. We should not nuke SELinux. 🙃 |
When selinux is enforced, app will not have permission to get selinux status, so i think chmod 660 is enough |
Also perhaps not advisable anymore: #166 (comment) But, having read into it more now, perhaps could work since all the Magisk sepolicy hijacking stuff is pre-init.. 🤔 |
What if we move it around a bit. 🤔
|
Looking a little more into it.. Do we need to set Both enforcing and permissive [ stock and/custom rom(s) ] are set to 0440. Setting |
And apps will detect permission flag... |
Came over this yesterday, so thought I should post. Firstly, https://cs.android.com/search?q=content:%22ro.build.selinux%22&start=1 And it seems to be only used for android tv devices Settings app to change selinux mode now and should normally be unset on handheld devices (I don't see any references anymore for selinux in current Settings app source). Root checking apps shouldn't rely on it since it normally wouldn't be set and even if value was set to https://source.android.com/docs/security/features/selinux#background https://source.android.com/docs/security/features/selinux/validate#switching_to_permissive https://cs.android.com/android/_/android/platform/build/+/9d8a51f537cc1191655e0d8edc7eaffde2503ac7 https://cs.android.com/android/_/android/platform/build/+/92ca0197ed22897633ed9241c9f4ae2128ef5c13 https://android-review.googlesource.com/c/platform/packages/apps/Settings/+/32210 Actual values can be checked with syscalls, which non privileged apps shouldn't be able to check due to permission denials. Also if checking with rootbeer, note that it will check if value |
Can we check this on priority and roll out a new version if everything looks good? |
Bank app checking SELinux as well on S21 Ultra. If everything looks good, when will a new version roll out with SELinux hidden so I can use the app as expected? |
Because |
https://cs.android.com/android/_/android/platform/build/+/9d8a51f537cc1191655e0d8edc7eaffde2503ac7 |
how can I edit android.os.SystemProperties to avoid the false positive? Thanks in advance! |
Necrobump to clear up the confusion above... You guys were talking about different props: ro.build.selinux=1 or 0 (but still debatable if either can be considered universally "correct", since it seems to differ across OEMs/devices, per the old Magisk issue I linked) ro.boot.selinux=enforcing or permissive |
Ah, damn, you are right. Not sure why I overlooked that. Apologies. |