Questions tagged [selinux]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
2
votes
1answer
32 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 ...
2
votes
1answer
75 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 ...
0
votes
0answers
58 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. I have followed below steps: 1.Created shell script and placed into /system/bin/usbmountd.sh 2.Added test.sh in inir.rc. service usbmountd /...
0
votes
0answers
117 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
34 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 ...
1
vote
0answers
137 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. ...
4
votes
1answer
344 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
121 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 ...
2
votes
1answer
742 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
213 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
193 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-...
1
vote
0answers
848 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
2k 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 device ...
0
votes
0answers
696 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
776 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 ...
0
votes
0answers
692 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 ...
1
vote
1answer
7k 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 ...
0
votes
0answers
31 views

Choosing between Android security patches and SELinux enforcing

My phone is no longer receiving system updates from the manufacturer so I'm stuck with Android 8.1 December 2018 Android security patches. There are a few custom ROMs available for my phone, based on ...
0
votes
0answers
348 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 ...
4
votes
1answer
273 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 ...
1
vote
1answer
1k 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, ...
3
votes
2answers
9k 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 ...
3
votes
1answer
10k 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 ...
0
votes
0answers
33 views

Can we modify the AOSP system directory neverallows for allowing process on seandroid?

Can we modify the system directory neverallows for allowing rules. Because I'm adding allow rules in the device sepolicy directory,but it gives never allow errors at build time for that I'm adding ...
2
votes
1answer
534 views

How to make SELinux injected rules persistent without unpacking-packing boot.img?

I am working on an application that needs root access and I have a device which is rooted but not with Magisk. This device has only adb shell root available. So, I need an alternative to call the ...
-1
votes
1answer
618 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
1answer
2k views

How to set SELinux enforcing, config file not found?

I have Samsung Galaxy J7 Core (SM-J701F), I'm running Magisk on my device and I ran the SafteyNet test and it failed. While trying to solve this I tried to change selinux state to enforced by editing /...
0
votes
0answers
432 views

How to create Android sepolicy based on the denial “execute_no_trans”?

I am trying to execute my script /vendor/bin/init.inmod.sh using below method: Script init.inmod.sh: #!/shebang??? /vendor/bin/test_disp hdcp disable In vendor specific .rc file: on ??? start ...
0
votes
1answer
882 views

SELinux Policy from Permissive to Enforcing

Using Nexus 5 with AospExtended ROM (Android 9) 19/04/05 The ROM, by default, has the SELinux policy set to Permissive instead of Enforcing. Is there any way, perhaps using TWRP Recovery, to change ...
1
vote
1answer
359 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) ...
1
vote
1answer
1k views

Why lsusb gets “permission denied” error in Termux?

When I run this command in Termux the output gets permission denied. I don't have root access, perhaps Android system allows me to get the specific access in root.
1
vote
1answer
956 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
0answers
138 views

Is it possible to see which process is calling the zygote socket?

I want to see a verbose from the zygote socket (located in /dev/socket/zygote ) I know i can list all of the services from adb but I wanna see who is calling zygote to fork an specific process. Do you ...
4
votes
1answer
2k views

What special privileges “/system/xbin/su” does have w.r.t. root access?

This answer says: Because of the way directory/file permissions are configured on Android, you need to have the su binary on your /system partition in order for it to work. Putting elsewhere ...
4
votes
1answer
7k 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/...
2
votes
1answer
1k 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/...
1
vote
0answers
90 views

Create a private folder in Android: set the SELinux attribute of a folder in external storage

There are quite a few apps that require read and write access to the external storage, which gives them access to the whole /sdcard directory. But since that is also the only storage the user ...
0
votes
0answers
1k views

Graphics/vnc/ssh connect failed failed

Installed Kali Linux rolling through deploy on coolpad cool1. Debugging mode on. Rooted. Busbox checked. And terminal also fails to start. More info and config in the screenshots given below
1
vote
0answers
589 views

Write protection of loop device // Read-Only Filesystem

After spending days on that topic I am in need of additional ideas ;) Facts: MTK6757 / Android 7 / Kernel 4.4.15 / FS EXT4 (No F2FS) / Working Root I have a fresh and clean 64MB EXT4 .IMG File in /...
0
votes
1answer
657 views

Is 'SELinux enforcing' responsible?

My HTC android mobile is rooted after unlocking the bootloader, but it is with S-ON. When I write some files(I mean copy and paste) inside my '/system' partition for the purpose of applying a 'Mod', ...
2
votes
1answer
5k views

SELinux prevents my init.rc exec command to execute

I've added a exec command at the end of init.rc file. on property:dev.bootcomplete=1 exec u:r:shell:s0 shell shell -- /system/bin/am start -n com.example.package/com.example.package.MainActivity ...
1
vote
2answers
1k 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
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?
0
votes
0answers
745 views

How to edit /sys/ files properly without root?

I have android device with version 5.1.1 . The device is not rooted, but root can be accessed on /system or /data partition files from the custom TWRP recovery using adb. The device has SELINUX ...
0
votes
1answer
168 views

Which is less insecure - mounting /system rw or disabling SELinux

I recently upgraded my (rooted) Oneplus 3 to Nougat, and Adaway - which modifys the hosts file broke. I have been unable to get symlinking the hosts file to work because SELinux gets in the way. ...
2
votes
0answers
606 views

Tried many ways to root my Telenor Infinity E

I have been trying to root my phone for two weeks using various exploits but till now all in vain. The devices isn't international so its not famous and I couldn't find any recovery, custom root or ...
1
vote
0answers
253 views

Why init domain failed to execute shell_exec type though there is “domain_auto_trans(init, shell_exec, init_shell)” in the sepolicy?

I'm trying an root exploit on android 5.1.1 and I have gotten root permission with u:r:init:s0 context now. But when I tried to execute system("sh"), it was denied: type=1400 audit(62.480:16): avc: ...
0
votes
0answers
1k views

Removing Knox and SElinux

I am having problems setting the kernel to permissive (SElinux). I have already tried the setenforce 0 command with terminal but it immediately goes back to enforcing as soon as I set the setenforce 0 ...
0
votes
1answer
564 views

Verifying device integrity. Galaxy Tab S2 9.7"

I wanted to root my Galaxy Tab S2 9.7" LTE (SM-T815Y) and I have spent the better part of my night doing the following. (I have never rooted anything before) Got a img of autoroot from some site and ...
3
votes
1answer
772 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, ...