Received: by 2002:a05:6a10:7420:0:0:0:0 with SMTP id hk32csp829166pxb; Wed, 16 Feb 2022 05:26:28 -0800 (PST) X-Google-Smtp-Source: ABdhPJx+42I8oLE7HxR0jpzvp2kzrLVr0AqDfdrJZYF8ZGuV7twVJwG9fFK4STM5tCeYFbLOHXW4 X-Received: by 2002:a17:906:4ad6:b0:6ce:b97d:b624 with SMTP id u22-20020a1709064ad600b006ceb97db624mr2363181ejt.338.1645017988358; Wed, 16 Feb 2022 05:26:28 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1645017988; cv=none; d=google.com; s=arc-20160816; b=KeLiufmu/yJpmjq6412LaKoHVxvkuHMoxe9KbhUzSxDMlIsR+ZR757N9n/9sZ6mhl2 D3ZxMTSLvfOS2a+9CcMugHleIupKZZw6CUXRBHnJtOeDdAcGt2IpeJcv0r4UwS3zMwMq 2DWvMG26F0V3r15pDZp/BYfHD69GEajra+WrzKvDEqiXEDHzXFSwSXz4wYtrOBXNL7sb R3+VcYHukjczrhDgeY07ssWxmCye/WgulpHdD3/vx4csWT0WvHST83vj3Bwu5Dfo7xgQ M/AUlLGzVMGHqj21+OhLnsxXeTgRmDaZWkGIVpCXp/asmrr6S7PRfg3mxLJIAylg90cs lo/Q== 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=NVuICc213+wcYXmuswo/3Q54tVUxMEMo6AjFKutk1is=; b=bILcza+fNQZZwh90jC58fmJCJd8CCGbdwdg5Wsu3NclNcdOJkkSuUT/kigyYUEMk04 TpFTgbU7LrfOr2W0N8JWIjbwgHvi9rUgg3F/YepIPfhSoDnHTz3XHo/NdCqnTOMGWbBK 6hdLZkablBQWmLt7iM9/XwxB3/IPZCUH8Rn5Tx3RuOB+5/fWsPMNIpmZ1P8eGcydvOWS eZfPUwmhzxaL4mQC1bytk0S70DyKHPnSm2mMwOpYqn7qkUM/mIF/49+yEbVksDy5xwQZ CAMjJpifOujW6tZ/hbtyeUL99MCAiPlqqIjtPpPHWklbXlHB/cYJh1puHOY5kkogq7ka bQwg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@coker.com.au header.s=2008 header.b=g0JcdcsI; 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 n1si1736632edr.588.2022.02.16.05.26.22; Wed, 16 Feb 2022 05:26:28 -0800 (PST) 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=g0JcdcsI; 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 S233674AbiBPNMz (ORCPT + 22 others); Wed, 16 Feb 2022 08:12:55 -0500 Received: from mxb-00190b01.gslb.pphosted.com ([23.128.96.19]:44110 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233551AbiBPNMy (ORCPT ); Wed, 16 Feb 2022 08:12:54 -0500 Received: from smtp.sws.net.au (smtp.sws.net.au [IPv6:2a01:4f8:201:1e6::dada:cafe]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 907B42271C7 for ; Wed, 16 Feb 2022 05:12:42 -0800 (PST) Received: from xev.coker.com.au (localhost [127.0.0.1]) by smtp.sws.net.au (Postfix) with ESMTP id 7047DEF36 for ; Thu, 17 Feb 2022 00:12:40 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=coker.com.au; s=2008; t=1645017160; bh=NVuICc213+wcYXmuswo/3Q54tVUxMEMo6AjFKutk1is=; l=3031; h=Date:From:To:Subject:From; b=g0JcdcsIRNrFl5Df5d2TAkBzMGDOuSUJhjBJ6kBoVhokIdFzyK5Cd9M8Nt4b4jgSY dovAIta15VvkvNGzB4Nwqa1zmt208M8R3o6HhSQYcIVkRcVqvGRRD18Etl0SLnH1oD DyJ58joq7gdVFeGDxxEJO9bxkrdON4TyGMm2AoXY= Received: by xev.coker.com.au (Postfix, from userid 1001) id 0BB931730F59; Thu, 17 Feb 2022 00:12:36 +1100 (AEDT) Date: Thu, 17 Feb 2022 00:12:36 +1100 From: Russell Coker To: selinux-refpolicy@vger.kernel.org Subject: [PATCH] sddm role 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,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE 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 This patch adds a role for the xdm program. It's needed by sddm because it uses PAM to run it's own worker process and thus needs to do all the checks for a valid session for it's own UID. Signed-off-by: Russell Coker Index: refpolicy-2.20220216/policy/modules/services/xserver.te =================================================================== --- refpolicy-2.20220216.orig/policy/modules/services/xserver.te +++ refpolicy-2.20220216/policy/modules/services/xserver.te @@ -18,6 +18,7 @@ gen_require(` class x_resource all_x_resource_perms; class x_event all_x_event_perms; class x_synthetic_event all_x_synthetic_event_perms; + role xdm_r; ') ######################################## @@ -152,6 +153,10 @@ init_daemon_domain(xdm_t, xdm_exec_t) xserver_object_types_template(xdm) xserver_common_x_domain_template(xdm, xdm_t) +# for sddm to use pam for greeter +role xdm_r types xdm_t; +allow system_r xdm_r; + type xdm_lock_t; files_lock_file(xdm_lock_t) @@ -843,6 +848,9 @@ manage_files_pattern(xserver_t, xdm_tmp_ manage_lnk_files_pattern(xserver_t, xdm_tmp_t, xdm_tmp_t) manage_sock_files_pattern(xserver_t, xdm_tmp_t, xdm_tmp_t) +# for sddm to use pam for greeter, sddm greeter needs execmod +allow xdm_t xdm_tmpfs_t:file execmod; + # Run Xorg.wrap can_exec(xserver_t, xserver_exec_t) Index: refpolicy-2.20220216/config/appconfig-mcs/seusers =================================================================== --- refpolicy-2.20220216.orig/config/appconfig-mcs/seusers +++ refpolicy-2.20220216/config/appconfig-mcs/seusers @@ -1,2 +1,3 @@ root:unconfined_u:s0-mcs_systemhigh __default__:unconfined_u:s0-mcs_systemhigh +sddm:xdm:s0 Index: refpolicy-2.20220216/policy/users =================================================================== --- refpolicy-2.20220216.orig/policy/users +++ refpolicy-2.20220216/policy/users @@ -27,6 +27,7 @@ gen_user(system_u,, system_r, s0, s0 - m gen_user(user_u, user, user_r, s0, s0) gen_user(staff_u, staff, staff_r sysadm_r ifdef(`enable_mls',`secadm_r auditadm_r'), s0, s0 - mls_systemhigh, mcs_allcats) gen_user(sysadm_u, sysadm, sysadm_r, s0, s0 - mls_systemhigh, mcs_allcats) +gen_user(xdm, user, xdm_r, s0, s0) # Until order dependence is fixed for users: ifdef(`direct_sysadm_daemon',` Index: refpolicy-2.20220216/config/appconfig-mcs/xdm_default_contexts =================================================================== --- /dev/null +++ refpolicy-2.20220216/config/appconfig-mcs/xdm_default_contexts @@ -0,0 +1 @@ +system_r:xdm_t:s0 xdm_r:xdm_t:s0 Index: refpolicy-2.20220216/policy/modules/kernel/kernel.te =================================================================== --- refpolicy-2.20220216.orig/policy/modules/kernel/kernel.te +++ refpolicy-2.20220216/policy/modules/kernel/kernel.te @@ -32,6 +32,7 @@ role system_r; role sysadm_r; role staff_r; role user_r; +role xdm_r; # here until order dependence is fixed: role unconfined_r;