Received: by 2002:ab2:6a05:0:b0:1f8:1780:a4ed with SMTP id w5csp290567lqo; Thu, 9 May 2024 22:50:37 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWRydQzOOB0yxWH/oSupFzBL9mhOcsMNn9LuJ+UGZSMOfw4CBjcfB3IpwfTeJYoJFM8Bnw9D0wotCFDsAnJKskMnkrbhc1Mi4WEYDw/EQ== X-Google-Smtp-Source: AGHT+IGiWxr/ESWjqb91oMYy8OpI65V3Ba5gjfVHZT5O62ggulCbuT6hrNDUd+cB/5r8pDla5bJD X-Received: by 2002:a05:651c:221b:b0:2df:c1e7:ab65 with SMTP id 38308e7fff4ca-2e520062280mr8980821fa.26.1715320237064; Thu, 09 May 2024 22:50:37 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1715320237; cv=pass; d=google.com; s=arc-20160816; b=NsWBOBaKJuCaYtC3iLz4OxWfL5AVJu3YjT3rjiIsaq+PUWAUGWjuB4ZiEUuTnVth+V PW4PiU0fryvgTEc+e4QqPqVlIJfRgVGUha8olj6Dn7ho96eBq545GKUAosvw+2VOhcXu BMS9vzeluQm2+JCaGh6XWDdVwhTqfVAKgCByfeIODJ8jXx3ZQAdUKz3ZaAv8VnV5Hcjs cN+M1LKgxWPGQPjT8V5y06XaNWBkWQYqNNINH+1YYw2e5VQLFbPnZ9+jUmznZE+3GvHw b6oeH3ltpqT663Os7cYSzipwsMjGzJ1pIaYYbqh/VK6qRixlvNmjBogOWdsTTJFitY+e mkBA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-unsubscribe:list-subscribe:list-id:precedence:message-id:date :subject:cc:to:from:dkim-signature; bh=NOikgk6nWtu1LJdlVda0fu0cRar5hXDBPeJFajR0olI=; fh=TO64qoKq1cxKt/28u8OqeeJ5XZaRpnAQeOpPr6FChC8=; b=mpcjqgmRQTMOn8qOcKH/LdpceaE8HFeYTNqQ8iB6oHFdO4bCGYxPciaWfhETiDKhwC lp4oCbQyW98ZnIFwZ8ElZjuJkVMzo6wfntODyqboeG5daXFi0xlNnwDkCLrKUvAjYj3p Pj7/nkUSdPzw0wzyzfXareRPD2FesM3d5EExAroWBIUtxQxxdAcTJgP0o+eUm0AyUe+c 223f1kNRGUFxpppkZ01aFFm4g3TPwwVLld/ROiWPPeo5HvYuBrT8QTcyU+tR9+zWgZq1 w/gD9Z7TK1fKYtFehPbF1tzwICwK907VXKBHgEgW+eN8HW3BPMa/Zf+zWertZbmnPkhb ursQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=DVAvKCiO; arc=pass (i=1 spf=pass spfdomain=qualcomm.com dkim=pass dkdomain=quicinc.com dmarc=pass fromdomain=quicinc.com); spf=pass (google.com: domain of selinux-refpolicy+bounces-6-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="selinux-refpolicy+bounces-6-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id 4fb4d7f45d1cf-5733c36e393si1617677a12.553.2024.05.09.22.50.36 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 09 May 2024 22:50:37 -0700 (PDT) Received-SPF: pass (google.com: domain of selinux-refpolicy+bounces-6-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=DVAvKCiO; arc=pass (i=1 spf=pass spfdomain=qualcomm.com dkim=pass dkdomain=quicinc.com dmarc=pass fromdomain=quicinc.com); spf=pass (google.com: domain of selinux-refpolicy+bounces-6-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="selinux-refpolicy+bounces-6-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 931D61F220CF for ; Fri, 10 May 2024 05:50:36 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 17D8114A63C; Fri, 10 May 2024 05:50:34 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=quicinc.com header.i=@quicinc.com header.b="DVAvKCiO" X-Original-To: selinux-refpolicy@vger.kernel.org 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 7EFC2224DE for ; Fri, 10 May 2024 05:50:31 +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=1715320234; cv=none; b=gYxeWZiDisvCECq75F7RgUatMANKXk1wLam/fnROfRv97EA9UAen+K9wvK/6zchfV175bQuxiO7RxI6NSamc2g8dI0des3HhwBdZtERMAjYpUcmYZFVxENbr8aod2UtOxtOtlcJ2htcJM8STpetx3GcxlojoO++3njy2Jo2YSWQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715320234; c=relaxed/simple; bh=NQjoRMI/GdGKiRWr1YSpbxwT4YssVqvhRkFjXo90Yg4=; h=From:To:Cc:Subject:Date:Message-Id; b=DyYnV7HsKA/i2qNmjeOew5Kd6rNaza3lLU86RxaFov3VUO4WIBYIg3IevwUza0NffUKhqnzRQbcPdv2nHcb/xSWizSDVbbg8r3+XZvsPNIXYHk/hB2Cbl7iK49rQJzm/fSbICEmZM14vZfp34tpSf8D29q94c6zTu9n69xSgP4M= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=quicinc.com; spf=pass smtp.mailfrom=qualcomm.com; dkim=pass (2048-bit key) header.d=quicinc.com header.i=@quicinc.com header.b=DVAvKCiO; arc=none smtp.client-ip=205.220.168.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=quicinc.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=qualcomm.com Received: from pps.filterd (m0279866.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 44A2tgUI028323 for ; Fri, 10 May 2024 05:50:30 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; h= from:to:cc:subject:date:message-id; s=qcppdkim1; bh=NOikgk6nWtu1 LJdlVda0fu0cRar5hXDBPeJFajR0olI=; b=DVAvKCiO5cbQXxR4qMdoo4FJD/6G kjvtZnmN1uK7NlmIsOZzsPIJwa6L4YySgUO4B6Q2hmNsdK3J6QNJ7E71ZaI72Q6n NFMdoCPg+UN0EHa0IDzUiP3mIZoIQTjaWn4snKhaIC0hRNFp2dXqTyM62uT1DdIy h7+smYB+b7m1CRkuBSHt1MdBiiWq2IPadPaOrLNJlEk1PMm51Ed79RkEiJVJ31D5 dvNzQl7MTVwB/l0DsJDNHVVm086mu8tA3AEX56r+/arJ211YL71iUdHvbGcZ24qN mgzX+o3S6jF5iQYuTfroHHiPSK9D8ToCnsZzfj9sUw7Fzi1q81kD4qZjKA== Received: from apblrppmta02.qualcomm.com (blr-bdr-fw-01_GlobalNAT_AllZones-Outside.qualcomm.com [103.229.18.19]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3y16w0rnyq-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Fri, 10 May 2024 05:50:30 +0000 (GMT) Received: from pps.filterd (APBLRPPMTA02.qualcomm.com [127.0.0.1]) by APBLRPPMTA02.qualcomm.com (8.17.1.5/8.17.1.5) with ESMTP id 44A5oRnx007089 for ; Fri, 10 May 2024 05:50:27 GMT Received: from pps.reinject (localhost [127.0.0.1]) by APBLRPPMTA02.qualcomm.com (PPS) with ESMTPS id 3xwe3krg9v-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO) for ; Fri, 10 May 2024 05:50:27 +0000 Received: from APBLRPPMTA02.qualcomm.com (APBLRPPMTA02.qualcomm.com [127.0.0.1]) by pps.reinject (8.17.1.5/8.17.1.5) with ESMTP id 44A5oQRU007083 for ; Fri, 10 May 2024 05:50:26 GMT Received: from hu-maiyas-hyd.qualcomm.com (hu-rbujala-hyd.qualcomm.com [10.213.107.103]) by APBLRPPMTA02.qualcomm.com (PPS) with ESMTP id 44A5oQwo007078; Fri, 10 May 2024 05:50:26 +0000 Received: by hu-maiyas-hyd.qualcomm.com (Postfix, from userid 4130939) id E8060609546; Fri, 10 May 2024 11:20:25 +0530 (+0530) From: Raghavender Reddy Bujala To: selinux-refpolicy@vger.kernel.org Cc: quic_mohamull@quicinc.com, quic_hbandi@quicinc.com, quic_anubhavg@quicinc.com, Raghavender Reddy Bujala Subject: [PATCH v1] Need bluetooth socket permission for pulseaudio. Date: Fri, 10 May 2024 11:20:19 +0530 Message-Id: <20240510055019.27778-1-quic_rbujala@quicinc.com> X-Mailer: git-send-email 2.17.1 X-QCInternal: smtphost X-QCInternal: smtphost X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=5800 signatures=585085 X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=5800 signatures=585085 X-Proofpoint-GUID: aqMZd8yxsD7PMz9MrCIK7Sc-NNH_JOSr X-Proofpoint-ORIG-GUID: aqMZd8yxsD7PMz9MrCIK7Sc-NNH_JOSr X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1039,Hydra:6.0.650,FMLib:17.11.176.26 definitions=2024-05-10_03,2024-05-10_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 mlxscore=0 mlxlogscore=811 clxscore=1011 suspectscore=0 impostorscore=0 malwarescore=0 lowpriorityscore=0 adultscore=0 bulkscore=0 phishscore=0 spamscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2405010000 definitions=main-2405100040 Precedence: bulk X-Mailing-List: selinux-refpolicy@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Resolve selinux permission for ofono: [pulseaudio] backend-ofono.c: Failed to register as a handsfree audio agent with ofono: org.freedesktop.DBus.Error.AccessDenied: An SELinux policy prevents this sender from sending this message to this recipient, 0 matched rules; type="method_call", sender=":1.14" (uid=989 pid=1937 comm="/usr/bin/pulseaudio --system --daemonize=no -v" label="system_u:system_r:pulseaudio_t:s0-s15:c0.c1023") interface="org.ofono.HandsfreeAudioManager" member="Register" error name="(unset)" requested_reply="0" destination="org.ofono" (uid=0 pid=942 comm="/usr/sbin/ofonod -n" label="system_u:system_r:initrc_t:s0-s15:c0.c1023") Resolve these AVC denials for native HSP: avc: denied { create } for pid=1271 comm="pulseaudio" scontext=system_u:system_r:pulseaudio_t:s0-s15:c0.c1023 tcontext=system_u:system_r:pulseaudio_t:s0-s15:c0.c1023 tclass=bluetooth_socket permissive=1 avc: denied { bind } for pid=1271 comm="pulseaudio" scontext=system_u:system_r:pulseaudio_t:s0-s15:c0.c1023 tcontext=system_u:system_r:pulseaudio_t:s0-s15:c0.c1023 tclass=bluetooth_socket permissive=1 avc: denied { listen } for pid=1271 comm="pulseaudio" scontext=system_u:system_r:pulseaudio_t:s0-s15:c0.c1023 tcontext=system_u:system_r:pulseaudio_t:s0-s15:c0.c1023 tclass=bluetooth_socket permissive=1 avc: denied { accept } for pid=1271 comm="pulseaudio" scontext=system_u:system_r:pulseaudio_t:s0-s15:c0.c1023 tcontext=system_u:system_r:pulseaudio_t:s0-s15:c0.c1023 tclass=bluetooth_socket permissive=1 avc: denied { getopt } for pid=1271 comm="bluetooth" scontext=system_u:system_r:pulseaudio_t:s0-s15:c0.c1023 tcontext=system_u:system_r:pulseaudio_t:s0-s15:c0.c1023 tclass=bluetooth_socket permissive=1 avc: denied { setopt } for pid=1271 comm="bluetooth" scontext=system_u:system_r:pulseaudio_t:s0-s15:c0.c1023 tcontext=system_u:system_r:pulseaudio_t:s0-s15:c0.c1023 tclass=bluetooth_socket permissive=1 avc: denied { read } for pid=1271 comm="bluetooth" scontext=system_u:system_r:pulseaudio_t:s0-s15:c0.c1023 tcontext=system_u:system_r:pulseaudio_t:s0-s15:c0.c1023 tclass=bluetooth_socket permissive=1 avc: denied { write } for pid=1271 comm="bluetooth" scontext=system_u:system_r:pulseaudio_t:s0-s15:c0.c1023 tcontext=system_u:system_r:pulseaudio_t:s0-s15:c0.c1023 tclass=bluetooth_socket permissive=1 Signed-off-by: Raghavender Reddy Bujala --- policy/modules/apps/pulseaudio.te | 4 ++++ policy/modules/services/dbus.te | 1 + policy/modules/system/init.if | 18 ++++++++++++++++++ 3 files changed, 23 insertions(+) diff --git a/policy/modules/apps/pulseaudio.te b/policy/modules/apps/pulseaudio.te index 65b9a7428..a2ff85c8a 100644 --- a/policy/modules/apps/pulseaudio.te +++ b/policy/modules/apps/pulseaudio.te @@ -318,3 +318,7 @@ optional_policy(` optional_policy(` unconfined_signull(pulseaudio_client) ') + +init_dbus_chat_script(pulseaudio_t) +init_bt_socket_manage(pulseaudio_t) +allow pulseaudio_t self:bluetooth_socket { create accept bind getopt listen read setopt write }; diff --git a/policy/modules/services/dbus.te b/policy/modules/services/dbus.te index 2d1d09d71..9e1288b77 100644 --- a/policy/modules/services/dbus.te +++ b/policy/modules/services/dbus.te @@ -391,3 +391,4 @@ optional_policy(` allow dbusd_unconfined { dbusd_session_bus_client dbusd_system_bus_client }:dbus send_msg; allow dbusd_unconfined { system_dbusd_t session_bus_type }:dbus all_dbus_perms; +init_bt_socket_manage(system_dbusd_t) diff --git a/policy/modules/system/init.if b/policy/modules/system/init.if index 4891301ad..3ae6bced3 100644 --- a/policy/modules/system/init.if +++ b/policy/modules/system/init.if @@ -3920,3 +3920,21 @@ interface(`init_search_keys',` allow $1 init_t:key search; ') + +######################################## +## +## Read, Write and manage options for bluetooth socket +## +## +## +## Domain allowed access. +## +## +# + +interface(`init_bt_socket_manage',` + gen_require(` + type initrc_t; + ') + allow $1 initrc_t:bluetooth_socket { getopt read setopt write }; +') -- 2.17.1