Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [selinux]

The tag has no usage guidance.

1
vote
1answer
36 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
46 views

how to create android sepolicy based on the denial execute_no_trans

I am trying to execute my init.inmod.sh from /vendor/bin and using below method: init.inmod.sh -> /vendor/bin/test_disp hdcp disable in vendor specific .rc file i will do start inmod_sh service ...
0
votes
1answer
58 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 ...
0
votes
0answers
43 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) ...
0
votes
1answer
242 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
112 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
35 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 ...
1
vote
1answer
251 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 ...
2
votes
1answer
628 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
87 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
53 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
647 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
454 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
544 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', ...
1
vote
1answer
4k 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 ...
0
votes
1answer
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
804 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
560 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
131 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
489 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
206 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
807 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
519 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
638 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, ...
4
votes
1answer
5k views

What is SELinux and its purpose?

For those of you who don't know, SELinux is a collection of administrative tools on Linux OS'. However, what is it for on android, and what does it do on android? After all, Android is not Linux. ...
1
vote
0answers
667 views

selinux denies busybox although selinux is set to permissive?

Device-info: Phone: Sony Xperia Z1 Model number: C6903 Android version: 5.1.1 Build Number: 14.6.A.1.236 Rooted, BusyBox and Terminal Emulator installed (Play Store Version!!!) I have formatted an ...
1
vote
1answer
543 views

SELinux restricting my system app even while it was signed with the same key as the previously shipped one!

Well, I have something weird going on. I was thinking fiddling around with Dotcase.apk from CyanogenMod 13, so I was able to rebuild the apk. I even made sure to sign it with the Platform Android test ...
1
vote
1answer
902 views

How to troubleshoot SELinux issues?

On standard GNU/Linux computers, SELinux comes with a set of tools allowing the administrator to troubleshoot permission issues. Such tools allow to: Temporarily switch a single domain in permissive ...
12
votes
1answer
20k 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 ...
0
votes
0answers
86 views

SELinux policy loading and enforcement on Android

In the most recent versions of Android, SELinux enforcement is enabled in the kernel and is static, but how can this work before a policy has been loaded? Is the policy embedded in the kernel? If not, ...
1
vote
1answer
26k views

How to set SELinux to Permissive

Since installing XtreStoLite 3.1.1, SELinux is set to Enforcing (when I try to boot into TWRP recovery). I tried setting it to permissive (Enforcing = 0) using a terminal emulator (the phone is rooted)...
1
vote
1answer
1k views

What does exactly “Re-root System (SuperSU)” do to your phone in Philz Touch Recovery?

I tried to manually root my phone via pushing a proper su binary to /system/bin and /system/xbin. I was able to push them via adb in recovery, which is a root one (idk why). Once inside my phone, I ...
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
2answers
715 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 ...
2
votes
0answers
1k 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 who to use the app, no the implementation details. I did, however, find ...
1
vote
0answers
136 views

Fix SELinux labels after restoring /data on CM 12.1

I restored an automatic backup on Cyanogenmod 12.1 created with rsync of my /data partition, but now SELinux is denying apps access to their data. Disabling SELinux "fixes" this problem, but can I ...
12
votes
5answers
7k views

Examine android (v30) selinux policy

I'm trying to find what policy is actually enforced by my phone using selinux. You'd think this would be easy. After all, for security it is good to verify that your policy matches expectations. ...
20
votes
1answer
8k 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 ...
2
votes
1answer
1k views

How SElinux protects android from rooting

I know when rooting we execute a script and we use a thing that is already root and tell it to execute if it executes the script as root and then roots the phone so how does SElinux helps to protect ...
2
votes
0answers
1k views

SELinux context init_shell in boot.img permission denied with Android 5.0.2

I'am used to start a service in the android boot image with inherited context of the init.rc script (u:r:init:s0). In Android 5.0.2 (Samsung), my service does not inherity the init context anymore, it ...
1
vote
2answers
7k views

Set SELinux mode to Permissive permanently

My Samsung Galaxy Note S2 (GT-N7102) running stock 4.3 JellyBean by default blocks all apps from Google (courtesy of the Chinese government). I followed a tutorial to gain access to gapps that relies ...
1
vote
1answer
2k views

How to completely disable SELinux in Android L in the init.rc file

I want to disable SELinux at boot time for Android L or 5. The reason is because my daemon is not begin executed on boot when it should due to SELinux problems. I have the following in my init.rc file:...
3
votes
0answers
141 views

unable to connect to my nexus 10 with android 4.4 and cyanogenmod with a remote desktop manager

Hello android users and developers. I would like to give a developer temporary access to my tablet so he can help me solve a problem. On the tablet is running android 4.4 + cyanogen mod 11. I have ...
2
votes
1answer
2k views

Is it possible to find the full SELinux ruleset for OEM's stock ROMs?

I'm writing a root app following Chainfire's documentation, but I found I've to run some command in another SELinux context. Using that context on my device (OnePlus One with CM12 nightly), I've no ...
3
votes
1answer
6k views

How to fix file permissions on Android 5 so that a certain app can access certain files?

Background: I had a rooted Nexus 4 with Android 4.4.4 that was working well. Then I got the notification to update to Android 5. To this end, I flashed the stock recovery for Android 4.4.4 from Google ...
3
votes
0answers
231 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 ...
4
votes
1answer
6k views

How can I set the correct SELinux / SEAndroid policy for an App?

I am using the free SSHelper SSH server on my phone to get SSH access. However, the application is not behaving correctly under SELinux when set to Enforcing mode, but seem to be OK when using ...
1
vote
1answer
4k views

ssh: No controlling tty: open /dev/tty: No such device or address

When connecting from PC/Cygwin via SSH (over WiFi) to phone, I am always greeted with the following macabre message: $ ssh -T root@192.168.1.100 -p 50000 Authenticated with partial success. root@192....
2
votes
3answers
35k views

How to make SELinux permissive on a Knox Samsung device?

I have a Samsung note 2014 which I rooted following this tutorial. However I now have problems with SELinux which (apparently) is preventing me from installing a Linux virtual box. I backed up and ...
0
votes
2answers
370 views

Would it be possible to sandbox apps with SELinux?

Many apps require too much permissions that they do not need to function Most apps needs internet connection to talk to some API (let's say updates checking or notifications.. etc) and need to access ...