Received: from mx0b-0031df01.pphosted.com (mx0b-0031df01.pphosted.com [205.220.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 1587B286D70 for ; Fri, 23 Jan 2026 05:57:45 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=205.220.180.131 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769147870; cv=none; b=fRlQGf5nUvwCp+D+Ybr1y2lY1Go0QCubz2oZ1emNVvRzBI9wqnNi6DxqHOjj5qxfZ0udp884GkTQHHIxVaCQNfTivr8waGIJD168ngsl2+wGvrHpjxlg55LaplBn9yYtjf5fEbpu0lZS7pP5mDCh51ovMwVMVyTiFacXQy1u//0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769147870; c=relaxed/simple; bh=2g2JeDdW4th3oJM6ZH8xp0E0wi4dajG0Pe18ZXxukKU=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=nxg3wCIWmShML3+j1cMYt9tPXuHK6bnLC29var4YaNau5jRCd1pvzo2SzOsEqPCPB030LQlmOKiHjCxHcz58qeJ5cSVFRnxVafWza+8tUTH0MQP8wCJJQrpuRZqFAum/q/XXSZSRi/oo4WwrCuGo12WByQQC8m9MIGnqFiOQpsg= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com; spf=pass smtp.mailfrom=oss.qualcomm.com; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b=lA6Ksyji; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b=XHv0f+5u; arc=none smtp.client-ip=205.220.180.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b="lA6Ksyji"; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b="XHv0f+5u" Received: from pps.filterd (m0279871.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 60N566NV3656269 for ; Fri, 23 Jan 2026 05:57:42 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h= cc:content-transfer-encoding:date:from:in-reply-to:message-id :mime-version:references:subject:to; s=qcppdkim1; bh=nM+vaiWEugB HvGMPCp1uR6xXd8pIrIV11CAH4Gywc2Q=; b=lA6KsyjiG/c+mSS50/tbOlypn50 VmYRi2BaBhN7b3S/7/KpMZ+DL67HQ0BWJhh3LsXo27FZbG83oovQsiWyQ027Zt4a eaV1Oy6LumB3QPO8FdY17y5xWWf/f6Fp1lqoxY3hPAcrpjfjpmrc6V0IhUCfocaJ tsYr5o1gIvj9s3h3xBspOy9Qz+n7xSVRZN5BEeOmjy+oJTjr7TPeV6hgNdgm4Wd7 QsdY/BwdNJ8zqNCuLe3fBPrCcMLqnE7VDaIwReg0GaeN1PtS1zOINVKXj59ANnXu 5NGtrQhPOz3jqUnQVVfWpWRlyWkwDNu+/fQQaL4DIrtRGtyBlQEyVmESLpw== Received: from mail-dl1-f71.google.com (mail-dl1-f71.google.com [74.125.82.71]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4bv2hw85uk-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Fri, 23 Jan 2026 05:57:41 +0000 (GMT) Received: by mail-dl1-f71.google.com with SMTP id a92af1059eb24-12334619b7dso139712c88.3 for ; Thu, 22 Jan 2026 21:57:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1769147861; x=1769752661; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=nM+vaiWEugBHvGMPCp1uR6xXd8pIrIV11CAH4Gywc2Q=; b=XHv0f+5u5UFOxxHDAe9gnZLetA25XLHG2n8tWKBsAE5tJZoYA/vb00fbKZmxWKxQkI ++yJqkEjLrpJOvQWX+l9icENOTxqWf9R5fOoJwDw1ISthzCjT0AvKgM6nRs5VllGC755 ZTp9eV4JloGtKuei7o6T0DLwrj/nNtEEv+ys25yTeAVXR2GyerKqsTWIo6FTb1OO8i6T za7I1mapSdSjBQjJ+A8PRV1hAISLJnYH7oZE6t1A+30/kh1bCFFTdAW04nIAFJn3YjJb uJB3xo3Z4jUqyzn9EUTAH6XLjaCpI+T+409gLorI+YjhIaqKZM7zupDKkAxB/upLPYxT Jmpw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1769147861; x=1769752661; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=nM+vaiWEugBHvGMPCp1uR6xXd8pIrIV11CAH4Gywc2Q=; b=jxTQUFvtuAzPaLMMmGRrzP93qxW5Fk54WDb/PuMPDck1t5ALAQoF6bqfRXDYiTeR2h HOVEONa0Wf6agJ06amdUMBdf04NJ1l8UH/L5eSH40Bn1mSx7ylgGeeJ/7NZ6eTbatF9m wXu0w7uH/Z1x+3L5lhIXl5CJy+J7vqz+xTnLf2Kk5AixCLWKMjs8k9w8fm4D6JU9IzgR ob4oKzOHz7DudJreikkotGL/H4fWZMOmOgoIz54titaBSpjBn+h3N3U8sn/mmKyrsB8h wveEA209zZjjVpw2VszZfLJARvlaafBsu8vrCrbZpxE4yEl3SRijP2yGHieW7fc+S8/q 7SPQ== X-Gm-Message-State: AOJu0Yw4O2eAfGKLVf496eFGtJDZ5qasouijsGdtkLmDCEB7kxv2Kkxw gnCBRQhGJZlFRuk5t1iIRF/wRBvEaB2NQwb+t1C6UQ16F/tNM8HK1s+0Hyq7Tk+ByBlYSLkvW3i zw4TH3sNNzexpc4q+QkFRngoxbMGyjSftWY/+0k2yNQgYuGXXAEZaaLbqXtZkcGJYbuVCgyoCD6 JukTCbtg== X-Gm-Gg: AZuq6aKu5tJKpHNsc8hOsP5w1gGV+GdY6bvLaaser86YLH+LRWfpfsNvyHVtavTJ+Re 3pODupoq3ujAGeTZs66KxVT1oTcdZpakJobe4klCcn/i9eFQP56IJAuGYXzfvPQNPp+uRIBPBCg sWDja6ZtLpnsYw2KtYIMeH5mWXagGEi6G7rOhVrnHtNZhnvgsBMUKRDekXZaz43k2zy8l/uExIX j45MESDN5Zk47e23DJi/H1Z5XGts6kYay3IGaWVUupr+x21tp0OxJdEOxe76wnYq8natZwiZy8F rMzcuUtKhPXFL5sCvvOUESGFwJ+4kqebzPliH6UOW8aQj8z8+vDravxujxtQI083afbKt1qRK9c ac4H15kACTTTSH4y7DrpGFUcpBXhFoQZ+ X-Received: by 2002:a05:7300:572c:b0:2ae:5b8c:324a with SMTP id 5a478bee46e88-2b739bce440mr470394eec.4.1769147860550; Thu, 22 Jan 2026 21:57:40 -0800 (PST) X-Received: by 2002:a05:7300:572c:b0:2ae:5b8c:324a with SMTP id 5a478bee46e88-2b739bce440mr470389eec.4.1769147859868; Thu, 22 Jan 2026 21:57:39 -0800 (PST) Received: from hu-weiden-sha.qualcomm.com ([114.94.8.21]) by smtp.gmail.com with ESMTPSA id 5a478bee46e88-2b73a691d95sm1885987eec.2.2026.01.22.21.57.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 22 Jan 2026 21:57:39 -0800 (PST) From: Wei Deng To: selinux-refpolicy@vger.kernel.org Cc: cheng.jiang@oss.qualcomm.com, shuai.zhang@oss.qualcomm.com, quic_mohamull@quicinc.com Subject: [PATCH v2 1/1] ofono: introduce dedicated SELinux domain ofono_t Date: Fri, 23 Jan 2026 11:27:32 +0530 Message-Id: <20260123055732.3598224-2-wei.deng@oss.qualcomm.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20260123055732.3598224-1-wei.deng@oss.qualcomm.com> References: <20260123055732.3598224-1-wei.deng@oss.qualcomm.com> Precedence: bulk X-Mailing-List: selinux-refpolicy@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Proofpoint-GUID: i8lX381pbHua_T-4_fU-WWXOQMggQs67 X-Proofpoint-ORIG-GUID: i8lX381pbHua_T-4_fU-WWXOQMggQs67 X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwMTIzMDA0MiBTYWx0ZWRfX3JdbyZNQbmou NBXGClHnFDciROSD/ubhBT0ptw6S2kIsHiB6PTRaLJtII4CRZUWUea3jybKuPsm9/9Hae/cXjiM X/wwT92P0mfZ4mGfqGSV7n3FQPkJW6lL6y2x+5smP8fLg2gWedki1ziL/+6l6ps7zFKiWwmPVWK rsQAWow2qY8LJY+4UfKNY4orApOzQkzOnAGllxMizuPWST/EYzlyxRPleHsEbmYxzU/Z8OsjHrj ysjjuJEitJOo2mwYp1mZJEnBuydaEqE3AAn9NSylVONtfnkmacmVF5QmD6RJZDHTLxkhwh/tSFg teee4JaZ71Hl6KLJkltjrll4xRts5x+FQ8ialuJfBZ9iR5VuYpfDdswWQvWV0c2ZLRmAMg8UqFp KM6wIcQ5AqjrXOUmpyEOsoxhpO8vrNys5VAoJYAtkx+xb8K16mWARUTEume12rztrvurY/HvEAO wGLE63JWZlV7zOPHETw== X-Authority-Analysis: v=2.4 cv=A4Rh/qWG c=1 sm=1 tr=0 ts=69730dd5 cx=c_pps a=JYo30EpNSr/tUYqK9jHPoA==:117 a=Uz3yg00KUFJ2y2WijEJ4bw==:17 a=vUbySO9Y5rIA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=VwQbUJbxAAAA:8 a=EUspDBNiAAAA:8 a=8T_gOxTpvBEIBUQ6rCkA:9 a=Fk4IpSoW4aLDllm1B1p-:22 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1121,Hydra:6.1.20,FMLib:17.12.100.49 definitions=2026-01-22_06,2026-01-22_02,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 adultscore=0 clxscore=1015 lowpriorityscore=0 malwarescore=0 phishscore=0 priorityscore=1501 spamscore=0 suspectscore=0 bulkscore=0 impostorscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2601150000 definitions=main-2601230042 Currently, the ofono daemon runs in the generic `initrc_t` domain. While functional, this configuration lacks proper process isolation and violates the principle of least privilege. Define a dedicated domain (`ofono_t`) to confine the service, ensuring it operates in a restricted environment isolated from other init processes. Grant the necessary permissions to resolve AVC denials observed during the transition to enforcing mode: * DBus: Allow service registration on the system bus and communication with `org.bluez`. * Network: Allow `net_admin` capability and netlink socket creation (route and kobject_uevent) for rmnet and udev handling. * Filesystem: Authorize read access to configuration files in `/etc` and `/usr`, and traversal of `/sys` and `/run/udev`. * Logging: Allow write access to `/dev/log` for syslog integration. Signed-off-by: Wei Deng --- policy/modules/services/ofono.fc | 1 + policy/modules/services/ofono.if | 9 +++++++ policy/modules/services/ofono.te | 43 ++++++++++++++++++++++++++++++++ 3 files changed, 53 insertions(+) create mode 100644 policy/modules/services/ofono.fc create mode 100644 policy/modules/services/ofono.if create mode 100644 policy/modules/services/ofono.te diff --git a/policy/modules/services/ofono.fc b/policy/modules/services/ofono.fc new file mode 100644 index 000000000..7b62f91a0 --- /dev/null +++ b/policy/modules/services/ofono.fc @@ -0,0 +1 @@ +/usr/sbin/ofonod -- gen_context(system_u:object_r:ofono_exec_t,s0) diff --git a/policy/modules/services/ofono.if b/policy/modules/services/ofono.if new file mode 100644 index 000000000..51c9d4e19 --- /dev/null +++ b/policy/modules/services/ofono.if @@ -0,0 +1,9 @@ +## ofono +# +## +## oFono is a stack for mobile telephony devices on Linux. +## oFono supports speaking to telephony devices through specific drivers, +## or with generic AT commands. +## +## https://git.kernel.org/pub/scm/network/ofono/ofono.git +## diff --git a/policy/modules/services/ofono.te b/policy/modules/services/ofono.te new file mode 100644 index 000000000..4fdb798c0 --- /dev/null +++ b/policy/modules/services/ofono.te @@ -0,0 +1,43 @@ +policy_module(ofono, 1.0) + +######################################## +# +# Declarations +# + +type ofono_t; +type ofono_exec_t; + +init_daemon_domain(ofono_t, ofono_exec_t) + +######################################## +# +# Local Policy +# + +allow ofono_t self:capability net_admin; +allow ofono_t self:bluetooth_socket create_stream_socket_perms; +allow ofono_t self:netlink_kobject_uevent_socket create_socket_perms; +allow ofono_t self:netlink_route_socket create_netlink_socket_perms; +allow ofono_t self:unix_dgram_socket { connect create write }; + +# Read generic sysfs entries for device enumeration (bus traversal, PCI devices) +# and reading 'uevent' files for hardware capabilities. +dev_read_sysfs(ofono_t) + +files_map_usr_files(ofono_t) +files_read_etc_files(ofono_t) +files_read_usr_files(ofono_t) + +logging_send_syslog_msg(ofono_t) + +init_dbus_chat(ofono_t) + +udev_search_runtime(ofono_t) +udev_read_runtime_files(ofono_t) + +bluetooth_dbus_chat(ofono_t) + +dbus_system_bus_client(ofono_t) +dbus_connect_system_bus(ofono_t) +dbus_send_system_bus(ofono_t) -- 2.25.1