[Q] SELinux Enforced on boot - Galaxy Note 4 Q&A, Help & Troubleshooting

Hi all,
Got a Canadian Samsung Galaxy Note 4 yesterday, in replacement of my aging Nexus 4.
While I was a comfortable poweruser with my Nexus 4 (Xposed mods, Franco Kernel, double tap to wake, LTE-enabled modem, etc.), I never had to toy with SELinux, and as such I've been reading a lot on these forums. Also, since this is my first Samsung device, I learned to use Odin, pretty nifty tool!
The steps I've taken:
Rooted with CF-Auto-Root through the Odin PDA method (with the correct, Canadian .tar)
Installed TWRP 2.8.1.0 through the Odin PDA method (with the correct, Canadian .tar)
Installed BusyBox through Stericson's installer
Made a nandroid backup up with TWRP
Updated the SuperSU binary manually to 2.16 through TWRP
With Flashify, made a kernel backup
With Flashify (Flash Boot Image), flashed stockish twistedumbrella kernel (with the correct, Canadian .img) for Permissive SELinux
Edited my build.prop, to disable KNOX and SELinux, by adding the following lines at the end of the file
Code:
(SELinux disable)
ro.build.selinux=0
(KNOX disable)
ro.config.tima=0
ro.config.knox=0
Rebooted
When I check SELinux status through getenforce Terminal Emulator, I get Enforcing. When i enter setenforce permissive, I get Permissive.
Did I miss a step or do something incorrectly?
Thanks for the help
EDIT:
So JC3M4N helped me out: he suggested trying su 0 setenforce 0 or su system setenforce 0. Personally, the second one worked for me, but YMMV. Hoping this helps someone.

Is this for lollipop?

Can You Help Me Doing the same with lollipop and different variant?

Related

I have root but....

I have root all verified and supersu installed correctly & twrp custom recovery. However I tried installing a sound mod but just reboots & nothing. Same with dpi changer.
Is there some file that is somehow protecting any changes to be made even though I have root access?
Many Thanks In advance.
Duncan1982 said:
I have root all verified and supersu installed correctly & twrp custom recovery. However I tried installing a sound mod but just reboots & nothing. Same with dpi changer.
Is there some file that is somehow protecting any changes to be made even though I have root access?
Many Thanks In advance.
Click to expand...
Click to collapse
Maybe install busybox from Ericsson
Thanks I have busy box installed, this is very odd it is like there is a security file blocking everything despite root.
Xblast works as I have the clock centred and circle battery.
I am Experienced in root, and haven't stumbled upon this before.
Was thinking it was 4.4.4 but others are having success.
Hmmmm baffled.
Maybe has something to do with the security settings?
Install if you like the Wanam module and check if Disable Secure storage is disabled.
Thats all i can think about for now.
Nope nothing, even tried changing secure storage value to false and upon hitting save it reboots and nowt.
I give up can't think of anything oh it could be AEA Kernel that perhaps is causing the problem?
The only way to find out if its the kernel you flashed. Re-flash the stock-kernel
Thanks for getting back, Yeh back to stock and same problem. Maybe for some reason only have partial root, can't see that as supersu is there and functional and I have twrp custom recovery. Hmmmmm the mind boggles lol.
Reasonably experienced root user and for the life of me I can't sus what's up.
Tried refreshing the AEA Kernel and it won't even do that now.
Not that it's important, was just after a sound mod & changing the Dpi down to 560. Tried both it won't change.
Some security thing is preventing this but what could it be?
With some 4.4.4 ROMs on the note 2, there were problems with getting "full" root using twrp. I don't know if this is relatedn but the symptoms sound similar. Solution there was to use philz recovery (which isn't an option here), or for some Roms to flash an older version of supersu in twrp and then update after starting. Could be worth a shot.
Did you make sure to open the SuperSU app after rooting and update the binary? Are you SELinux permissive?
If you are having issues, download the recovery version of SuperSU, install it, then make sure to open the app so it updates.
You could also disable SELinux through the build.prop. Having a kernel that is SELinux permissive doesn't matter if you still have everything enabled in the build.prop
Code:
(SELinux disable)
ro.build.selinux=0
(KNOX disable)
ro.config.tima=0
ro.config.knox=0
If none of that has helped, it is recommended you restore to stock and root again, making sure that reactivation lock is disabled before attempting to perform the root portion.

[CM12] How to make xposed framework work on MOTO G

