Received: from mail-qv1-f50.google.com (mail-qv1-f50.google.com [209.85.219.50]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C741F2D3A69 for ; Mon, 13 Apr 2026 12:32:50 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.219.50 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1776083573; cv=none; b=DZHG5rIofaRGFRsthm0fzsgwmo2stDPGkX9EMe0CLfSO4AXgmSbj1MvHvduxLxzIdhdLsjbdFb5lGLw+ZZ2SXlxYa0FdCvtXqLQuEkvxNgrRtuvNLrFd0sculFdHFqtIM56Xm+suqcPhoQq7gCkZQw6sPj3RzcHXxFI7IDDy1o4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1776083573; c=relaxed/simple; bh=SVMepiPTtcyDI33g9e+Y79RYHOfYLVXmXpoZBjguKSg=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=oceP/59FtacA2ywLY8gYiHjfNyO5whrX+p6ES0QONgxVTpdSOt+g9fK8YUiXiuCDd9AHgX0/jZogNWC2gOzZPOsxrfFRqPznyp/VGdKvCEFPyWQzQuR85gKoOyVap3JjAncfpbMiJ+q3/ZtqXxSHzkUlqxdBHXOqKrJhUhADb6M= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=ieee.org; spf=pass smtp.mailfrom=ieee.org; dkim=pass (1024-bit key) header.d=ieee.org header.i=@ieee.org header.b=UHYV3+yU; arc=none smtp.client-ip=209.85.219.50 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=ieee.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=ieee.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=ieee.org header.i=@ieee.org header.b="UHYV3+yU" Received: by mail-qv1-f50.google.com with SMTP id 6a1803df08f44-8acb3dab8dfso4116046d6.1 for ; Mon, 13 Apr 2026 05:32:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ieee.org; s=google; t=1776083570; x=1776688370; darn=vger.kernel.org; h=content-transfer-encoding:in-reply-to:autocrypt:from :content-language:references:cc:to:subject:user-agent:mime-version :date:message-id:from:to:cc:subject:date:message-id:reply-to; bh=0hFJpbv93ERwIZqCw7OSJvjpd0ybtzeKEhX169Pw/3Q=; b=UHYV3+yUJ7+B/Y962Q7vA5+LHIEIsqmMTvgzcrq92YQToRm4qaVGSDO5xRL1SiOsWp OWEqychMZfAe0e6Goy+z1+cUDXzwaMmHIllcWeLpNnZ5x6qs/FXAQeJE/vZl38RzHT7h XEoq1QSvd/U3tTs3Sv2LxQcOIBvdfVs3OsKRg= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1776083570; x=1776688370; h=content-transfer-encoding:in-reply-to:autocrypt: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=0hFJpbv93ERwIZqCw7OSJvjpd0ybtzeKEhX169Pw/3Q=; b=iUfW21l8zpTZBKA9/gOt1yPhw57/iLAv7ewWDYwqfAlr3ymj/b0ULOkC2hiLfPVuPj J/u4Lxbcks8V89jN4wwW5zkxY/V9IhDjnFMrZWxQRyHvqHm5iThdWqZ4oaaWUXpWig0m 0fsIbZsydcbKD6MW8TwpFovPfKI43rnIqXYNBJ/2NzwFGqAKlaYy36v+fOtgA+1iYWkM jobAfrw0SFMUzOevW2x3jJuzR2t+cOI24sYb2CJ5gV/BmjaP3Frr6+gwCpib7Y6qjAAs F1dbtHBbNQ/ldxyuMHAE5oUzFYMjWkY3ql2ktHg8qoDf8v6YpNZP/OIE8yM2MWz5YWe7 g5hA== X-Forwarded-Encrypted: i=1; AFNElJ9QWdThgM2tfM3jCyzx3G3yQvc8vW06YdgkGAwZJu+uArUKJcitz5Mr4OOleAfaOgu8RBbN5Vb8DeON5UhX3p6xmA==@vger.kernel.org X-Gm-Message-State: AOJu0YzTSM5xwBk8uSyj1AFw9EoiUw5R2HfIiFD9LxYPWqeGoIjo+Z4a gR27zw9OgPIPJTlAMBDDY24hbr2d+3Kj4k3ayPoeKAg87jiUsxa9eaZRt1nIXodndQ== X-Gm-Gg: AeBDiesg72zCJW3axvCcSyXbjeHzL6X3wBbWMZpqR6wdd1ojqT3ZcBGB1NOGqobHjRC 4Rrm8WFVIjM/GmArqGKz/zf5MmclRUM1f5aydLLkS5si2lXAEwbUs7N2fte2e+ygn2zamxAodg8 sGhgz7K6bV0msbYkgnUXiw7bKp+9Xa3ZTeeK2TTsVdTGNo/gHfhctxWn93kh/Mt5/svHSK1nmnp Sdm5Ff5yb+VmWwcuMknoUCtoqaavis0blDnBL2pNIHNXh5zWQLm96V1oqqyM9uHsdbFotgGGWJa xr9QvmTh/P3RU+k22KQJ5yRxV1VSEhQNP90b0jxZeb27qHSrlqSRv/zwuYTzI4DKStHq1t006Qi XUgwRmJdZ7cWYRUD/pmsVHnI3POEfV1xFjFxYgDGJcBhrpKrKSu27gome41yy4L44IrJfw2xRGF JXazFDKUq7mQJagQ191kUSB9QSiRQTDklghBfsScCypVkuFWwsx8/cDG60/wMmMGqK3/UAq74tB OHA6nj5/n4SfDkJjo2aZbxFTyEatgr08UAQtIRcP0lRC/JBZw== X-Received: by 2002:a05:6214:529a:b0:896:fdd6:4a93 with SMTP id 6a1803df08f44-8ac8625e0e4mr208808286d6.50.1776083569474; Mon, 13 Apr 2026 05:32:49 -0700 (PDT) Received: from ?IPV6:2601:145:c282:5650:71bd:20d:33ea:4d98? ([2601:145:c282:5650:71bd:20d:33ea:4d98]) by smtp.gmail.com with ESMTPSA id 6a1803df08f44-8acab3dde39sm31695446d6.47.2026.04.13.05.32.48 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 13 Apr 2026 05:32:49 -0700 (PDT) Message-ID: Date: Mon, 13 Apr 2026 08:32:48 -0400 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: Wei Deng , 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: "Christopher J. PeBenito" Autocrypt: addr=pebenito@ieee.org; keydata= xjMEZuhGfhYJKwYBBAHaRw8BAQdADz/tF/gexoZlGld9hGmv5HXcHP95b15YoRSbsznX8EHN K0NocmlzdG9waGVyIEouIFBlQmVuaXRvIDxwZWJlbml0b0BpZWVlLm9yZz7CmQQTFgoAQQUJ Bi93EgULCQgHAwUVCgkICwUWAwIBAAIeBQIXgAIZARYhBMTGKxZwwt8zFEjyhsY2PvHJaXsU BQJm+wuYAhsDAAoJEMY2PvHJaXsUENsBAO8TrrQXhCKCpNQUWvDto13w55ofDKHA3SVlCtzP zzzhAQCvGb8h5fPcw5eTjgLZbXAAG95uMtxYZzs66FNorxUVCM44BGboSckSCisGAQQBl1UB BQEBB0DUELErM3F1hWb3j/Wm3vDku3kdA2YVLxZtonOkF6XOUgMBCAfCfgQYFgoAJhYhBMTG KxZwwt8zFEjyhsY2PvHJaXsUBQJm6EnJAhsMBQkDwmcAAAoJEMY2PvHJaXsU+x4BAMeSfc01 SUt1eNtWAEj/caCS4ako0iZd7QZT8recX3zfAP0crszn37KtEaiHb5vHy38tym3+cSzDzvb8 +9wp84UkAg== In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit 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. -- Chris PeBenito