Received: by 2002:a05:6a10:d5a5:0:0:0:0 with SMTP id gn37csp3142598pxb; Sat, 9 Oct 2021 02:59:38 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw/VlTGzceAOjXbOlMoCmh3wjtY6N2MV9AEtiOtJaknr9Dwssv5/dXq0j9Q32Jps5BZixgI X-Received: by 2002:a63:f817:: with SMTP id n23mr8925783pgh.250.1633773578581; Sat, 09 Oct 2021 02:59:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1633773578; cv=none; d=google.com; s=arc-20160816; b=hc9zE5oDnOFMnMhJ8Z7CVcj6tT9LxEZexYzSemDPg3B6A1slPVLmAeAgyNmXH1yk2T G5RnFCt6OCyJKyafnebhAbVYF6Rt5dj9+m9fZxXLwIrOBsso2zvmc7h6Y9JGZvvkLgb+ 3erJIF/H8EtsEXY0D+vXDH4S8UkK8akiq1jfsAJCAjqzggiETyhntgbfc3f4CNGrEU1c I7NCsIL3f8//tuBu40rnZ5kyGyV/sBk7pRlvSyGZHxpE4olre+YP0BO5UtmC4g3o4TUM LbwkvM7BixJVxosqPXxftRw2OoysXXgWwOPBYxc/wTO+eKNZHaWLsCwRLkKsCOBS/+EQ rsug== 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=Y3bvLeAA0Xy/TzqjUscCfh/aIM2n0w/CXXjGBQ1F0T4=; b=SreqJ+B6wROqZiLasPb4J+osnNzvg0wPYpJ63uzFBUpD+SNL0pRtXWDbZvfygAWV7N lzxltpo9jaqJHY1SjWtMWMdWYg2jNqXLo8K1k8GAmY0rsKhPARrcrFI9iH7TgUB+ai40 5jjqHctlfN35xcaL6sjuWDapFWt1QMLp8YnjYeIvLJ4+hwNHJCOpKqPg3UFNvgi2xIp8 q4G/RX57dOWaQPGjU2LLC7PRbYY9bUrMqSrNwmk34oI8bge4xR9B65qBfCkUW8Ft7wF3 DlPASR/HdtX02AIRVk837w8aCpqHFZCrwQziJ6DS6U0+mTdyrdwMApFv/U+jfX+MZPQd b4AQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@coker.com.au header.s=2008 header.b=FQXFygd3; spf=pass (google.com: domain of selinux-refpolicy-owner@vger.kernel.org designates 23.128.96.18 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 vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id j8si3294358plx.296.2021.10.09.02.59.31; Sat, 09 Oct 2021 02:59:38 -0700 (PDT) Received-SPF: pass (google.com: domain of selinux-refpolicy-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@coker.com.au header.s=2008 header.b=FQXFygd3; spf=pass (google.com: domain of selinux-refpolicy-owner@vger.kernel.org designates 23.128.96.18 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 S232146AbhJIKB1 (ORCPT + 21 others); Sat, 9 Oct 2021 06:01:27 -0400 Received: from smtp.sws.net.au ([144.76.241.179]:43144 "EHLO smtp.sws.net.au" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231853AbhJIKBS (ORCPT ); Sat, 9 Oct 2021 06:01:18 -0400 X-Greylist: delayed 375 seconds by postgrey-1.27 at vger.kernel.org; Sat, 09 Oct 2021 06:01:18 EDT Received: from xev.coker.com.au (localhost [127.0.0.1]) by smtp.sws.net.au (Postfix) with ESMTP id 9A084105B7 for ; Sat, 9 Oct 2021 20:53:02 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=coker.com.au; s=2008; t=1633773182; bh=Y3bvLeAA0Xy/TzqjUscCfh/aIM2n0w/CXXjGBQ1F0T4=; l=2996; h=Date:From:To:Subject:From; b=FQXFygd3IJaakWHh9hCIt5hxmqUtt+mAFmcfuMB/gtr+hIEp+3TEveI85HCJwLcbo w2htKgyl2l4ahxaDa5cVOlEUFPkJ6JNSry+labgYwBBZzvNwyCza3S9+Rh62UtMtQN pGput5JLCRHOEdx6jG2iEp2khr1QIAmdgfkvi8CU= Received: by xev.coker.com.au (Postfix, from userid 1001) id 209B315FEFB8; Sat, 9 Oct 2021 20:52:58 +1100 (AEDT) Date: Sat, 9 Oct 2021 20:52:58 +1100 From: Russell Coker To: selinux-refpolicy@vger.kernel.org Subject: [PATCH] patch for sddm with PAM 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 This patch makes the recent versions of sddm work for X logins. Sddm uses PAM to start the actual XDM under a different UID so we have to work with this. Signed-off-by: Russell Coker Index: refpolicy-2.20210908/policy/modules/services/xserver.te =================================================================== --- refpolicy-2.20210908.orig/policy/modules/services/xserver.te +++ refpolicy-2.20210908/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) @@ -848,6 +853,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.20210908/config/appconfig-mcs/seusers =================================================================== --- refpolicy-2.20210908.orig/config/appconfig-mcs/seusers +++ refpolicy-2.20210908/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.20210908/policy/users =================================================================== --- refpolicy-2.20210908.orig/policy/users +++ refpolicy-2.20210908/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.20210908/config/appconfig-mcs/xdm_default_contexts =================================================================== --- /dev/null +++ refpolicy-2.20210908/config/appconfig-mcs/xdm_default_contexts @@ -0,0 +1 @@ +system_r:xdm_t:s0 xdm_r:xdm_t:s0 Index: refpolicy-2.20210908/policy/modules/kernel/kernel.te =================================================================== --- refpolicy-2.20210908.orig/policy/modules/kernel/kernel.te +++ refpolicy-2.20210908/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;