Android Security Mechanism Analysis

Source: Internet
Author: User

The Android system is developed based on the Linux kernel. Therefore, the Android system not only retains and inherits the security mechanism of the Linux operating system, in addition, its system architecture has unique security features at all levels [2]. 1. Linux kernel-layer security mechanism the Android Linux kernel includes a mandatory access control mechanism and an autonomous access control mechanism. The forced access control mechanism is implemented by the Linux security module. For some reason, Google did not compile LSM into the Android kernel. The autonomous access control mechanism is usually implemented by File Access Control. The permission control of the Linux file system is implemented by user, group, other and read (r), write (w), and execute (x). In this way, each file has three basic permission sets, which allow, restrict, and deny access by users, user groups, and other users. Generally, only users whose uid is "system" or "root" have the permission to access the Android system file, and applications can only access the corresponding file by applying for the Android permission, therefore, Android uses the autonomous access control mechanism of kernel-layer Linux and the Dalvik Virtual Machine in runtime to implement the "sandbox" mechanism of Android. 2. the Android "sandbox" mechanism is essentially designed to isolate different applications and processes, that is, by default, the application does not have the permission to access system resources or other application resources. Each APP and system process is assigned a unique and fixed User Id, which corresponds to the uid of the kernel-layer process. Each APP runs in its own Dalvik Virtual Machine and has its own address space and resources. Processes running on the Dalvik virtual machine must exist based on the kernel-layer Linux process. Therefore, Android uses the Dalvik Virtual Machine and Linux File Access control to implement the sandbox mechanism, if any application wants to access system resources or other application resources, it must declare permissions or share uid in its own manifest [23] file. 3. android permission check mechanism Android is a "permission separation" system. Any application is using Android restricted resources (Network, phone, SMS, Bluetooth, Address Book, SdCard, etc) before that, you must submit an application to the Android system in the form of an XML file. The application can use the corresponding resources only after the Android system approves the application, permissions are mapped to Java APIs. When an Android application has the corresponding permissions, it can call the API to complete the corresponding functions. An API call can be divided into three steps [3]: first, the application will call the API in the public library after obtaining the corresponding permissions. Second, A public API calls an API called the API proxy (RPC stub). Third, RPCstub passes the request to the system service in the form of IPC binding, and the system service process completes the specific functions, permission check occurs precisely in system services and system processes. Permission check includes not only static checks during installation, but also dynamic checks during APP running. Dynamic Check means that the system service or system component called by the APP during operation must undergo authorization check. Dynamic check does not occur in the APP itself, but in the process of system services or system components. Before Android, the permission check mechanism of Android can be bypassed because of a vulnerability in the permission check mechanism, that is, the caller does not need to have the relevant permissions of the caller, in Android4.0, the function "checkUidPermission" is used not only to determine whether the permission should be granted to the corresponding process, but also the function "checkCallingPermission" is used to check whether the caller has the corresponding permission. Therefore, the Android permission mechanism cannot be bypassed. However, the Android permission mechanism has some drawbacks that cannot be ignored, which are manifested in the following aspects: First, once the permission is granted to the application, this permission will be valid during the life of the application, and the user cannot be deprived of the permission. Second, the permission mechanism lacks flexibility, or all permissions required by the application are granted, third, the permission mechanism is not secure enough to prevent malicious software from directly calling the C library through JNI technology to obtain system services. 4. all Android applications installed in the Android system must have a digital certificate [4], which identifies the trust relationship between the application author and the application. Android does not install an application without a digital certificate. If the protection level of a permission is signature, the Android system will authorize the application only when the digital signature used by the application is the same as the digital signature used by the application that declares the permission. If the protection level of a permission is signatureOrSystem, the Android system grants the permission to applications with the same digital signature or Android package class.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.