Status: New
Owner: ----
Labels: Type-Defect Priority-Medium

New issue 329 by [email protected]: Unable to sanitize system_server on android
http://code.google.com/p/address-sanitizer/issues/detail?id=329

What steps will reproduce the problem?
1. build an eng ROM with AOSP PLATFORM_VERSION 4.4.3.43.43.43
2. build again with WITH_ADDRESS_SANITIZER=true
3. run the emulator
4. use below commands to setup asan environment
$ adb logcat -c
$ adb shell setprop wrap.system_server "logwrapper asanwrapper"
$ adb shell stop
$ adb shell start
$ adb logcat -v threadtime > asan_system_server.log
5. system server cannot be started

What is the expected output? What do you see instead?
By referencing the https://code.google.com/p/address-sanitizer/issues/detail?id=320#c2, I expect sanitizing system_server is worked by setting system property. From attached log, system_server cannot be started due to "execv failed: EACCES (Permission denied)".

Please provide any additional information below.
$ adb shell getprop |grep wrapper
[wrap.system_server]: [logwrapper asanwrapper]

$ adb shell ls -l /system/bin | grep wrapper
-rwxr-xr-x root     shell        5408 2014-07-25 07:56 asanwrapper
-rwxr-xr-x root     shell       13660 2014-07-25 08:11 logwrapper

Some related runtime logs, please reference attached for all.
08-01 06:09:39.141 1064 1064 I Zygote : System server process 1548 has been created 08-01 06:09:39.212 1064 1064 I Zygote : Accepting command socket connections 08-01 06:09:39.390 1548 1548 W system_server: type=1400 audit(0.0:4): avc: denied { execute } for name="sh" dev="mtdblock0" ino=238 scontext=u:r:system_server:s0 tcontext=u:object_r:shell_exec:s0 tclass=file permissive=0
08-01 06:09:39.491  1548  1548 E Zygote  : Zygote died with exception
08-01 06:09:39.491 1548 1548 E Zygote : java.lang.RuntimeException: android.system.ErrnoException: execv failed: EACCES (Permission denied) 08-01 06:09:39.491 1548 1548 E Zygote : at com.android.internal.os.Zygote.execShell(Zygote.java:146) 08-01 06:09:39.491 1548 1548 E Zygote : at com.android.internal.os.WrapperInit.execApplication(WrapperInit.java:109) 08-01 06:09:39.491 1548 1548 E Zygote : at com.android.internal.os.ZygoteInit.handleSystemServerProcess(ZygoteInit.java:493) 08-01 06:09:39.491 1548 1548 E Zygote : at com.android.internal.os.ZygoteInit.startSystemServer(ZygoteInit.java:561) 08-01 06:09:39.491 1548 1548 E Zygote : at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:623) 08-01 06:09:39.491 1548 1548 E Zygote : Caused by: android.system.ErrnoException: execv failed: EACCES (Permission denied) 08-01 06:09:39.491 1548 1548 E Zygote : at libcore.io.Posix.execv(Native Method) 08-01 06:09:39.491 1548 1548 E Zygote : at libcore.io.ForwardingOs.execv(ForwardingOs.java:63) 08-01 06:09:39.491 1548 1548 E Zygote : at android.system.Os.execv(Os.java:109) 08-01 06:09:39.491 1548 1548 E Zygote : at com.android.internal.os.Zygote.execShell(Zygote.java:144)
08-01 06:09:39.491  1548  1548 E Zygote  :      ... 4 more
08-01 06:09:39.491  1548  1548 D AndroidRuntime: Shutting down VM
08-01 06:09:39.955 1064 1064 E Zygote : Exit zygote because system server (1548) has terminated



Attachments:
        asan_system_server.log  734 KB

--
You received this message because this project is configured to send all issue notifications to this address.
You may adjust your notification preferences at:
https://code.google.com/hosting/settings

--
You received this message because you are subscribed to the Google Groups 
"address-sanitizer" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to