Need some help with 3 issues:
- In
Permissive
mode I get denials, why does this happen and how do I fix that? - If I am
enforced
, how do I give access to my Partitions to various processes. Right now I ampermissive
but in case I want to switch over as enforced what do I do inenforced
mode to ensure that Apps and processes have full access to all mypartitions
on micro SD card? - How do I ensure that I have permissive mode at the time after boot? I am using
seLinux
changer app which changes the mode to permissive after boot, I am assuming.
Backdrop
I am on Android 9 Pie. Rooted
with a Custom ROM via Magisk
(v20 which is the latest).
I have 3 partitions on my MicroSD card, all ext4
. First partition is to store the external data. Second partition is for app2sd
or application data linking. And third partition is for WhatsApp
.
But I have a problem which mysteriously keeps popping up; for a very brief time it disappears and then it is again back.
The issue is when I link the WhatsApp folder in my internal storage to the third partition, it stops working and I am not able to download any images. When I try and access internal folders that are linked to my external partition on micro SD card through ADB and non-rooted prompt, it says Access denied. If after linking I have to access any file on my internal storage or external storage through a non root user, I have to copy it in /data/local/tmp
and chmod
it.
So after running a dmesg
via su
prompt, I keep getting this kind of information and I am totally confused as to how I keep getting rejects even when I am in permissive mode:
[64108.645494] type=1400 audit(1571547099.201:11658): avc: denied { call } for pid=1301 comm="pool-1-thread-1" scontext=u:r:untrusted_app:s0:c2,c257,c512,c768 tcontext=u:r:hal_memtrack_default:s0 tclass=binder permissive=1
[64108.645560] type=1400 audit(1571547144.071:11659): avc: denied { open } for pid=23335 comm="om.mobikwik_new" path="/proc/vmstat" dev="proc" ino=4026532137 scontext=u:r:untrusted_app_27:s0:c512,c768 tcontext=u:object_r:proc_vmstat:s0 tclass=file permissive=1
[62276.620621] type=1400 audit(1571545312.043:11584): avc: denied { read } for pid=8534 comm="webview_zygote" name="fonts.xml" dev="mmcblk0p66" ino=1968042 scontext=u:r:webview_zygote:s0 tcontext=u:object_r:theme_data_file:s0 tclass=file permissive=1
[61774.878054] type=1400 audit(1571544810.294:11570): avc: denied { call } for pid=1301 comm="pool-1-thread-1" scontext=u:r:untrusted_app:s0:c2,c257,c512,c768 tcontext=u:r:hal_memtrack_default:s0 tclass=binder permissive=1
[61770.686186] type=1400 audit(1571544806.104:11569): avc: denied { getattr } for pid=12417 comm=4173796E635461736B202334 path="/data/sdext2/data/com.google.android.googlequicksearchbox/cache" dev="mmcblk1p2" ino=413617 scontext=u:r:untrusted_app_25:s0:c512,c768 tcontext=u:object_r:unlabeled:s0 tclass=dir permissive=1
[59854.882802] type=1400 audit(1571542825.956:11523): avc: denied { call } for pid=13288 comm="GoogleLocationS" scontext=u:r:priv_app:s0:c512,c768 tcontext=u:r:hal_memtrack_default:s0 tclass=binder permissive=1
[58684.872549] type=1400 audit(1571541715.916:11505): avc: denied { getattr } for pid=4379 comm="Binder:4379_3" path="/storage/6226b27a-ebc1-4fdd-b54c-096abc40c2b9" dev="tmpfs" ino=52150 scontext=u:r:untrusted_app:s0:c241,c256,c512,c768 tcontext=u:object_r:storage_stub_file:s0 tclass=dir permissive=1
[58416.978554] type=1400 audit(1571541430.215:11458): avc: denied { open } for pid=31520 comm="CallMonitors-1" path="/proc/stat" dev="proc" ino=4026532088 scontext=u:r:untrusted_app:s0:c18,c257,c512,c768 tcontext=u:object_r:proc_stat:s0 tclass=file permissive=1
What I did:
- Tried to use the script approach with
setenforce 0
underinit.d
dir. Hopelessly works only in <5.0. - Tried to remount partitions as R/W.
permissive=1
is just a warning, it doesn't restricts you from doing anything. 2. You need to modify SELinux policy. 3. You need to define aninit
service. // For mounting a SD card partition to be used by apps for storing data, you need to consider 1. Ownership 2. Permission mode 3. SELinux context 4. Mount namespace. If any of the four isn't configured properly, you'll be in trouble.enforcing
inpermissive
mode only on your device. You can modifysepolicy
to get rid of denial messages but that won't solve your problem for sure.