简体   繁体   中英

Android SELinux errors in logcat

I keep getting these strange errors in my logcat. Not only do I have no idea what they mean, but no idea what is causing them. They appear when my app first starts.

> E/SELinux (8163): Function: selinux_android_load_priority [0], There
> is no sepolicy file  E/SELinux (8163): Function:
> selinux_android_load_priority [1], There is no sepolicy version file 
> E/SELinux (8163): selinux_android_seapp_context_reload: seapp_contexts
> file is loaded from /seapp_contexts

I've done lots of Google searches and can't figure out why my app is generating these. It appears something security oriented, which is strange as the app does nothing security oriented.

The app I'm working on uses permissions to access the gps, coarse and fine, the internet and network state, and finally, write access to external storage.

To make my question more specific, what do these errors mean?

I had the same problem with Titanium Appcelerator and I realized I had 2 debug sessions running. So, in eclipse I had to close them by clicking the "Remove Launch button" at the bottom and start a new one fresh. Also make sure the app is closed on your device before you launch.

These messages are likely from the selinux Zygote modifications and are harmless.

When the Zygote forks and specializes to run your apk it transitions all applications into various SELinux domains before giving your application control. The version error is about a missing version file and will not result in any fatal errors. The load message isn't really an error but informational. IIRC the last message never existed and likely added by an OEM or was removed at some point.

The libselinux code that contains this functionality is here:

https://android.googlesource.com/platform/external/libselinux/+/master/src/android.c

A book called Exploring SE for Android covers these internals in great detail (authored by me). https://www.packtpub.com/networking-and-servers/exploring-se-android

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM