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 0299B22D4C3 for ; Thu, 23 Apr 2026 03:16:15 +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=1776914177; cv=none; b=uSx0FpU5I0DLPS3ggOaOoejaZ69nrYbFZijyc2FODtJ6hpy/ZfuiVYW6i/ibG+7Q43PMaAexHlqZgvi0ybLKHBf8m9Sd2Kb5T/cppGcgoGWem3/yoFYIt42QKtWIbhn/KQoC1lwLDdsGKsvUCCE3iCXkt0Vh3WMuy1XLMQrVqgo= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1776914177; c=relaxed/simple; bh=cxUd5Z7LGso8Lup9x67FvmUNsU4HWcIqaJsq/BG/gEU=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=QMZ779MUpQgRcFv9up//n79AaL1Y+joxbrpL6F7Bfg0XdRTddKFVRVzZ8WSx9/Wfv/y7Yi5xSJbLEwd72xARuaOlgzyr9/yRNSd2BM0daN83MEwd+BCXf3SIUk7npFS0rOeSzPgJbHP4DGqxgZ9RP5NOiUDa57WiPikPALbElUQ= 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=jCnR9NS7; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b=L1TZaUx8; 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="jCnR9NS7"; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b="L1TZaUx8" Received: from pps.filterd (m0279863.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 63N2l1681230220 for ; Thu, 23 Apr 2026 03:16:15 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= 4L/QoMwhfnUGX9UGqMg5QUt9ghowdJw5es8p+0UpupY=; b=jCnR9NS7vWODv8sT aSj6RW1g1E3gOgzeLUUUNn4LrJycRDMfxSsKQGqGHQFJTIhxo8glMYDYSWEu/Lv6 n8SKPeJUwl/eNEEf04R5qn9wA8e4dNQ9vmrJWDNK6J2SmzRk571BTaauNybZmv49 m7eL/c7LoRxCJAr8D6HSu1rHqP7WHrhxpC4EPycLhfj+NvWN6nL+1QNV5bS6KP3q Qle/q3zJBSMp7kWN3cCvLC2P/cqXW+n3HJy85vfneBdHj6eTr0kE33R+VisAcIWa ieKPDbr/O1+ZyXDXfepIkq5mOIcEa+3SdLl3S6LL+DlsvcvPEC0iuiQXkoevXvuO YP89VQ== Received: from mail-dl1-f70.google.com (mail-dl1-f70.google.com [74.125.82.70]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4dq1h69xm1-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Thu, 23 Apr 2026 03:16:15 +0000 (GMT) Received: by mail-dl1-f70.google.com with SMTP id a92af1059eb24-1273683a5dcso903867c88.1 for ; Wed, 22 Apr 2026 20:16:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1776914174; x=1777518974; darn=vger.kernel.org; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=4L/QoMwhfnUGX9UGqMg5QUt9ghowdJw5es8p+0UpupY=; b=L1TZaUx8NNty7MZLlb3ZrX/1X8ZhJierOjvv3BmzHWTswFpUUH3EHa15QYNneMqo80 MWbl6eah6O/yh5Tpiubv9VxATPrLYExZCRyOg9rAdLvBWpS7VF/r4zOuyQanXmXObUNF 9Lky9URVze/cxkQxCqkKgjBKZNqcmPsCrr6lU7EBGFu/ApTo2wRZvugwCx5zvmQ0tZ3M 8cMYFVNhM1TMaZBtMVEh/5ydX1W8CJ/SxCkUulfuPD/UfyZh/vQCeBvHP22SlJnxVNEY 8Wi7tyAw4EFE1bGXwrg+GKxG4dzFu6t0L9PDMtFEcemDqjr4ZcV65b7lp0XmCLQMIsT4 9Y4Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1776914174; x=1777518974; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :x-gm-gg:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=4L/QoMwhfnUGX9UGqMg5QUt9ghowdJw5es8p+0UpupY=; b=fN0Q+iyd854zRyWdkIiIVusEynJRPWExC1MkvZEDqgehctXmIsOAZZftF0BHf3RXNa PETV9rCuWsA9Rgn1n1YC/qhb8EBjztbi0AVQlGmPft2pORObqrQSd8MG/1D8Lpx7FuQq 4UN+SOa/8DQCAql/aHoz4HiDTBm55xN5AZy2bwHKmQdqFCCaH0uruc+fk7dJsgSDocHG ZP+UuHcRmllJTRwE8IB/4KjKWTdeWr+9MXOZYlG/BCebrgYxdrpBTj9QIjPr7iL5dlWz z7hMRXJmE/AUZ6srrEXUb6PaEbkSd1vyBO0OlW1VPTm+/20HhyXVPrt36tuX/mlO7L7D hb3w== X-Forwarded-Encrypted: i=1; AFNElJ+M4dpbd4mAPugKCTlYABavsrL6IDbnBd/nMniUiaDQ21emM7ORcdZiRfsq6tkVPz29HH0uK6IIK4rQllHwBad/aw==@vger.kernel.org X-Gm-Message-State: AOJu0YxNQEFFp0moU5fPTYkVcEtSed0vbDn2BqNaMXYKJbG0ixBtHAF4 84mrZCk2I4U7ilJVL1vSSGuX6CmlqmLcBjscChwLfFzyXwkvN2CV8yJL4HsvtLrLIIdzG4xsbin rU+VOLRm8hBd5vx65tV32n5p1zbhUcLu8YEW02ESLikV5XZUOvzRM7sUI/mhrJU7bLPwV7FgQBQ == X-Gm-Gg: AeBDietJwzgLgiYE/13DhAj0BUXhaO4IKoFXnzyhcm8T7c5EmzOU8o+dT3sRP2vsDA0 0SuNXhe1/9T7n8FNV3AsS9B1v+e9i+TwDVJohBhk8G2eG+ee4OJRfXdVtBm4UC4DhDQrKyK6Y4a B3v9YHPlI8rEZ4ieKpcmUqToK4TCWfNd1On6Axw+pLJk41mWBa4X0Q/S2+r59W0GzewZInLqZK+ LdC8UMhe4RNF47kd0NPuKlQDlISjpyj9qwLciOi44GW6hnf2d9fpkSJ8VATb5znfVFWUkD2+Rcm FSXgxOs4u1ucNQyqfiNVEOc6bLXT8/QfnQ2bqf9DvvQu2NXIlsErtELP9hEqi42g1LNNsAILWsg v5IxgIjYQuGIBF9UO47NWfXluMNVzX7zCfR2DOtlZ7353/aCq8yWYyw== X-Received: by 2002:a05:7301:1984:b0:2d9:94b4:a1bc with SMTP id 5a478bee46e88-2e479517ab5mr5499215eec.8.1776914174339; Wed, 22 Apr 2026 20:16:14 -0700 (PDT) X-Received: by 2002:a05:7301:1984:b0:2d9:94b4:a1bc with SMTP id 5a478bee46e88-2e479517ab5mr5499208eec.8.1776914173696; Wed, 22 Apr 2026 20:16:13 -0700 (PDT) Received: from [10.239.97.27] ([114.94.8.21]) by smtp.gmail.com with ESMTPSA id 5a478bee46e88-2e79c2954f6sm26147738eec.30.2026.04.22.20.16.11 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 22 Apr 2026 20:16:12 -0700 (PDT) Message-ID: Date: Thu, 23 Apr 2026 11:16:08 +0800 Precedence: bulk X-Mailing-List: selinux-refpolicy@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH] sepolicy: Allow bluetooth to send D-Bus messages to systemd To: "Christopher J. PeBenito" , selinux-refpolicy@vger.kernel.org Cc: cheng.jiang@oss.qualcomm.com, shuai.zhang@oss.qualcomm.com, quic_mohamull@quicinc.com References: <20260403063120.2752877-1-wei.deng@oss.qualcomm.com> <7ee9976c-821e-4aec-83e9-3a820f097901@ieee.org> <6dfcae79-bc3d-4258-a2c1-4cbd33e7df56@oss.qualcomm.com> <4fb4970f-ac24-47d8-9c62-5e20e0d3b5bd@ieee.org> Content-Language: en-US From: Wei Deng In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Authority-Analysis: v=2.4 cv=f4Z4wuyM c=1 sm=1 tr=0 ts=69e98eff cx=c_pps a=SvEPeNj+VMjHSW//kvnxuw==:117 a=Uz3yg00KUFJ2y2WijEJ4bw==:17 a=IkcTkHD0fZMA:10 a=A5OVakUREuEA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=yOCtJkima9RkubShWh1s:22 a=EUspDBNiAAAA:8 a=q44oNoX54kfLA7NXy-0A:9 a=3ZKOabzyN94A:10 a=QEXdDO2ut3YA:10 a=Kq8ClHjjuc5pcCNDwlU0:22 X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwNDIzMDAyOCBTYWx0ZWRfX4DJ5XHB4+hwQ oLkjp/Zlp5VQMpuzG6WLeZIgNn/GHMvtjaOCt+fKGfZTk3cE/0ru45/3NMwLpNbyDFpQy+vUPN7 sENAzJ7kBmoHShgAF6l6H4tdQzHB7BE2FpfuyNfw2QN0eDHbtgzZzs104AKHv7QntQaMx1o6oBB akDDpMxHVvQYzLXIRjtfolMQ6lcvYgBgCqt8H6tXt2H/gtriKi/2BkGli7OSMdtKPRCh4gYcfiu 1WBzF8dFcUj8DfbpD3cLWpBFSWRKeH8N5fUCtVW9yBx5luN0Yl36SgP6/PAz8lsETK73PpYgM+/ 7Gej6L1/xhgUzso/s5rTKZ93aEfNT+A5/zlg0VRH/KVVecD374MCewdQOkbE+5jgNSQKarEQA7a 8D5JlLUCS0DM7km/ulLvYoPYQOfztRd7jKy7t7+gt7xoAfuypasnpfQR+vqYtTJtnoptqBpZvL0 Esdp6JDAKNhh98yjxRw== X-Proofpoint-GUID: MuQnJzPgigKdQeE8UxrMP0IKwB1SGKQ0 X-Proofpoint-ORIG-GUID: MuQnJzPgigKdQeE8UxrMP0IKwB1SGKQ0 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-04-22_04,2026-04-21_02,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 impostorscore=0 phishscore=0 bulkscore=0 malwarescore=0 clxscore=1015 spamscore=0 suspectscore=0 adultscore=0 priorityscore=1501 lowpriorityscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2604200000 definitions=main-2604230028 Hi Chris, On 4/13/2026 8:32 PM, Christopher J. PeBenito wrote: > On 4/9/26 7:36 AM, Wei Deng wrote: >> On 4/7/2026 8:40 PM, Christopher J. PeBenito wrote: >>> On 4/4/26 5:19 AM, Wei Deng wrote: >>>> On 4/3/2026 10:01 PM, Christopher J. PeBenito wrote: >>>>> On 4/3/26 2:31 AM, Wei Deng wrote: >>>>>> Add init_dbus_chat() for bluetooth_t to allow bluetoothd to send >>>>>> D-Bus method_return messages back to systemd (init_t) over the >>>>>> system bus. >>>>>> >>>>>> Below avc denial is fixed with this patch: >>>>>> >>>>>> avc:  denied  { send_msg } for  msgtype=method_return dest=:1.11 >>>>>> scontext=system_u:system_r:bluetooth_t:s0 >>>>>> tcontext=system_u:system_r:init_t:s0 tclass=dbus permissive=0 >>>>>> >>>>>> Signed-off-by: Wei Deng >>>>>> --- >>>>>>     policy/modules/services/bluetooth.te | 1 + >>>>>>     1 file changed, 1 insertion(+) >>>>>> >>>>>> diff --git a/policy/modules/services/bluetooth.te b/policy/modules/services/bluetooth.te >>>>>> index ceb42d147..a73cb5db0 100644 >>>>>> --- a/policy/modules/services/bluetooth.te >>>>>> +++ b/policy/modules/services/bluetooth.te >>>>>> @@ -136,6 +136,7 @@ userdom_dontaudit_search_user_home_dirs(bluetooth_t) >>>>>>     optional_policy(` >>>>>>         dbus_system_bus_client(bluetooth_t) >>>>>>         dbus_connect_system_bus(bluetooth_t) >>>>>> +  init_dbus_chat(bluetooth_t) >>>>>>         init_dbus_send_script(bluetooth_t) >>>>>>           optional_policy(` >>>>> Can you confirm this response is going to systemd/pid1? Is there a fuller set of log messages corresponding to this denial? The init_dbus_send_script() makes me wonder. >>>> The two log entries list here: >>>> >>>>     type=SERVICE_START msg=audit(19.419:292): pid=1 uid=0 >>>>       subj=system_u:system_r:init_t:s0 >>>>       msg='unit=bluetooth comm="systemd" >>>>       exe="/usr/lib/systemd/systemd" ... res=success' >>>> >>>>     type=USER_AVC msg=audit(19.547:319): >>>>       subj=system_u:system_r:system_dbusd_t:s0 >>>>       msg='avc: denied { send_msg } for msgtype=method_return >>>>       dest=:1.11 spid=684 tpid=843 >>>>       scontext=system_u:system_r:bluetooth_t:s0 >>>>       tcontext=system_u:system_r:init_t:s0 >>>>       tclass=dbus permissive=0 >>>>       exe="/usr/bin/dbus-daemon"' >>>> >>>>> Can you confirm this response is going to systemd/pid1? >>>>> Is there a fuller set of log messages corresponding to this denial? >>>> Yes. The SERVICE_START entry shows pid=1 with >>>> exe="/usr/lib/systemd/systemd" running under init_t, confirming that >>>> init_t is systemd's SELinux domain. >>> These two audit messages are not related, as they have different event IDs (292 vs 319). Additionally, SERVICE_START messages are expected to come from pid=1. >>> >>> Can you confirm this response is going to systemd/pid1? >>> Is there a fuller set of log messages corresponding to >>> this denial? >> You are right. I apologize for the confusion. The two audit >> messages are unrelated, as they have different event IDs. >> >> Here is the full AVC denial: >> >>    type=USER_AVC msg=audit(1773416627.807:455): >>      pid=801 uid=997 auid=4294967295 ses=4294967295 >>      subj=system_u:system_r:system_dbusd_t:s0 >>      msg='avc: denied { send_msg } for >>      msgtype=method_return dest=:1.27 >>      spid=1942 tpid=1944 >>      scontext=system_u:system_r:bluetooth_t:s0 >>      tcontext=system_u:system_r:init_t:s0 >>      tclass=dbus permissive=0 >>      exe="/usr/bin/dbus-daemon"' >> >> The tpid=1944 is obexd, not systemd/pid1, as confirmed by: >> >>    ps -p 1944 -o pid,ppid,comm,exe,label >>        PID  PPID COMMAND  EXE                           LABEL >>       1944     1 obexd    /usr/libexec/bluetooth/obexd  system_u:system_r:init_t:s0 >> >> So the real issue is not bluetooth_t -> init_t (systemd), >> but bluetooth_t -> init_t (obexd running in the wrong domain). >> >> The root cause is that obex.te currently uses >> userdom_user_application_domain(), which does not create a >> domain transition from init_t. obexd therefore inherits >> systemd's domain instead of transitioning to obex_t. > > Thanks for working that out. It would be acceptable to add this in refpolicy, but I think it should be tunable. It's not a common case configuration. > Thanks for the feedback. I will consider your suggestion and send a v2 patch series shortly. > -- Best Regards, Wei Deng