2

Has a write-up ever been released on exactly how SuperSu works? After searching around for a while I found mostly guides on who to use the app, no the implementation details.

I did, however, find this resource that is mostly directed at explaining how to use the root privileges programmatically, but explained things fairly well. The article gives information about SELinux, but not so much how its enforcement is circumvented.

There appears to be a lot of context switching to allow execution of certain events (from the point of view of those using SuperSu) otherwise denied under SELinux, but how did SuperSu get to the point at which it was able to "legally", as far as SELinux is concerned, patch SELpolicies?

It seems that the objective is to force the init process to spawn a new shell that runs the su daemon, but there does not appear to be any patching of the init process, but from the article linked:

On firmwares that use SELinux, su is generally implemented as a proxy to a daemon started from init

and

You might wonder why - if we're already running as the init context, as the root user ..


tl;dr; How does SuperSu execute in the context of the init process?

Given as:

u:r:init:s0          - Highest init context
u:r:init_shell:s0    - Shell started from init
  • AFAIK, SuperSU only manages root permission. Without root access itself, SuperSU is useless (well, since there's no app that can use root access). On its Play Store, I don't see the app provides root access. – Andrew T. Jan 5 '16 at 16:24
  • @AndrewT, SuperSu is the name of the patch to Android that provides root access. The SuperSu APK downloaded from the appstore just manages it from a nice front-end, as you suggest. It, itself, leverages the already-present root accesses to do this, at at least this is how I understand it. – sherrellbc Jan 5 '16 at 16:25
  • So what issue are you trying to solve here? Remember, this site is for end users of Android, not for developers. – Izzy Jan 5 '16 at 16:28
  • @Izzy, if that is the case then I can move the question to another location to be more appropriate. I did not realize the target audience of this forum was exclusively end-users. – sherrellbc Jan 5 '16 at 16:29
  • Well, developers can be end-users as well. But the topics here are focused on the "end-user aspects" :) I don't know where it would fit, so I cannot tell you where to move it to. You can check the /help/on-topic pages of SE sites which sound like, e.g. SO, and ask in the corresponding chat-rooms when unsure. – Izzy Jan 5 '16 at 16:38

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.