Android CTS Test Fail Item Revision summary (IV)

Source: Internet
Author: User

Tests on the Android5.1

1, android.security.cts.selinuxdomaintest# Testinitdomain fail

The printed log

This is the typical L version of the SELinux Test problem.
Android.security.cts.SELinuxDomainTest has 1 fail,
--Testinitdomain
junit.framework.AssertionFailedError:Expected 1 process in SELinux domain "U:R:INIT:S0" Found "[PID:" 1 "proctitle:"/ini T "label:" U:r:init:s0 "vsize:1327104, pid:" 298 "Proctitle:"/system/bin/immvibed "Label:" U:r:init:s0 "vsize:1765376]" Expected:<1> but was:<2> at Junit.framework.Assert.fail (assert.java:50)

The key reason is that Google emphasizes that the SELinux Context of the system's critical processes must be unique, and that system-critical processes include Init, vold, Surfaceflinger, netd, ServiceManager, Drmserver, and so on. When multiple process is found using these critical domain, SELinux Test fail.

For this reason, a system-critical process starts a long-running process, and domain switching is required. Otherwise, you will not be able to pass Google CTS test.

A typical scenario is to start a service with init without a domain switch to the service. For example, the problem of your company SUNTROLD_32 this service did not go to domain switching, and failed to pass the test.

Here is a simple demo.
Scenario: Define an init-initiated service, Demo_service, and the corresponding execution file is/system/bin/demo.
(1). Create a demo.te in the/device/mediatke/common/sepolicy directory, and then in/device/mediatke/common/boardconfig.mk board_sepolicy_ New Demo.te in UNION macro
(2). Define the demo type, init start service type conversion, Demo.te
Type demo, domain;
Type demo_exec, Exec_type, File_type;
Init_daemon_domain (Demo)
(3). Binding execution File File_context type
/system/bin/demo U:object_r:demo_exec:s0
(4). Define additional permissions in Demo.te according to the files and devices that the demo needs to access.

A typical scenario is to start a service with init without a domain switch to the service. For example, in this problem immvibed the service does not have domain switchover, so it cannot pass the test. Just follow the demo to modify it.

Android CTS Test Fail Item Revision summary (IV)

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.