Skip to content

Commit b34774e

Browse files
committed
refpolicy-targeted: Added sepolicy for adb service
- Labeled adb binary - Moved adb shell from initrc_t to unconfined_t - meta-selinux does not provide adb domain added policy in meta-oe instead of refpolicy: SELinuxProject/refpolicy#1085 Upstream-Status: Inappropriate [meta-oe Specific] Signed-off-by: Gargi Misra <gmisra@qti.qualcomm.com>
1 parent 0bc67b6 commit b34774e

2 files changed

Lines changed: 81 additions & 0 deletions

File tree

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
From c110d893be565ade574ee2933c6e89197f833006 Mon Sep 17 00:00:00 2001
2+
From: Gargi Misra <gmisra@qti.qualcomm.com>
3+
Date: Thu, 5 Mar 2026 12:39:42 +0530
4+
Subject: [PATCH] refpolicy-targeted: Added sepolicy for adb service
5+
6+
- Labeled adb binary
7+
- Moved adb shell from initrc_t to unconfined_t
8+
9+
Upstream-Status: Inappropriate [meta-oe Specific]
10+
11+
Signed-off-by: Gargi Misra <gmisra@qti.qualcomm.com>
12+
---
13+
policy/modules/services/adbd.fc | 5 +++++
14+
policy/modules/services/adbd.if | 5 +++++
15+
policy/modules/services/adbd.te | 25 +++++++++++++++++++++++++
16+
3 files changed, 35 insertions(+)
17+
create mode 100644 policy/modules/services/adbd.fc
18+
create mode 100644 policy/modules/services/adbd.if
19+
create mode 100644 policy/modules/services/adbd.te
20+
21+
diff --git a/policy/modules/services/adbd.fc b/policy/modules/services/adbd.fc
22+
new file mode 100644
23+
index 000000000..6f5bb9269
24+
--- /dev/null
25+
+++ b/policy/modules/services/adbd.fc
26+
@@ -0,0 +1,5 @@
27+
+/usr/bin/adbd -- gen_context(system_u:object_r:adbd_exec_t,s0)
28+
+
29+
+
30+
+
31+
+
32+
diff --git a/policy/modules/services/adbd.if b/policy/modules/services/adbd.if
33+
new file mode 100644
34+
index 000000000..612fc0106
35+
--- /dev/null
36+
+++ b/policy/modules/services/adbd.if
37+
@@ -0,0 +1,5 @@
38+
+## <summary>adb service.</summary>
39+
+
40+
+
41+
+
42+
+
43+
diff --git a/policy/modules/services/adbd.te b/policy/modules/services/adbd.te
44+
new file mode 100644
45+
index 000000000..f7e8ac7d0
46+
--- /dev/null
47+
+++ b/policy/modules/services/adbd.te
48+
@@ -0,0 +1,25 @@
49+
+policy_module(adbd)
50+
+
51+
+########################################
52+
+#
53+
+# Declarations
54+
+#
55+
+
56+
+type adbd_t;
57+
+type adbd_exec_t;
58+
+
59+
+init_daemon_domain(adbd_t, adbd_exec_t)
60+
+
61+
+# Move adb from system_r:initrc_t to unconfined_r:unconfined_t
62+
+unconfined_shell_domtrans(adbd_t)
63+
+
64+
+# Minimal Rules Required for adbd service
65+
+allow adbd_t self:capability sys_resource;
66+
+
67+
+dev_rw_usbfs(adbd_t)
68+
+files_read_etc_files(adbd_t)
69+
+term_use_ptmx(adbd_t)
70+
+term_use_generic_ptys(adbd_t)
71+
+
72+
+
73+
+
74+
--
75+
2.43.0
76+
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
FILESEXTRAPATHS:append := "${THISDIR}/${PN}:"
2+
3+
SRC_URI:append = " \
4+
file://0001-Added-sepolicy-for-adb-service.patch \
5+
"

0 commit comments

Comments
 (0)