Does it work if you add:

prctl(PR_SET_DUMPABLE, 1, 0, 0, 0);

before the call to ptrace(PTRACE_TRACEME)

?


On Wed, Dec 11, 2013 at 9:07 AM, Nick Kralevich <[email protected]> wrote:

>
> What errno are you seeing when ptrace(PTRACE_TRACEME) returns -1?
>
> -- Nick
>
>
> On Wed, Dec 11, 2013 at 7:23 AM, Holger Ihrig <[email protected]>wrote:
>
>> Hi everyone,
>> I hope this is the right ML to ask this question. I am working on an App
>> for Android and I recently got a problem running it on Kitkat.
>> For Android 4.4 it seems that ptrace has been disallowed maybe by SELinux
>> implementation. When calling ptrace(PTRACE_TRACEME, 0, 0, 0) to prevent a
>> debugger from attaching, it returns -1. When I am running this through
>> adb-shell ptrace() it works as expected.
>>  Does anyone know if there has been changes in regards to this? Is there
>> a way to reenable the correct behaviour for ptrace or some other way to
>> disallow attaching ptrace to the application?
>>  Any clarification on this would be highly appreciated.
>> BR
>> Holger
>>
>> --
>> 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/groups/opt_out.
>>
>
>
>
> --
> Nick Kralevich | Android Security | [email protected] | 650.214.4037
>



-- 
Nick Kralevich | Android Security | [email protected] | 650.214.4037

-- 
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/groups/opt_out.

Reply via email to