Corey
Corey

Reputation: 781

Native Android Permission Enforcement

Okay, so I was looking for something like answered here. The only problem is I've been looking at that zygote fork code but I have no idea what is going on. I'm trying to figure out where exactly permissions are enforced for native method calls in Android. More basically, I want to know how the Linux Kernel is enforcing permissions. Something like enforcePermission() which I've seen in some of the android source code, except I want to know where it is at the kernel level. If someone can point me in some sort of direction or make sense of what that zygote fork code is doing I'd appreciate the hell out of it.

If that doesn't make sense it's probably because I'm an idiot or something.

Thanks!

Upvotes: 1

Views: 1583

Answers (1)

Femi
Femi

Reputation: 64700

What that post says (which is true) is that there is no special enforcePermission()-style call for native code: each permission granted effectively translates into a specific supplementary group id. Individual permissions checks are performed either using the standard Linux permissions/capabilities model, using specific code in IPC routines (so for example when you bind to certain services the services can check the calling processes membership in the appropriate group) or using specific patches the the kernel/libraries (for example network permission is explained here).

Upvotes: 2

Related Questions