Hi,

I am checking on permissive and Enforcing mechanism of selinux(SE Linux) in
Android 5.0. I have placed .so file in
/data/data/packageName/files/libtestcalc.so.

when the device is in permissive mode,
System.load("/data/data/packageName/files/libtestcalc.so"); - works fine
and I am able to access the methods of .so file with out any exceptions.

The same, System.load("/data/data/packageName/files/libtestcalc.so"); is
not working when the device is in Enforcing mode and I am getting exception
as follows.

java.lang.UnsatisfiedLinkError: dlopen failed: couldn't map
"/data/data/packageName/files/libtestcalc.so" segment 1: Permission denied

I guess in both the modes, same call flow will occur. I mean
System.load(..)->Runtime.getRuntime().load(..)->Runtime.getRuntime(..).doload(..)->Runtime.getRuntime().nativeLoad(..)

@Runtime.java->doLoad(..) documentation mentioned as "nativeLoad should be
synchronized so there's only one LD_LIBRARY_PATH in use regardless..."

How android is differentiating the load files by modes? Want to know other
ways to load .so file from "/data/data/packageName/files/".

At following syntax,
System.load("/data/data/packageName/files/libtestcalc.so");
I will following Warning:

type=1400 audit(0.0:41): avc: denied { execute } for
path="/data/data/packageName/files/libapscreen.so" dev=mmcblk0p12
ino=586898 scontext=u:r:platform_app:s0
tcontext=u:object_r:app_data_file:s0 tclass=file

Error as:
E/art : dlopen("/data/data/packageName/files/libapscreen.so", RTLD_LAZY)
failed: dlopen failed: couldn't map
"/data/data/packageName/files/libapscreen.so" segment 1: Permission denied
java.lang.UnsatisfiedLinkError: dlopen failed: couldn't map
"/data/data/packageName/files/libtestcalc.so" segment 1: Permission denied

How SELinux will differentiating these loading files?

Regards,

Skore
_______________________________________________
Seandroid-list mailing list
[email protected]
To unsubscribe, send email to [email protected].
To get help, send an email containing "help" to 
[email protected].

Reply via email to