I hacked together a lstopo APK, and the patch I sent earlier makes a
difference, although lstopo still doesn't fully work on Android.

The statically linked binary you sent earlier, run directly on the
shell (as root in an emulator):

    Machine (1499MB total) + NUMANode L#0 (P#0 1499MB) + Package L#0 +
    Core L#0 + PU L#0 (P#0) Block "vda"
      Block "vdb"
      Block "vdc"
      Block "vdd"
      Net "eth0"

lstopo as an APK *without* the patch I sent (logcat):

    ample.lstopoJNI: type=1400 audit(0.0:23): avc: denied { read } for
    name="/" dev="rootfs" ino=1 scontext=u:r:untrusted_app:s0:c512,c768
    tcontext=u:object_r:rootfs:s0 tclass=dir permissive=0 10-25

    lstopo  : Machine + PU L#0 (P#0)

    ample.lstopoJNI: type=1400 audit(0.0:24): avc: denied { read } for
    name="/" dev="rootfs" ino=1 scontext=u:r:untrusted_app:s0:c512,c768
    tcontext=u:object_r:rootfs:s0 tclass=dir permissive=0

lstopo as an APK *with* the patch I sent (logcat):

    ample.lstopoJNI: type=1400 audit(0.0:17): avc: denied { read } for
    name="devices" dev="sysfs" ino=23
    scontext=u:r:untrusted_app:s0:c512,c768
    tcontext=u:object_r:sysfs:s0 tclass=dir permissive=0 10-25
    
    lstopo  : buf:Machine (1499MB) + Package L#0 + Core L#0 + PU L#0
    (P#0)

    ample.lstopoJNI: type=1400 audit(0.0:18): avc: denied { read } for
    name="/" dev="rootfs" ino=1 scontext=u:r:untrusted_app:s0:c512,c768
    tcontext=u:object_r:rootfs:s0 tclass=dir permissive=0

You can see the "permission denied" messages on the logcat, but with
the patch, there is some extra information. This information seems to be
enough in my use case. If you want to fully integrate lstopo in a
non-root Android application, you will need to work a bit more on this.
Unfortunately, I cannot work on that at this moment.

Marc

>On Tue, 25 Oct 2016 15:57:42 +0200
>Samuel Thibault <samuel.thiba...@inria.fr> wrote:
>
> Hello,
> 
> Brice Goglin, on Tue 25 Oct 2016 10:56:30 +0200, wrote:
> > It's not running as an
> > APK, but it's running inside a shell that was launched by an APK
> > (sshdroid, a ssh server shell). Not sure why this would be
> > different?  
> 
> IIRC such shells have to circumvent some OS protections to run. So
> they are running at higher privilege than normal applications.
> 
> Samuel
> _______________________________________________
> hwloc-users mailing list
> hwloc-users@lists.open-mpi.org
> https://rfd.newmexicoconsortium.org/mailman/listinfo/hwloc-users


WARNING / LEGAL TEXT: This message is intended only for the use of the
individual or entity to which it is addressed and may contain
information which is privileged, confidential, proprietary, or exempt
from disclosure under applicable law. If you are not the intended
recipient or the person responsible for delivering the message to the
intended recipient, you are strictly prohibited from disclosing,
distributing, copying, or in any way using this message. If you have
received this communication in error, please notify the sender and
destroy and delete any copies you may have received.

http://www.bsc.es/disclaimer
_______________________________________________
hwloc-users mailing list
hwloc-users@lists.open-mpi.org
https://rfd.newmexicoconsortium.org/mailman/listinfo/hwloc-users

Reply via email to