Hi
Xposed is here. if you are wondering it does not work for you its because the SELinux status is set as Enforcing which doesnt allow xposed framework to modify at system level. though some modules are not compatible yet
Bonus : Also if you are using Viper4Android it wont work unless the SELinux is Permissive
there is a workaround for this. 3rd being the easiest and permanent fix
1. Terminal method
Code:
Su
Setenforce permissive
soft reboot to make xposed to work
OR
2. Using SELinux Mode Changer APP
Use this app SELinux Mode Changer
change it to Permissive and soft reboot to make xposed to work
Else
3. With a modified Kernel(CM12 only) easiest method
Here is the modified Kernel which is set to permissive by default.
it is a boot.img not flashable.zip
How to flash
1. Flash this using TWRP(TWRP can flash img files now ) or apps like RASHR can be used to flash boot.img
for more info check this https://source.android.com/devices/tech/security/selinux/validate.html#switching_to_permissive
Tested with BlissPop 13th release works as intended
i have used BlissPop kernel. it is as good as CM12 Kernel
Better to have a backup(Not mandatory its upto you)
All credits to original developers
reversegear said:
Hi
Xposed is here. if you are wondering it does not work for you its because the SELinux status is set as Enforcing which doesnt allow xposed framework to modify at system level. though some modules are not compatible yet
Bonus : Also if you are using Viper4Android it wont work unless the SELinux is Permissive
there is a workaround for this. 3rd being the easiest and permanent fix
1. Terminal method
Code:
Su
Setenforce permissive
soft reboot to make xposed to work
OR
2. Using SELinux Mode Changer APP
Use this app SELinux Mode Changer
change it to Permissive and soft reboot to make xposed to work
Else
3. With a modified Kernel(CM12 only) easiest method
Here is the modified Kernel which is set to permissive by default.
it is a boot.img not flashable.zip
How to flash
1. Flash this using TWRP(TWRP can flash img files now ) or apps like RASHR can be used to flash boot.img
for more info check this https://source.android.com/devices/tech/security/selinux/validate.html#switching_to_permissive
Tested with BlissPop 13th release works as intended
i have used BlissPop kernel. it is as good as CM12 Kernel
Better to have a backup(Not mandatory its upto you)
All credits to original developers
Click to expand...
Click to collapse
Hi,
great post, thanks!
I have two questions:
- Can you provide more information about this kernel please?. Is stock cm12 kernel, only with SeLinux changed?
I don´t use cm12 because SeLinux is set to enforcing and have problems restoring nandroid backup with TWRP (no problems with philz recovery).
- I don´t have tested, but i think that if you make init.d script that change SeLinux, you would´t have to make soft reboot.
Regards.
SergioSanchezR said:
Hi,
great post, thanks!
I have two questions:
- Can you provide more information about this kernel please?. Is stock cm12 kernel, only with SeLinux changed?
I don´t use cm12 because SeLinux is set to enforcing and have problems restoring nandroid backup with TWRP (no problems with philz recovery).
- I don´t have tested, but i think that if you make init.d script that change SeLinux, you would´t have to make soft reboot.
Regards.
Click to expand...
Click to collapse
1. as i said kernel i used is from BLISSPOP rom from 13th experimental build. i dont think Bliss Team made any changes to the kernel. i guess you can flash custom kernel like optimus / Attacked on top of the modded kernel because both provide only Zimage. so that SELinux status is retained to Permissive
2. i Tried init.d script unfortunately it wont work on CM based rom so i thought of modifying in boot.img itself
Hope this helps
Cool !!
wow!, the terminal method is vv easy method. Works perfectly!!
SELinux-Status: Moderat
Hi!
I used the Terminal method.
However, the SELinux-Status is now: Moderat (see screenshot).
Can you please instruct?
THX

S4 help with root (kingroot + supersu)

hello,
first of all (as i cant update signature)
Phone: GT-i9505
TouchWiz: LP 5.0.1
Software number:
MDF v1.0 R4
VPN v1.4 R3
Kernel version: 3.4.0-4760392
Baseband version: I9505XXUHOD7
Build number: I9505XXUHOD7
so i rooted my phone using kingroot and then my phone would crash if i tried to use any root app (freeze then black screen then reboot)
i managed to flash TWRP 2.8.7.0 and void my warranty at the same time (LOL )
after trying to unroot my phone went into reboot loop so i used twrp to wipe cache nope still rebootloop
then i wiped data / factory rest and it now boots up but still has the kingroot files (and busybox files) in /sytem/xbin but the only kingroot files are krdem and ku.sud no more su binary normally just su
so what i was wandering was :
1:
is the crash a problem with SELINUX as on my phone it is ENFORCING
2:
How can i change se linux and root with supersu via twrp
3:
anything else that might help me
It is not a selinux problem. As any stock tw rom has selinux enabled and many people have rooted without much problems.
The problem is kingo root.
I'd recommend starting from 0. Meaning you have to reflash stock rom with odin and then use cf-autoroot to root the phone. It's way better and offers less problems.

How to install permissive kernel for S7 Edge?

Hi,
I searched tons of info about SeLinux state change in google and other sites(XDA too), but did not resolve problem,when i try to set permissive - su setenforce 0 - after type getenforce it still shows "enforcing" , I think my kernel do not have ability to change selinux state or turn off it(I prefer), I think I need to install custom kernel, can anyone tell me how to install permissive kernel and which kernel? Will I need to reinstall entire ROM?
S7 edge SM-G935FD, exynos, Magisk 20.3, Oreo stock rom 8.0

Systemless root with custom su binary?

I've got a H870 from Israel with locked bootloader that isn't going to be unlocked (thanks for nothing, LG).
Now I've downgraded it from Pie to Oreo, as the Oreo kernel is vulnerable to CVE-2019-2215; thanks to https://repo.or.cz/cve2019-2215-3.18.git I've got a working su binary that sets SElinux to permissive and gives me a root shell.
I'm looking for a way to integrate this with one of the usual root apps (ideally Magisk), but I'm somewhat at a loss as to how these do their magic, especially in a way that doesn't involve messing with /system (which cannot be mounted r/w and comes from a ramdisk anyway (as far as I understand it).
Does anybody have experience with this? Can Magisk do a systemless install, and can its su be substituted by my own su?
Thanks for any input

Categories

Resources