Questions tagged [selinux]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
11
votes
1answer
21k views

How to fix SELinux "avc: denied" errors when launching DNSCrypt as init.d script?

I've installed an unofficial lineage OS 14.1 ROM on my phone and i want to have dnscrypt used on boot by default. There is what i have done: Download arm binaries from: https://github.com/jedisct1/...
3
votes
1answer
3k views

Android 6 (cyanogenmod 13) external sd card write access

I always used "Samba server" application on all my android devices for uploading files, it worked great with CM12, but in CM13 even with root access Samba server can't write to external SD card, ...
1
vote
1answer
2k views

lsusb returns "permission denied" in Termux

When I run lsusb in Termux, the output is permission denied. I don't have root access. Perhaps the Android system allows me to get specific access in root?
1
vote
2answers
1k views

Remove a folder I created in /system/lib

I have root access and am able to remount. I created a folder in /system/lib/ named rfsa, but I don't know why I cannot see or open that folder. When I type ls, it is there. But when I type ls -l, I ...
1
vote
1answer
1k views

Checking SELinux permissions in Android?

Is there a tool that will allow me to check what permissions an application has in a file or folder?
3
votes
1answer
870 views

Cant remount /system as rw because "read only filesystem" (selinux problem)

Hello i tried to replace kingroot with Supersu, since in the newer versions of kingroot you cant block all of its connections, I had some problems, supersu always failed to install the newer binaries, ...
3
votes
1answer
1k views

How to mount system under super partion?

Google has recently changed the way to mount system and introduced Dynamic Partitions. Previously in a rooted adb shell, I used to run mount -o rw,remount /system to mount system in read-write mode. ...
0
votes
0answers
235 views

open failed: EACCES (Permission denied)

I am trying to copy the file from /storage/emulated/0/test.txt to /cache/SH_DIR/ via android user application , getting error like below : java.io.FileNotFoundException: /cache/SH_DIR/test.txt: open ...
1
vote
0answers
92 views

Should SELinux be Permissive to access /dev/diag

I am trying to set the SELinux to permissive on Android with no luck. I tried the command su 0 setenforce 0 it returns OK while still being Enforcing if checking immediately using getenforce command. ...
1
vote
1answer
940 views

Need to add custom script as service in init.rc for Android 10

I am trying run shell script in device boot-up time. Steps: Created shell script and placed into /system/bin/usbmountd.sh Added test.sh in inir.rc. service usbmountd /system/bin/usbmountd.sh user ...
6
votes
2answers
32k views

How to disable dm-verity on Android with "user" build type ROM?

I have One Plus 6T Android device which has a ROM of build type user. This device is rooted with Magisk and I want to disable dm-verity on this device. I have tried to run adb disable-verity but I got ...
1
vote
2answers
2k views

Fix SELinux contexts for a SU binary

I am trying to root my android 6.0.1 phone using the following method: I first booted into a TWRP image using fastboot boot, then using the TWRP terminal I copied the su binary from the SuperSU kit ...
1
vote
0answers
73 views

Stuck in boot loop after "Fixing SELinus contexts"

So, let's say that I have already "Fixed SELinux Contexts", and I am now in a boot loop. How could I resolve this issue. I am quite new to all of this, but I am eager to learn and fix my ...
2
votes
0answers
283 views

remount, turn off SElinux, all fails even though I am root

I have a device which is never hacked into before, mostly as nobody has it, it is a android tv box. I have temp root using the dirty cow exploit, and tried to remount system using the mount command. ...
1
vote
0answers
14 views

why DAC isn't sufficient for Android that it needs MAC(selinux)

I learned that each app is assigned a separate UID so that a rogue app cannot access other apps data and system sensetive data and files. What's problem with this that they have to use MAC(selinux)
2
votes
0answers
44 views

How would the app DiskDigger be able to get past SELinux when adbd/SuperSU/etc. cannot?

Okay, so I was able to recover my deleted files after all. I am the furthest thing from a software developer, and I don't have more time to spend on this, but I wanted to explain how I fixed it and ...
1
vote
0answers
78 views

Attempting file recovery (deleted photos) on Note 4 via accessing /data/userdata; rooted phone, patched adbd, but now USB debugging won't work

I made a post about this yesterday, and I managed to make a lot of progress today, but I'm stuck again, and I am trying to decide what to do. I am not really experienced with coding, but I happen to ...
1
vote
0answers
328 views

