Received: by 2002:a05:6359:6284:b0:131:369:b2a3 with SMTP id se4csp570848rwb; Fri, 4 Aug 2023 18:42:45 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEzlg8iCNbOjaqON51iTbWH8iFhjSlK7MxYxY/qsSdjWxytfRQkN9EAw/pWYte8uFpggtK8 X-Received: by 2002:a17:90a:94c8:b0:263:ff36:3aa0 with SMTP id j8-20020a17090a94c800b00263ff363aa0mr3279203pjw.41.1691199765401; Fri, 04 Aug 2023 18:42:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1691199765; cv=none; d=google.com; s=arc-20160816; b=s4NkJLm+xZFO/PpONDe/kUo4UXMfCbsdHYf0+lj4xCnzgyUgoFuEr/mjjfcEUs1w+f LbbPsv+ebwwr7dVVLgKdJHQNZYXyZrZGJ+nYQb+fAn6p9LhgBotspcePgAaujnbiJPgK SAEFTsAqTv1XCwyBsVX4YBnikk09Ip8LK9JsCnfezD0YRWGFy6N9L6s17knJrT3LSbOI 2BwpugyLit64+fLvChTy3ilB4ouIxF2+vL2rg23gyLZVOLkQF73CSPZ4uzpQy2DTAj7M /KwKgQMxAC08s+i7z0kbKX85snihlSbQTPCjl3jaItAZpz1EIx0kkZCWGLCP9e2dE5yH H6Dg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-disposition:mime-version:message-id :subject:to:from:date:dkim-signature; bh=JMzN7fsvMln2rWF4dBA+DRSVA66cLBrcb6TYUIv3YwM=; fh=aQPIx/vTkHfX3hx56OQPPJtWhOSklM8rd4anPyOx5P8=; b=lxcB3PRjSdKrvfsLu885saMCtHck+gGP94f5z5K1XlE9gtQ4O5+g9AoNsALrN53SYO B+8XCXedEc4M8UaJlWmcVaWZoitxMzamIh0Sehvc/ESygU91zd3q72mykuB/tRETYixC KCK+MmZYcs65SNNTMV2KKKMJa1DPkq4c2MRk9mfHuxOBsBe5JPHZ8GD1vK+dGHJg0c7w 6drYloS/eUAIXa6FYQEWP0OuwD+DRcKOBJvTmWWcoj13Anus85w20xsoeQGdbLyono8U wgsO1QmAjl7cL6zNiZq6K8mNvvl7ryu76ShxxxEpLW0Wql7CER7hP+nbc19ctVAKwdy9 UuzA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@coker.com.au header.s=2008 header.b="x4slorc/"; spf=pass (google.com: domain of selinux-refpolicy-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=selinux-refpolicy-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=coker.com.au Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id on10-20020a17090b1d0a00b00269154cf655si4128834pjb.126.2023.08.04.18.42.40; Fri, 04 Aug 2023 18:42:45 -0700 (PDT) Received-SPF: pass (google.com: domain of selinux-refpolicy-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@coker.com.au header.s=2008 header.b="x4slorc/"; spf=pass (google.com: domain of selinux-refpolicy-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=selinux-refpolicy-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=coker.com.au Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229471AbjHEBcz (ORCPT + 21 others); 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 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_BLOCKED, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net 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