This article was accepted into the corpus but its outbound wikilinks were never NER-processed — typical at the deepest BFS hop or when the run's entity cap was reached. No expansion funnel to show.
| SELinux (Android) | |
|---|---|
| Name | SELinux (Android) |
| Developer | National Security Agency; Google; Red Hat |
| Released | 2013 |
| Programming language | C (programming language); C++; Java (programming language) |
| Operating system | Android (operating system) |
| Platform | ARM; ARM64; x86; x86-64 |
| License | GPLv2 |
SELinux (Android) SELinux (Android) is the mandatory access control implementation adapted for Android (operating system) to enforce fine-grained confinement of processes, services, and resources. It originated from work by the National Security Agency and was incorporated by Google and collaborators into core Android (operating system) releases to reduce the impact of vulnerabilities in components like Linux kernel, Binder (Android), and system daemons. The design integrates with existing Linux kernel primitives and Android-specific frameworks such as Zygote (software) and the Android Runtime.
SELinux features in Android trace to collaboration between the National Security Agency, Google, and projects such as SELinux Project and Security-Enhanced Linux. Initial upstream work in the Linux kernel community under maintainers like Linus Torvalds and Greg Kroah-Hartman enabled integration. Android adoption accelerated after public incidents involving exploits to components like Stagefright (Android), leading to inclusion in Android 4.3 and tighter defaults by Android 5.0 Lollipop. Partners including Red Hat and device manufacturers such as Samsung Electronics and Motorola contributed policy tooling and testing. Industry events like Black Hat USA and DEF CON showcased attacks and hardened responses, while standards bodies like the Open Handset Alliance influenced platform guidance.
SELinux on Android builds on the Security-Enhanced Linux architecture composed of a kernel-level Linux Security Modules hook set, a policy language, and userland tools such as setenforce and audit2allow. The Android variant integrates with the Linux kernel's LSM hooks and leverages the Android init process, Zygote (software), and service managers. Policy compilation tools like checkpolicy and utilities from Android Open Source Project generate binary policy blobs loaded by the kernel at boot. Interactions with filesystems such as ext4, f2fs, and Android storage stacks are mediated by file context rules and labeling mechanisms derived from the vfs layer.
SELinux supports enforcement and permissive modes handled by userspace utilities such as setenforce and controlled during early boot by init.rc scripts. In permissive mode, violations are logged using the Linux Audit subsystem and components like logd while not blocked; in enforcing mode, policy denials generate AVC messages and system calls are denied. Policies express allow, deny, and transition rules between domains for processes such as mediaserver and system services like surfaceflinger. Tools such as auditctl and ausearch from the Linux Audit ecosystem assist administrators and developers in interpreting AVC denials.
Integration points include init (Android), application sandboxing via the Android Runtime, and package management through Package Manager (Android). SELinux labeling is applied to APK contents managed by Android Package Kit and storage volumes mounted by Vold (daemon). The framework components such as Activity Manager, ContentProvider, and WindowManager operate inside SELinux domains, with permissions from AndroidManifest.xml supplemented by kernel-enforced policy. App processes forked from Zygote (software) inherit domains and are further constrained by Linux kernel UIDs, GIDs, and capabilities defined in the policy.
Common Android policies define domains for system_server, mediaserver, drmserver, and network stacks like netd. Profiles are tailored for OEMs such as Samsung Electronics and vendors using projects like AOSP. Typical rules cover access to device nodes (for example, audio, camera), inter-process communication via Binder (Android), and filesystem paths such as /data and /system. Vendor-specific enhancements integrate HALs like Hardware Abstraction Layer (Android) implementations and services from companies like Qualcomm and Broadcom via extended policy modules. Policy management tooling includes sepolicy-inject and scripts used by vendors and projects like LineageOS.
SELinux enforces confinement at the kernel layer with modest CPU and memory overhead primarily at policy lookup and audit log emission times; benchmarking often references SPEC CPU and mobile workload suites. The security benefits include reduced exploitation surface for high-profile vulnerabilities such as Stagefright (Android) and privilege escalations reported in CVE advisories. Trade-offs include complexity in policy maintenance for OEMs like HTC Corporation and software projects like CyanogenMod, and potential application compatibility issues that require policy adjustments or permissive workarounds during development cycles.
Deployment entails compiling policies with tools like checkpolicy, provisioning file contexts, and embedding the binary policy in the boot image loaded by the Linux kernel. Configuration often uses files in initramfs and init scripts under Android Open Source Project's init, and properties set via getprop/setprop for debug toggles. Developers use adb and utilities such as logcat and audit2allow to iterate policy changes. OEMs include SELinux policy modules among device-specific firmware files; community projects automate packaging via build systems like Soong and Make (software).
Vulnerabilities arise from policy misconfigurations, overly permissive domains, and bugs in LSM hooks or kernel components. Mitigations include rigorous policy review, use of least privilege principles, continuous integration testing with fuzzers such as AFL (fuzzer) and sanitizers from LLVM/GCC, and rapid patching coordinated through programs like Android Security Bulletin and vendor security programs from Google Play Protect. Incident response leverages tools and events documented by CERT Coordination Center and community disclosures at conferences like Black Hat USA.
Category:Android (operating system) Category:Linux security modules