There's a reason selinux blocks you from doing this and it is exactly
because they don't want you to hijack native OS functions with your custom
library...
On Tue, Feb 3, 2015 at 11:11 AM skore <[email protected]> wrote:

> 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..."
>
> When this LD_LIBRARY_PATH will get updated?
>
> How android is differentiating the load files by modes? Want to know other
> ways to load .so file from "/data/data/packageName/files/".
>
> Regards,
>
> Skore
>
> --
> You received this message because you are subscribed to the Google Groups
> "Android Security Discussions" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To post to this group, send email to
> [email protected].
> Visit this group at
> http://groups.google.com/group/android-security-discuss.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Android Security Discussions" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/android-security-discuss.
For more options, visit https://groups.google.com/d/optout.

Reply via email to