How to mount a tmpfs directory that would be allowed to be read and written to by any app? (root available)

I am trying to create some volatile (tmpfs) storage for my Android, to avoid clutter. I am trying to follow the previous questions: making manually mounted partition folders write accessible to all ...
-2
votes
1answer
970 views

SELinux temporary set to permissive

I am using a Galaxy s10+, rooted with magisk, no custom ROM, no custom kernel and no custom recovery. The rooting is heavily limited because of the SELinux enforce mode. Actually, no root command in ...
1
vote
0answers
155 views

Result of ls -la in adb shell

If I go into my unrooted phone's adb shell (Samsung galaxy s7 Android 8) I get a result similar to this: dr-xr-xr-x 921 root root 0 2020-01-26 10:06 acct -rw-r--r-- 1 root root 225 ...
1
vote
0answers
129 views

Starting shell script at boot in SELinux enforcing mode [closed]

I am building Android Pie (tag android-9.0.0_r46, branch android-msm-marlin-3.18-pie-qpr2) from source. I am testing on a Pixel XL (marlin). I want to have a custom shell script run automatically when ...
2
votes
0answers
413 views

SUPolicy to allow custom service to read and write from Internal Storage

I'm setting up custom service with custom sepolicy using this as a base: How to fix SELinux "avc: denied" errors when launching DNSCrypt as init.d script? In 99% I follow the quick summary ...
1
vote
0answers
480 views

How to force SELinux to permissive even when setenforce 0 is not working and kernel was 100% permissive when flashed?

I don't know what to do, I'm using Samsung Note 3 (Exynos) - N900 with custom Resurrection Remix 5.8.5 ROM (Android 7.1.2) with it's own permissive kernel and rooted with Magisk. Yesterday it turned ...
8
votes
1answer
66k views

How can I change SELinux from Enforcing to Permissive on Samsung Galaxy Note 3?

My device is Samsung Galaxy Note 3 SM-N9005. This phone comes with SELinux set to Enforcing by default. I have been trying to change this to permissive but to no avail. I built the kernel from ...
5
votes
1answer
846 views

How to run a program in an app context with Magisk?

Let's say I'm currently as root in Bash on a terminal, outside any app like Termux. I'm running Magisk. Now I want to synchronously invoke Termux's Bash, such that it behaves the same way as it would ...
2
votes
1answer
673 views

Run script using init.rc doesn't work

I'm trying to run a script that exectues when the device has finished booting. This particular device does not support running scripts from an init.d directory, which is why I am using init.rc. The ...
1
vote
1answer
19k views

How to fix: only official released binaries are allowed to be flashed(recovery) on device / FAIL! (Auth) on Odin3 v3.13?

I have Samsung S10 5G(Qualcomm) device. This device has unlocked bootloader but it is not rooted yet. I am trying to learn Unpack-Modify-Pack the ROM images. Currently, I have VZW stock ROM ...
9
votes
2answers
34k views

How to unpack/repack system.img of android ROM?

