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 3FE5C2F8E9C for ; Sat, 9 May 2026 15:00:46 +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=1778338847; cv=none; b=YS2GmtUPI5kSuGKIJFU+H9ZLBaVODEGdeRlKFcA8lG03hvZ5DElDMaoL41sBb+eK1DgTzMmD9k0SFmpPk+YE0AQ+ce81u3835nU9N4FK6YNNzUnX7OgnXZTbDs5UABt/3D4UedlI+/xY0z2WDlXTHBpU9wgny7leyrhF7Hm+PRk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778338847; c=relaxed/simple; bh=yLEg4BijJGTioR39qXMl7CeYjzXmREOBACvRmbe7FKs=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=b7n41rQZ0ww/2wOyCTIk21MmtTwtnRnlVeN+BXY0HsISAkKNgJRXdmvgJmOATkrcaztmj9EomoguJY0/2ow8DsfewlFO5Hm+TsDowUkOq+73E+p114rrxs8+udtLvpgzl4Jkmx4lT9NE3fYxvYyrC16uptwm0gOXr3WhcWk5jCg= 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=b1E7puLT; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b=QF65R5/1; 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="b1E7puLT"; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b="QF65R5/1" Received: from pps.filterd (m0279873.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 6490Jh2T1767965 for ; Sat, 9 May 2026 15:00:45 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=5aAtWZuj5dL g4kPM9pHzoZ4ou5sDI4rrLdEdWLoG4oc=; b=b1E7puLT10fdPrc18bXet1wfLSJ dyAx9dDjW2LbDa2MIagruOdtKKf3zHzGuuhdwsndHf3m6FfNrD0EVZrUQjhcJiZ5 7KPm+76wfwn9cTBaZ9rs9oap3t7VJjeXmy/rF2na1lsLVz/1SVD8B1Heb9jVNjeA 77AuRCaH5JQvxCEHOiiTy5UbTekwCPDQJXmrC329xI6J7LR+6Bv//R/vMNNTsgZa NWsrbv5Uv7l0o5PnZpt3EV07aM3/CEFLJ0bdr2IIgJ7knLjCo0Csg1BNNurcwl41 X1HiPE8pO8UJEz0z+CFgptfOZWUW7XajX5ZjN7nJsDaZTZFYoIEYVZ94EFg== 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 4e1t9q1fwq-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Sat, 09 May 2026 15:00:44 +0000 (GMT) Received: by mail-dl1-f71.google.com with SMTP id a92af1059eb24-1309b9bc551so404169c88.1 for ; Sat, 09 May 2026 08:00:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1778338844; x=1778943644; 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=5aAtWZuj5dLg4kPM9pHzoZ4ou5sDI4rrLdEdWLoG4oc=; b=QF65R5/14HYT2zMv42Qh8UWgsOKdoHA7rj56Bxf3MAjU7HVGczjGAx/0BHM9OPqF1S ojlTAVihRQ0Xe+4E7QBmdIJb6gW2PVuBtA3vlIKhoMAACJhvbRpf4Opl6FtBsvZQqM8s l4Xbake80cA7CfG/9XWNFokDjArvI7aqW2gsqjyhgnhXZZTS53nbDkFgwFz3h8vj519N a3bplVLs3Y68fPVh5zwBHDOXX2/Exb3mG5KietH/9RWBliqM1UrR/Y0Dauur94iHTHnf da5pxXYbMgqRuSXnMOj9JBQ3QY9z+xRsQk5ZA6lo5O7/+ufk6rXUHwg7KzaUPUOHa5uj nVNQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1778338844; x=1778943644; 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=5aAtWZuj5dLg4kPM9pHzoZ4ou5sDI4rrLdEdWLoG4oc=; b=AXBQQaNRmPA2CDTT82tS3m5zLls2Zu/2XAe4+uOAfI1wmWKlSCzuKWnplN+eRBDsHl s2ewXLwD8+p5tWpkSL/diQQIO06AWiSfa69tqIbvB74m3iwb1vvGxQMmr7ZdDNBrbGuC aSAoWHMPXmpNzXCzr2nwrDZf6cdlt/J1AG1IQI9Ytf5K2Nu7fRN9OAsWH1VbwcM7Y+O7 glEkK2itiJ6RwRaKzIjqUC5x/bVnd5bbmiQTAPwPawTQcpj8uRJm7+3RUpsAeXOOZlTS 56v07PkcolcHPkFTgQqwWxj8WcGbYGW7wo/zLFsekyKlJW9NpySyZw6t7g9XLSXfi5G0 U0fg== X-Forwarded-Encrypted: i=1; AFNElJ/jDFbXphskZuG0ozAwDFYL2H1MHaeUjZD0CihjpOUnGeix6S0Syu0suSuNEqm0hi65EHGTTWTRfJ0GX0CP3KrIFg==@vger.kernel.org X-Gm-Message-State: AOJu0YyMtppBaDRGst5elg2AY/yep+rSuj2elq90Yt4HmZ6UrcSCAMaM Uq3/picvIGTTD3DqTTExrei5Cd2wKmsyveYq4s7ylNhAOovQpTOq3v2P9h2OIKgfy8R/gezswHl LdpoOPDNy/x98fLwWg7xvaq3O2b2r25HEvZR83qeyhVeX9xbJL3IEen/zh+P9iX3OpVxLJRFJjA == X-Gm-Gg: Acq92OHNlqlYeecOPgiZZa2kgigzKEEL36q0e/sPW5f+kkJFkPtjA+b5653XKgGkhEa BqR5QvNz+bLIz4fZXgaGkvPbU2UoO7Z8+WLGJvik1S9BZUyZh8cTCqtgrZbo5GqlXYChLjVGYwS gHr2FTC4sCp5Z60Gt3ymspaUjaKceHAcGG4wad4Hz70UcX3wSnGKXtAq9/xSwN3wwU/Nkt9HQwQ OkA5PLUDObyucmypJb/kZBiRUX4GCiG6kz0aRdyab8G7RmqFtYDjVEH1LIf9rbKCMW6dpGH+x8d znn+zNfLUNulBbHdgZ4AyEUVwbc0mYG5lJiNvy6TF3ZujZj60W845nM65XitYzy1E11htqbJFpW 2/D/o656OfcrySUwLVd7y/OZuOjJMZHUMq8u9JcXXzX1LV6e/SryKQDGUSqtoXbKDREB46F1T X-Received: by 2002:a05:7022:fc0b:b0:132:5d42:55c5 with SMTP id a92af1059eb24-1325d425714mr1401692c88.1.1778338843700; Sat, 09 May 2026 08:00:43 -0700 (PDT) X-Received: by 2002:a05:7022:fc0b:b0:132:5d42:55c5 with SMTP id a92af1059eb24-1325d425714mr1401687c88.1.1778338842908; Sat, 09 May 2026 08:00:42 -0700 (PDT) Received: from hu-weiden-sha.qualcomm.com (i-global052.qualcomm.com. [199.106.103.52]) by smtp.gmail.com with ESMTPSA id a92af1059eb24-13277bb2b14sm8390549c88.0.2026.05.09.08.00.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 09 May 2026 08:00:42 -0700 (PDT) From: Wei Deng To: pebenito@ieee.org, selinux-refpolicy@vger.kernel.org Cc: 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: Sat, 9 May 2026 20:30:38 +0530 Message-Id: <20260509150038.3978062-1-wei.deng@oss.qualcomm.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20260429134143.1217836-1-wei.deng@oss.qualcomm.com> 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-Transfer-Encoding: 8bit X-Proofpoint-GUID: I1HZXc6-3QTmnRRiR9EG-AqlABXFX0-2 X-Proofpoint-ORIG-GUID: I1HZXc6-3QTmnRRiR9EG-AqlABXFX0-2 X-Authority-Analysis: v=2.4 cv=J7yaKgnS c=1 sm=1 tr=0 ts=69ff4c1c cx=c_pps a=JYo30EpNSr/tUYqK9jHPoA==:117 a=b9+bayejhc3NMeqCNyeLQQ==:17 a=NGcC8JguVDcA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=rJkE3RaqiGZ5pbrm-msn:22 a=EUspDBNiAAAA:8 a=R3VfWtqXMkzRRkKb0ToA:9 a=Fk4IpSoW4aLDllm1B1p-:22 a=zY0JdQc1-4EAyPf5TuXT:22 X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwNTA5MDE2MyBTYWx0ZWRfX/UQ7FHJQRJIS xv2/JhaGvrJVRehFADXeXRyopsF9QpyrX4znk6PoZipUqDKFJtLdr20bQIQRM6epD0BYFWY1L0l WooEautdnZYKn0KVwWOMZAKlLZhRSD126oONI/v28ib+AGLO8ltpf15Do7+VXipBrU/Bljyq/Yt U//GmMzbf0T+rPhUIy2OZzng+JVbQpsCl6j5CxtFiR1+eRBQWKfv8+GycNvVUoboaOI48btQEqz 98GtHWshjaB34hAX05eGszBtfRxsLM3APvP4EgslENFChgBILti42PSrJTS45IHphkYHZDS6BzK /hZMLO1okGgH12lQbLn2FyyuYQ8PdZFxgY32OUygh5OWaT/6vx73uX83BgdKV/JaB+Vk3ihnFka Vfu2vztH9pZrzBt8r1Ppx5VV1rR5ESo0V3JxNz/EfYVYMH6LR5UYvXU+aLcucmHUp1QKVJXnnnq +s+AaVp8US/I0pwZSUA== 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-09_05,2026-05-08_02,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 bulkscore=0 impostorscore=0 clxscore=1015 suspectscore=0 priorityscore=1501 adultscore=0 lowpriorityscore=0 malwarescore=0 phishscore=0 spamscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2604200000 definitions=main-2605090163 Hi Chris, Friendly ping on v2. In your earlier feedback you suggested making the obexd daemon transition tunable. In v2 I kept userdom_user_application_domain() alongside init_daemon_domain(), so the existing user-space path remains intact and the daemon domain transition is purely additive. Would this approach be acceptable? Thank you for your time. > 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) > 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) > + > 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) > -- > 2.34.1 -- Best Regards, Wei Deng