Sample Header Ad - 728x90

How does SuperSu provide root privilege?

9 votes
1 answer
4831 views
Has a write-up ever been released on exactly how SuperSu works? After searching around for a while I found mostly guides on how to use the app, not the implementation details. I did, however, find [this](https://su.chainfire.eu/#introduction) 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
Asked by sherrellbc (235 rep)
Jan 5, 2016, 04:15 PM
Last activity: Oct 13, 2019, 01:40 PM