I have OnePlus 6T device which has A/B partition system and has a ROM of user type i.e [ro.build.type]: [user]. This device is rooted with Magisk. I have a requirement(Want to place customized ...
2
votes
1answer
121 views

How are apps installed on Android ? context - symbolic links of only some apps disappear after reboot

I am using Apps2sd to move some apps to ext4 partition mmcblk1p2. It successfully moved 1 app ( see code below ) but after linking another , the symblink for app gets deleted but data folder's ...
22
votes
1answer
10k views

SELinux and chroot system call

TL; DR: This is a question about the final step, in a portable, developer-oriented rooting process, that works across all Android machines. It is not based on any exploit - it is something that we are ...
0
votes
0answers
2k views

How to disable zip verification flag in stock recovery.img?

In stock recovery there is an option to install zip from the sdcard but it doesn't allow installing zips with unknown signature. Twrp can install any zip without concerning about the the zip signature....
1
vote
0answers
39 views

How to add a simple file on /system without actually modifying it but with using kernel sources? [closed]

From the time system-as-root came, developers have rooted different devices by patching the Magisk su binaries in the kernel. I want to understand how exactly they have done this so to start from ...
4
votes
1answer
1k views

What is 02 in the magisk patched vbmeta.img?

According to the Additional Info given for rooting the Android device that doesn't have ramdisk but can be rooted via recovery: we need an empty vbmeta.img and I am trying to check what it actually ...
1
vote
0answers
311 views

How can I record call using c code(c executable that can run on Android-Linux) on rooted Android device?

I want to record a call that is called by my application for the call test purposes. We record a call and compare it with a high-quality WAV file to determine the call quality. But the call recording ...
3
votes
1answer
3k views

SELinux permissive kernel - is it a security risk?

As in title. I am talking of Kernel, not ROM (plenty of questions dealing with ROM on this site). I have a OnePlus 7 running stock Android 10 and prefer a custom kernel. Of late, OnePlus hasn't ...
0
votes
1answer
968 views

how to extend support for EXT4 file system for microSD cards in stock or non lineage / CyanogenMod ROMS

As I am aware after Android 4.4 or some sort your storage card is no longer eXposed directly and needs to be carefully interfaced through specific Mount points that need to be aware through vold ...
1
vote
1answer
795 views

How to add SELinux policy on a user-debug ROM that has `split` policy scheme?

I have a Sony device that supports treble and is a system-as-root and A/B device. It has a user-debug ROM installed on it so, its adb shell is rooted. I have disabled dm-verity using adb disable-...
0
votes
0answers
2k views

Stuck in boot-loop when unpack and pack `system.img`?

Background: I have a treble and system-as-root but it is not an A/B Samsung device. I am trying to modify the system.img. Before that, I have rooted it with the steps given here. After following these ...
23
votes
1answer
53k views

How dangerous is the fact that SELinux is in "Permissive" mode? What should I be wary of?

I have installed a certain ROM which comes with SELinux in "Permissive" mode. This is the only (good) ROM that properly fits my device and there is no way to change the state of SELinux. Now I'm not ...
3
votes
0answers
3k views

How to disable dm-verity on `Treble` , `system-as-root` device?

Background: Please check following links How to disable dm-verity on Android with “user” build type ROM? Stuck in boot-loop when unpack and pack system.img? Update: So, I am trying to disable dm-...
6
votes
1answer
8k views

What does TWRP "Fix Contexts" do?

In my blu_spark TWRP, I have an option (under "Advanced") named 'Fix Contexts'. When I press it, it says: Note: Fixing contexts is rarely needed Fixing SELinux Contexts may cause your ...
0
votes
0answers
3k views

How to enforce Selinux (setprop ro.boot.selinux=enforcing)

I have a Xiaomi Redmi K20 Pro (raphael, China Version) device. I set the prop "ro.boot.selinux" to "permissive", by installing this Magisk Module. Now I'd like to set it back to "enforcing", but didn'...
0
votes
0answers
2k views

How to patch `system.img` using MagiskManager patch feature to root the device?

I have a treble and system-as-root but it is not an A/B device. I have rooted it with the help of the MagiskManager patch feature. My understanding is: MagiskManager has modified the following three ...
0
votes
0answers
2k views

How to get rid of SeLinux Denials in Permissive mode?

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 ...
7
votes
1answer
3k views

How does SuperSu provide root privilege?

Has a write-up ever been released on exactly how SuperSu works? After searching around for a while I found mostly guides on how to use the app, not the implementation details. I did, however, find ...
1
vote
1answer
698 views

Adding custom bootup script to Android-x86 Nougat

I've been happy using Android-x86 Nougat on my system. Thanks to everyone who made that work. I'm now trying to make one small change which is that I want to run a custom init script (a shell script) ...
4
votes
1answer
308 views

Does Android's implementation of SELinux's MAC inhibit apps with root privileges from accessing other app's data?

Starting with Android 4.4, SELinux's MAC is enforced. Does this mean that if an app somehow can get installed and exploit the kernel to get root privileges, that MAC will still prevent that app with ...
2
votes
1answer
3k views

Why reading permission to /proc/1/maps is denied and why doesn't the denial appear in logcat?

I'm developing a native app for Android, and I'm occasionally confronted with permission denied which doesn't trigger a log in the logcat logs. For example, trying to run: shell@kltevzw:/ $ cat /proc/...
2
votes
1answer
2k views

What sepolicy context will allow any other context to access it?

I am on a bootloader locked Sprint Samsung Galaxy S7, eng boot.img flashed to phone with SELinux permissive, which gives root adb shell from where I can change system partitions, debloat, install ...
1
vote
1answer
4k views

SELinux always set to permissive, how to set enforcing permanently?

I flash a custom ROM to my HTC B2UL. The ROM, by default, has the SELinux policy set to Permissive instead of Enforcing. I can use adb shell setenforce 1 to make SElinux enforcing. But after reboot, ...