Android IOCTL – root permissions and usage

I am dealing with some routing functions in Android applications and need to access IOCTLs. Since applications using IOCTLs need root permission to run, the only way I can call them is to link a separate executable file and call it from Java using runtime. Getruntime(). Exec()

Is there a way to access root from JNI in Android without building a separate executable? Is building an executable the best way to access IOCTL?

resolvent:

A non root process cannot become root (beyond exploitation), so yes, you need a separate process

This is an unchanged inheritance from Linux - the difference is that there is no direct way to start the Android application process as root from the initiator, because it sends an intention to zygote, which closes and privileges - reducing the child processes dedicated to the application process (there may be a circuitous way to manually create an application process, but you must have an application process to execute it, so it will be an auxiliary process by definition. And as a child node of zygote that is not an application, it is inefficient. Zygote does not inherit the shared mapping of the system library, so it must load its own unique copy into memory.)

IOCTL () is just another system call. Only access to this FD (from its device files) requires root. Obviously, this is what you want to use, but others fail. For example, most Android framework IPC are finally implemented with binder IOCTL, which is usually used to control network sockets

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>