How does Android enforce permissions?

后端 未结 1 1509
太阳男子
太阳男子 2021-01-06 06:13

I have read several articles about the \"Android Security Model\" (1, 2, 3 and more). I understand the theoretical MAC model of permissions, and most of what is relevant for

相关标签:
1条回答
  • 2021-01-06 06:52

    In the end, it's the processor itself that allows the OS to set kernel/privileged/supervisor mode vs. user/unprivileged modes of execution. Without escalating to a privileged mode, you can't enable/disable/configure interrupts, access certain peripherals, and/or violate memory boundaries (depending on the architecture). See, for example, this documentation for the ARM A8 processors.

    If you want higher privileges, the only thing you can do is trigger a system call interrupt with the SWI instruction, passing the system call handler a number to inform it of what you want to do. It's up to that handler to decide whether you can or cannot access the hardware directly.

    This is what stops you from directly accessing the GPS in the end. I can't help you with the software side of things.

    0 讨论(0)
提交回复
热议问题