Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0496FC001DB for ; Sat, 5 Aug 2023 01:32:56 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229471AbjHEBcz (ORCPT ); Fri, 4 Aug 2023 21:32:55 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52456 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229450AbjHEBcx (ORCPT ); Fri, 4 Aug 2023 21:32:53 -0400 Received: from smtp.sws.net.au (smtp.sws.net.au [IPv6:2a01:4f8:200:641c::dada:cafe]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 64C401BE for ; Fri, 4 Aug 2023 18:32:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=coker.com.au; s=2008; t=1691199166; bh=JMzN7fsvMln2rWF4dBA+DRSVA66cLBrcb6TYUIv3YwM=; l=1924; h=Date:From:To:Subject:From; b=x4slorc/kvq33LDty+1JRLuNZbSwpKNn6MgXGBtnpICv/+U6KI2GZEF1eRmI4hcGA F+Ehvql/uuZqNWIX0VKzAVp1Kb9Y2jOQjqibxhfmfSbOmTHgktJbXKBXxl6WNhER39 zpNfhBjUwbuRoihQK7pgBS3hNEpQWmbBvKIFSD4o= Received: from xev.coker.com.au (localhost [127.0.0.1]) by smtp.sws.net.au (Postfix) with ESMTP id 6859EF571 for ; Sat, 5 Aug 2023 11:32:46 +1000 (AEST) Received: by xev.coker.com.au (Postfix, from userid 1001) id 7A39A1E9E0C8; Sat, 5 Aug 2023 11:32:41 +1000 (AEST) Date: Sat, 5 Aug 2023 11:32:41 +1000 From: Russell Coker To: selinux-refpolicy@vger.kernel.org Subject: [PATCH] Add noatsecure for $1_systemd_t executing $1_dbusd_t Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Precedence: bulk List-ID: X-Mailing-List: selinux-refpolicy@vger.kernel.org Add noatsecure for $1_systemd_t executing $1_dbusd_t because systemd sets important environment variables and dbus-broker aborts with "no media" error otherwise. Tiny patch because this was a pain to track down and is necessary to make Mobian usable. Signed-off-by: Russell Coker diff --git a/policy/modules/services/dbus.if b/policy/modules/services/dbus.if index ee497809b..741115a51 100644 --- a/policy/modules/services/dbus.if +++ b/policy/modules/services/dbus.if @@ -113,6 +113,8 @@ template(`dbus_role_template',` optional_policy(` systemd_read_logind_runtime_files($1_dbusd_t) systemd_user_daemon_domain($1, dbusd_exec_t, $1_dbusd_t) + # dbus-broker-launch fails with no media on sd_bus_open_user() without this + systemd_user_daemon_domain_noatsecure($1, $1_dbusd_t) systemd_user_unix_stream_activated_socket($1_dbusd_t, session_dbusd_runtime_t) ') ') diff --git a/policy/modules/system/systemd.if b/policy/modules/system/systemd.if index 77a59c662..0046f1722 100644 --- a/policy/modules/system/systemd.if +++ b/policy/modules/system/systemd.if @@ -229,6 +229,30 @@ template(`systemd_user_daemon_domain',` systemd_user_app_status($1, $3) ') +###################################### +## +## Allow the specified domain to not have th atsecure setting when started +## as a daemon by the specified systemd user instance +## +## +## +## Prefix for the user domain. +## +## +## +## +## Domain that is entered with noatsecure +## +## +# +template(`systemd_user_daemon_domain_noatsecure',` + gen_require(` + type $1_systemd_t; + ') + + allow $1_systemd_t $2:process noatsecure; +') + ###################################### ## ## Associate the specified file type to be a type whose sock files