Received: from mx0a-0031df01.pphosted.com (mx0a-0031df01.pphosted.com [205.220.168.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 6B038361675 for ; Fri, 22 May 2026 07:19:53 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=205.220.168.131 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779434394; cv=none; b=Lc9gfcXQpJQIj6538+dTxXMD/s2Xy5oxDlOW+14oiM70PSIksOzw9UYJbYQyhnFn8+Y/Z5gBS65rnsMDrOgiwH0c9yjPvw3uHoB1ibI99XUbUTJw11t/ve6F/7/TKgNxPXL0W4oel1N+pIVHYozz+n2LGGJlT5YJDcYZ1W4mOVA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779434394; c=relaxed/simple; bh=x10fjcB9sxmFeKOUDTqepU/kKBbvRWFMHOmIostDt+I=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version:Content-Type; b=Z1Z2sJFmL32B9RxHAYxzCHkvSTciEJODDTdPuOORqZhinaxQIBh3xpy1EzyzaPRoxuqOCFrID1Tuwm3BtK/afvTj9GgKq1idPqpR3xvodaY+bfAG4aFykgx+0ScTedhRnO/yZlqAEUFfoJTc2oa4/kPHLZTOWlt08Vv4hd9zAg0= 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=ffTG6ukl; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b=NRAUXk4M; arc=none smtp.client-ip=205.220.168.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="ffTG6ukl"; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b="NRAUXk4M" Received: from pps.filterd (m0279866.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 64M37mv73532657 for ; Fri, 22 May 2026 07:19:52 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=qcppdkim1; bh= 0q6hICotFd3gT4q/KL4aUWEZ0EZvXD7M9drKXsGZxDk=; b=ffTG6ukliZE/8Ix9 qv83dCd79ZN6SCfTnYgdQ1MZGaMNloKUZ/SDlNsA7u0zdf3uIzDEX3sBX5ZcnI6W KVxV1nRRy5oxck6gbf1S/z7OEel6NVJ+HU+xKR2+FSlmLUUeC8y7uDcfdRLFuZnG CBMTjo1pEx966Y8knGyezLwVFz+UcOu0k2YrUzbsFlt6vCquACeSxj6yJ8Qw9iFU jspJ9/FO2LKtqkuf1xF7fB42God3gIKzaPE5Bhqnnd5BwIUq9Q6bIoP//Lltq5Yg 4XCQbfzhjs+83M+dxNqwax4sa2//C5r69rUrUczKoKX7aKkny511qkAALdZRCjnk msQguA== Received: from mail-dy1-f197.google.com (mail-dy1-f197.google.com [74.125.82.197]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4ea39guq6s-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Fri, 22 May 2026 07:19:52 +0000 (GMT) Received: by mail-dy1-f197.google.com with SMTP id 5a478bee46e88-2f21cb36bbbso503741eec.3 for ; Fri, 22 May 2026 00:19:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1779434392; x=1780039192; 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=0q6hICotFd3gT4q/KL4aUWEZ0EZvXD7M9drKXsGZxDk=; b=NRAUXk4M2I6BlVxHPXo9voYsm+w4buBqc9PsKX5/pqLG8UYKuiZlaf0+IOCxmyQnyQ C/LamummlxwjVW+/ejQE2rVNu1IcPZKKW0tafBaW9H/ctn0IczQE9SGnG9CvhR7lJzfR 5V/wLoHaa/DGG2QC99yimeJrE87y2ZpdXXITBimaQKH5CG7maKcZ/0veUC35HVynQE/H D+tUSXl2qIxusBZo6t+Ugb+/K3V2h2GANVzy8aQx2eMz5/6PvOJnfGv+J7+PdnzRsM/1 UiuOGhuXNapwirwCk2e6ajC0J5l4uMxgdWpU3EbDA0FAfOrbiZ+V2RswTGdmIQGHUIX6 +I8Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1779434392; x=1780039192; 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=0q6hICotFd3gT4q/KL4aUWEZ0EZvXD7M9drKXsGZxDk=; b=jkFs1th+VIg6JVPhfxtcd007D/tjrzimeLn+xz2EZiWIYrEEiSBvcviSZjcBOqjnHg p0BygRDUEBB0gm6yxXxKI3npuNAnDhfaf0FOYIRmU9JoH28gHDPBrO4Xo1TGHDRGgbed /ALnHl+PbiGi9FpArj8QmiyNfmDZau6g/sPy/CAIUL1bzsqahWKAOGfUTZyAeunIQSQ+ IFc30XUzdehotBihUrDw5rXJorDTMjtsip6+BA3KV2ecHS7NMVStk9K0OTxEqpC8ODkE BLcp2xSfsai/cBZfB4ayDbeIU/Do6evD0vE1iZCq5smvMsq7OyOCe+wa7Aw0l76XqgRB rS5w== X-Gm-Message-State: AOJu0YzA9Ax+lE/YJJWbH6R/5oWcx3AWrEWmvwZPK40GUXG0wp3p4OWY c7doLdlDpgD9+MqxLPrFADsA7gi2d9dwu5FrL7mkM0du6QGal8IOaC6wibPeLT3MIS785aJtIg0 egEyZUKgOeTZiDupevHgiBusOLHxopCz1vKk44qMW/QviuC/LBubF2AjpMroLQNBo9pkNz+xyFV lCO90GMw== X-Gm-Gg: Acq92OGXx7HEUpDUAh1eiRBJ0EB/3QlYqI5jLhZyN+5qCesPd/oLkIRHLpzMkdIutrO AfjAQ1rGB0w9aJaqx8grLlPk3sEoZNTcomX8JFU5Gnix3XOhzjagpDrKu/U1sO6Wgy7/OBejXhv 8BGToV+hETS/zy1dFKrAZq2GNQ5TdvPLWOmNwBDOiU6xTzRnKHR9NkGdR0BbAGkFsOmm7QVYu6Y pfzvhaQihLUdeVCUNC2AO3Gv87/2v8rYeVKFAMyQDBKVgL+wbS0/+CaleB+SrnF4jFlq7K/AN61 Q0qi/Ppt2T09VYhD3vHOQe/1ORZNO0OIt53owvyYvRfBiSUHhML3tjVJ34EKrhVh0IXfl44w6fE kQ7FSq2dYk0jIlAIXOb3zelsAtnxRJYMZewniGzw6BHq0UZqOL9n4v4pcMjpLNEceNvQFhx6d X-Received: by 2002:a05:7300:3255:b0:2e6:b55a:76ca with SMTP id 5a478bee46e88-30448d4e2fbmr599016eec.0.1779434391682; Fri, 22 May 2026 00:19:51 -0700 (PDT) X-Received: by 2002:a05:7300:3255:b0:2e6:b55a:76ca with SMTP id 5a478bee46e88-30448d4e2fbmr599010eec.0.1779434391109; Fri, 22 May 2026 00:19:51 -0700 (PDT) Received: from hu-weiden-sha.qualcomm.com (i-global052.qualcomm.com. [199.106.103.52]) by smtp.gmail.com with ESMTPSA id 5a478bee46e88-30452259de0sm374323eec.22.2026.05.22.00.19.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 22 May 2026 00:19:50 -0700 (PDT) From: Wei Deng To: pebenito@ieee.org Cc: selinux-refpolicy@vger.kernel.org, cheng.jiang@oss.qualcomm.com, shuai.zhang@oss.qualcomm.com, quic_mohamull@quicinc.com Subject: Re: [PATCH v2] obex: transfer obexd to obex_t Date: Fri, 22 May 2026 12:49:47 +0530 Message-Id: <20260522071947.527720-1-wei.deng@oss.qualcomm.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: References: <20260403063120.2752877-1-wei.deng@oss.qualcomm.com> <20260429134143.1217836-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-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Authority-Analysis: v=2.4 cv=Yr8/gYYX c=1 sm=1 tr=0 ts=6a100398 cx=c_pps a=Uww141gWH0fZj/3QKPojxA==:117 a=b9+bayejhc3NMeqCNyeLQQ==:17 a=IkcTkHD0fZMA:10 a=NGcC8JguVDcA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=YMgV9FUhrdKAYTUUvYB2:22 a=EUspDBNiAAAA:8 a=Qm_AfrKYHwDVYhjdBzAA:9 a=3ZKOabzyN94A:10 a=QEXdDO2ut3YA:10 a=PxkB5W3o20Ba91AHUih5:22 X-Proofpoint-ORIG-GUID: iEMM8965dUjHpDdRjwZozSdi8XQ9IkLb X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwNTIyMDA3MSBTYWx0ZWRfX3x7Ma9Hbfe5k It74SdcVybWzwUHVsCK9T5VcbtFp5q0Pc0JKXsEDvsZMYXCBRDKRYEGgkIIqdmn87YZjzXDN9GK OLW1A9xPQkvBPrSJh5fG9kCUYyk2bKoKMA0Xegmvbe9grGsvPuvTgfjgh9CwW4f7IWSm7WETcve gFR5mhka1+PKEK81YeBKJJQpRvh0UnP9EecdA6vasYJsNI3ngF1E79+DF84ARzDgtN5Ft3lgCxm D/mcfxWRRNyBWtBXwXiLTjPlubG2VHcKKUqBfuSC38GYHTQKqjOP+ghA5RjZc/z0f2S+6bB5dLM jNTL9Jd190Sdhm7kUBeCnvBgeuunYoTax9Fcwt4iQFCu09BMaqphtpZl2EzQXlwjKnY5JJSEJmw GK2e/+0YWMG0B+tBe8dWEi/HGQ96iKd1HuBjVxyNTvUtlR5DE++iBOXMk65wLSC9Mi3eT7uOS+b XbwFys+zZlfme1uEUqg== X-Proofpoint-GUID: iEMM8965dUjHpDdRjwZozSdi8XQ9IkLb X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1143,Hydra:6.1.51,FMLib:17.12.100.49 definitions=2026-05-22_01,2026-05-18_01,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 adultscore=0 priorityscore=1501 lowpriorityscore=0 clxscore=1015 suspectscore=0 bulkscore=0 impostorscore=0 phishscore=0 spamscore=0 malwarescore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2605130000 definitions=main-2605220071 Hi Chris, On Tue, 12 May 2026 08:36:52 -0400, Christopher J. PeBenito wrote: > On 4/29/26 9:41 AM, Wei Deng wrote: > > obexd was running under init_t instead of obex_t because obex.te > > only declared userdom_user_application_domain(), which does not > > set up a domain transition from init_t. Add init_daemon_domain() > > so that obexd exec'd by init/systemd correctly transitions to obex_t. > > > > Also add the permissions observed to be required when obexd runs > > as obex_t: read sysfs nodes (dev_read_sysfs), register on the > > D-Bus system bus (dbus_connect_system_bus), and get attributes > > of bluetooth var-lib directories via the new > > bluetooth_getattr_var_lib_dirs() interface. > > > > Fixes: > > avc: denied { read } for pid=1751 comm="obexd" name="enabled" dev="sysfs" ino=21530 scontext=system_u:system_r:obex_t:s0 tcontext=system_u:object_r:sysfs_t:s0 tclass=file permissive=0 > > > > avc: denied { acquire_svc } for service=org.bluez.obex spid=1755 scontext=system_u:system_r:obex_t:s0 tcontext=system_u:system_r:system_dbusd_t:s0 tclass=dbus permissive=0 exe="/usr/bin/dbus-daemon" sauid=998 hostname=? addr=? terminal=? > > > > avc: denied { getattr } for pid=1826 comm="obexd" path="/var/lib/bluetooth" dev="sda2" ino=1038914 scontext=system_u:system_r:obex_t:s0 tcontext=system_u:object_r:bluetooth_var_lib_t:s0 tclass=dir permissive=0 > > > > Signed-off-by: Wei Deng > > --- > > Changes in v2: > > - Complete rework: investigation showed the AVC denial was not > > bluetooth_t -> init_t (systemd), but bluetooth_t -> init_t (obexd > > running in the wrong domain because obex.te lacked a domain > > transition from init_t). The v1 fix of adding init_dbus_chat() to > > bluetooth.te was therefore incorrect. > > - Fix the root cause by adding init_daemon_domain() to obex.te so > > obexd correctly transitions to obex_t when started by init/systemd. > > - Add permissions needed by obexd once it runs as obex_t: dev_read_sysfs, > > dbus_connect_system_bus, and bluetooth_getattr_var_lib_dirs (new > > interface in bluetooth.if). > > > > policy/modules/services/bluetooth.if | 19 +++++++++++++++++++ > > policy/modules/services/obex.te | 5 +++++ > > 2 files changed, 24 insertions(+) > > > > diff --git a/policy/modules/services/bluetooth.if b/policy/modules/services/bluetooth.if > > index d0e581426..f8226969f 100644 > > --- a/policy/modules/services/bluetooth.if > > +++ b/policy/modules/services/bluetooth.if > > @@ -255,6 +255,25 @@ interface(`bluetooth_admin',` > > admin_pattern($1, bluetooth_runtime_t) > > ') > > > > +######################################## > > +## > > +## Get the attributes of bluetooth lib directories. > > +## > > +## > > +## > > +## Domain allowed access. > > +## > > +## > > +# > > +interface(`bluetooth_getattr_var_lib_dirs',` > > + gen_require(` > > + type bluetooth_var_lib_t; > > + ') > > + > > + allow $1 bluetooth_var_lib_t:dir getattr_dir_perms; > > + files_search_var_lib($1) > > +') > > + > > ######################################## > > ## > > ## Get status of bluetooth_unit_t service > > diff --git a/policy/modules/services/obex.te b/policy/modules/services/obex.te > > index 5e2f20578..6803123b1 100644 > > --- a/policy/modules/services/obex.te > > +++ b/policy/modules/services/obex.te > > @@ -9,6 +9,7 @@ attribute_role obex_roles; > > > > type obex_t; > > type obex_exec_t; > > +init_daemon_domain(obex_t, obex_exec_t) > > Please make this tunable, since it is not the common case. Thank you for the review. I have a question about the tunable approach before sending v3. init_daemon_domain() expands to typeattribute and role statements, which are not legal inside a tunable_policy block — so wrapping it directly would cause a compile error. Do you have a recommended pattern for this case? Happy to follow whatever approach you think fits best. > > > userdom_user_application_domain(obex_t, obex_exec_t) > > role obex_roles types obex_t; > > > > @@ -20,6 +21,8 @@ role obex_roles types obex_t; > > allow obex_t self:fifo_file rw_fifo_file_perms; > > allow obex_t self:socket create_stream_socket_perms; > > > > +dev_read_sysfs(obex_t) > > + > > Please remove the extra blank line. Noted, will fix in v3. > > dev_read_urand(obex_t) > > > > files_read_etc_files(obex_t) > > @@ -32,10 +35,12 @@ userdom_search_user_home_content(obex_t) > > > > optional_policy(` > > bluetooth_use(obex_t) > > + bluetooth_getattr_var_lib_dirs(obex_t) > > ') > > > > optional_policy(` > > dbus_system_bus_client(obex_t) > > + dbus_connect_system_bus(obex_t) > > > > optional_policy(` > > bluetooth_dbus_chat(obex_t) > > -- > Chris PeBenito -- Best Regards, Wei Deng