Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp882300pxb; Wed, 27 Oct 2021 14:24:12 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxcDVNQuPRpHxJd5zf5j3hmEZ+sb02tQQPaIE6UastrUj2JozmBcPvkdUsIX+zW3m2sCQhc X-Received: by 2002:aa7:dcc2:: with SMTP id w2mr484551edu.192.1635369852341; Wed, 27 Oct 2021 14:24:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1635369852; cv=none; d=google.com; s=arc-20160816; b=sxm/I9bD5tOlC3r60u3QW/qIj3pi2yovTC2JGHSRfNZquUghrRsEG2NeovDwkbjme9 EKwzLjej5p7nLaiQc5zqNBTo2O7edTV8t7+/bUBh/tfskLLTxZZTF71fcplJigxgihNA 9xPio+L0khNhEY6Wlnf1TL7pLPFsuTbI0yhpSJ8fskkDvDczhQEw42BH93GWJUQTCbjs t3OAS/1v7IvdoLhFfXUbQhgPJ7vw/MfFoxVF4ojckbEAwKCtrehB6/MDx84vBBY+0Wb4 8dU8N9HnTra9Met/Tg3drho20GtE7gZrEgfUzIMaXH+cP4NHPrFiwYKzIMBzRAf/W15H UtRg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:to:content-language:subject:user-agent:mime-version:date :message-id:dkim-signature; bh=Am+9xpB0wiZcvWxZBitMReGKF4O1r9v0zCIDrBoLE8I=; b=hKdBhJlsFkx3uldF3DB4/W3Tf/2TFhM+XBpnLif7cUJpYsEuy0l9b/L1B97Kq9Z6E4 Nzf0wS2cAKaJxLu2f3GxdiLTX//VVzXCnBilnjZlMzaotMp4qB+hDat8dG18LKKN7TVZ jKVH+GLRrQSn6QJ41Ba2ZKC5tv8hdCY9GZEC1hr66Y/+D/lHeNQEkFxHg6wdKl/qMjvj kvyBFi6ZgBzcbIpemSOnbwsYWajQqKOMgkTXa+tlX9muc8ENz+5FALeC+dLxXBJmEwMZ qz0+EkqVAhhf56V1dyBrQg8Z/gVY8vbLSocmouC5O6w69ZShMxJvAtRg07LkUS1Hqmuz Rq8Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ieee.org header.s=google header.b=M3fwGPAp; 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=QUARANTINE sp=QUARANTINE dis=NONE) header.from=ieee.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id t19si1702943edd.74.2021.10.27.14.24.06; Wed, 27 Oct 2021 14:24:12 -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=@ieee.org header.s=google header.b=M3fwGPAp; 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=QUARANTINE sp=QUARANTINE dis=NONE) header.from=ieee.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237294AbhJ0NN4 (ORCPT + 20 others); Wed, 27 Oct 2021 09:13:56 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54124 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237227AbhJ0NNz (ORCPT ); Wed, 27 Oct 2021 09:13:55 -0400 Received: from mail-qt1-x82e.google.com (mail-qt1-x82e.google.com [IPv6:2607:f8b0:4864:20::82e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C1276C0613B9 for ; Wed, 27 Oct 2021 06:11:29 -0700 (PDT) Received: by mail-qt1-x82e.google.com with SMTP id h14so1563497qtb.3 for ; Wed, 27 Oct 2021 06:11:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ieee.org; s=google; h=message-id:date:mime-version:user-agent:subject:content-language:to :references:from:in-reply-to:content-transfer-encoding; bh=Am+9xpB0wiZcvWxZBitMReGKF4O1r9v0zCIDrBoLE8I=; b=M3fwGPApi4wrTasx5vDBVmX9XJOodpnpSxliGB2LKj8WAN6TlhoC/AguxmIRg+Op54 dfTGOr5mU3lH3CVZ7yOV3RuazZiSho2KtfAm1hfvrKQk7UqQU60lPOrqqm8bkoXCRta/ AbTpe+tA5mvkc1+JHxy/ykOal+UQaD4zAiyBs= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:date:mime-version:user-agent:subject :content-language:to:references:from:in-reply-to :content-transfer-encoding; bh=Am+9xpB0wiZcvWxZBitMReGKF4O1r9v0zCIDrBoLE8I=; b=JbvfIiUGOsI03CBdnB1Y1DZHvvFlvYzyo7aviYQBm3LrYR6gzRpPv0ugOcTsusqVXq g90dvwmo0jN0NtUJkRNmxLzlyw1zltZPaaWFoLSoyRmgNY4w+p9ZSl9YiuD1GJZPGhP4 dK3Bw1lpFpioShjCKR8YSKTwvLxZKxSvO9ZR2ki8YPtiXasxNKyjAxL/S9VuOhcvGmQA C8I0UJewtunHGOfWbRCMjh4Y+rXNUfyg+OwUEDPcLmEg8wvYjZjrnX2eJnLfxWCe1D4X J0i3yg0+d8FIHr6gydY6+/YaFtnVc9i2tnlOOm1CmHZcdDaHyIBhQkvk16Y/aDzJkRrx dNdw== X-Gm-Message-State: AOAM532uu2Si4qzpge9T7gs287FryHxNp9p62rGGTmWsoxXiGx11Sl+A u39eRJhvBtuGsqldzBF1ddpS9R68R8AtjT5T X-Received: by 2002:ac8:5d8c:: with SMTP id d12mr1855288qtx.184.1635340288906; Wed, 27 Oct 2021 06:11:28 -0700 (PDT) Received: from [192.168.1.126] ([72.85.44.115]) by smtp.gmail.com with ESMTPSA id q27sm11848788qki.57.2021.10.27.06.11.28 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 27 Oct 2021 06:11:28 -0700 (PDT) Message-ID: <919b8210-aa05-645f-2d01-7f83541c1b2a@ieee.org> Date: Wed, 27 Oct 2021 09:11:18 -0400 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.2.0 Subject: Re: [PATCH] patch for sddm with PAM Content-Language: en-US To: Russell Coker , selinux-refpolicy@vger.kernel.org References: From: Chris PeBenito In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: selinux-refpolicy@vger.kernel.org On 10/9/21 05:52, Russell Coker wrote: > 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; I'm confused by this. There is a login that happens prior to SDDM starting? There also is no role change allowed from xdm_r to the user role. -- Chris PeBenito