Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp3094770pxb; Mon, 25 Jan 2021 06:52:51 -0800 (PST) X-Google-Smtp-Source: ABdhPJw9OvuiqL+HFjrMB4bBUUdHcfuH7q+agGy0U7Y0b4GmxW2PZiLup8WUlDv2FG2b9Hpv5dBv X-Received: by 2002:a17:907:9622:: with SMTP id gb34mr615451ejc.30.1611586371286; Mon, 25 Jan 2021 06:52:51 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1611586371; cv=none; d=google.com; s=arc-20160816; b=s3Y7eiGKpE0ZmXNNquF/8mRFoZATraRKpTt0wVEzYMrjROSwDq+TBqTg+4a1yAIqE9 mMDVhZTAU8bVfusZpW5a2iYy9ZcjrbArJ132vUceoPre7Tc+cLiBvvfTenXD3Z+ae8rH GV3y2k5JWKljWY/YbVrceu40YkGydM/zEKL5ouSpwZ5jxAL9lX78DRClfJWyhzJifcFT k6AHUhftgxY64PHRovRuw/suhCgHF5MauAXrWCY58mIDTNNoJaEc+bO6EwRS0osulAoj vOg4JAdwPp87rJtgRIfo8GhQtyZoFoxSaG/OmX2mQPXhuxLsuaa1XZMi4XFrjBNFHvI4 vopw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :to:subject:dkim-signature; bh=yvnBtPql+sEzn7Q6ljqCICm+MnsTj0KL0z89xphCANQ=; b=ccDLpnPnEF5b143L6M99VTsVJkKA5QmVzDPeHCpa9njzniIJm+5pNbptiROczqWtST Gkm32xBqIHotYImRwp044v2gFaKAtGEAIfjmK2alguYnkNrYu7Pl05ABtn6ezjPpY5UJ FsjxtK0AbKOlp0Q6vU9Ys1JbnffUTPjJDL3wgAtcUrs54HXdRCXoHCKzksxpZb7dEO+r YTujXhmw7gqFGA8MyM9cRKKCP0btvnA60sgRfnKn+9Ulyvw01pTLNbURsVbUdIad1bYH wYBgnpgc6OjG7U4aCEE/wFh6X7si4cTUCHEbEnlWJMT3mOF7/ywDF+to4s2mcNDgIOK+ NZUA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ieee.org header.s=google header.b="V/aPHK0j"; 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=NONE sp=NONE 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 d24si6044948ejc.491.2021.01.25.06.52.44; Mon, 25 Jan 2021 06:52:51 -0800 (PST) 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="V/aPHK0j"; 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=NONE sp=NONE dis=NONE) header.from=ieee.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729734AbhAYOsu (ORCPT + 16 others); Mon, 25 Jan 2021 09:48:50 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48694 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729779AbhAYOsj (ORCPT ); Mon, 25 Jan 2021 09:48:39 -0500 Received: from mail-qv1-xf35.google.com (mail-qv1-xf35.google.com [IPv6:2607:f8b0:4864:20::f35]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0FE4CC061574 for ; Mon, 25 Jan 2021 06:47:04 -0800 (PST) Received: by mail-qv1-xf35.google.com with SMTP id s6so6247227qvn.6 for ; Mon, 25 Jan 2021 06:47:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ieee.org; s=google; h=subject:to:references:from:message-id:date:user-agent:mime-version :in-reply-to:content-language:content-transfer-encoding; bh=yvnBtPql+sEzn7Q6ljqCICm+MnsTj0KL0z89xphCANQ=; b=V/aPHK0jbYHE7FQZ/Wo5qTMCUFrieEdVB5b1PTPKAhf+mYcujDW+rTdeR0QPLeAiTA AN8hpYpwS7Hc68NCt5TVmTka388a7xW4wOMw1e2TlNt0eOLeCj7K2J7c5Qc/H/dIg6OZ e1V3qyiTh/W+GX7FjWjSuuVfWzqSI1FSJu20o= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=yvnBtPql+sEzn7Q6ljqCICm+MnsTj0KL0z89xphCANQ=; b=YAocnS8rB1SSKtaN6+Dcsgop65wFnhNN0FS56D2lg3napcc2oTNjJrgnSTelgNWxDN Cq94Wg/Czpo8q+tIW/fnCKaWQnMpd+xTl0ceHJoEslCKRQJG2RGmzxErV4luzBi40t5K F6YimmcN8WJp9TgPHNFPBZQPk4ECxejUJTBEApEUJ0e3zZhJnXUjkEtb8XlgxdptAWpG S4nR/xt1pvG3OypTqgGCsAT8rsHqMdceDQ4T0zJSevxNlLuj8q9j/k+RUeN+4pQrCHvI pcMSUzMu6kKxsPbg03kCQQox8zFRX5kJ2YPUWfhuc09QpKJMOWYJceL6WMe9uBOAnyYe bbPA== X-Gm-Message-State: AOAM530E+kZzjdRcp+077Hlw3jqAQBzF4XqrILN9CcoL8jMMETtpk1Hl w+eWbs9AZ63NjXNTJGEetjrRoaxHz8x+Lw== X-Received: by 2002:a0c:f1ce:: with SMTP id u14mr1058029qvl.24.1611586021853; Mon, 25 Jan 2021 06:47:01 -0800 (PST) Received: from fedora.pebenito.net (pool-96-234-173-17.bltmmd.fios.verizon.net. [96.234.173.17]) by smtp.gmail.com with ESMTPSA id o45sm8949960qto.91.2021.01.25.06.47.00 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 25 Jan 2021 06:47:00 -0800 (PST) Subject: Re: [PATCH] latest memlockd patch To: Russell Coker , selinux-refpolicy@vger.kernel.org References: From: Chris PeBenito Message-ID: Date: Mon, 25 Jan 2021 09:46:59 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.6.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: selinux-refpolicy@vger.kernel.org On 1/20/21 5:17 AM, Russell Coker wrote: > Includes the ifndef(`distro_debian' section that was requested. Should be > ready for merging now. > > Signed-off-by: Russell Coker > > Index: refpolicy-2.20201205/policy/modules/services/memlockd.fc > =================================================================== > --- /dev/null > +++ refpolicy-2.20201205/policy/modules/services/memlockd.fc > @@ -0,0 +1 @@ > +/usr/sbin/memlockd -- gen_context(system_u:object_r:memlockd_exec_t,s0) > Index: refpolicy-2.20201205/policy/modules/services/memlockd.if > =================================================================== > --- /dev/null > +++ refpolicy-2.20201205/policy/modules/services/memlockd.if > @@ -0,0 +1,2 @@ > +## memory lock daemon, keeps important files in RAM. > + > Index: refpolicy-2.20201205/policy/modules/services/memlockd.te > =================================================================== > --- /dev/null > +++ refpolicy-2.20201205/policy/modules/services/memlockd.te > @@ -0,0 +1,39 @@ > +policy_module(memlockd, 1.0.0) > + > +######################################## > +# > +# Declarations > +# > + > +type memlockd_t; > +type memlockd_exec_t; > +init_daemon_domain(memlockd_t, memlockd_exec_t) > + > +######################################## > +# > +# Local policy > +# > + > +allow memlockd_t self:capability { setgid setuid ipc_lock }; > +ifndef(`distro_debian', ` > +allow memlockd_t self:capability dac_read_search; > +') > +allow memlockd_t self:fifo_file rw_file_perms; > + > +# cache /etc/shadow too > +auth_read_shadow(memlockd_t) > +auth_map_shadow(memlockd_t) > + > +corecmd_exec_all_executables(memlockd_t) > +corecmd_exec_bin(memlockd_t) > +corecmd_exec_shell(memlockd_t) > +corecmd_read_all_executables(memlockd_t) > +corecmd_search_bin(memlockd_t) > +files_read_etc_files(memlockd_t) > +libs_exec_ld_so(memlockd_t) > +files_map_etc_files(memlockd_t) > + > +logging_send_syslog_msg(memlockd_t) > +miscfiles_read_localization(memlockd_t) > + > +sysnet_mmap_read_config(memlockd_t) > Index: refpolicy-2.20201205/policy/modules/system/sysnetwork.if > =================================================================== > --- refpolicy-2.20201205.orig/policy/modules/system/sysnetwork.if > +++ refpolicy-2.20201205/policy/modules/system/sysnetwork.if > @@ -393,6 +393,31 @@ interface(`sysnet_mmap_config_files',` > > ####################################### > ## > +## map network config files. > +## > +## > +##

> +## Allow the specified domain to mmap the > +## general network configuration files. > +##

> +##
> +## > +## > +## Domain allowed access. > +## > +## > +# > +interface(`sysnet_mmap_read_config',` > + gen_require(` > + type net_conf_t; > + ') > + > + files_search_etc($1) > + allow $1 net_conf_t:file mmap_read_file_perms; > +') > + > +####################################### > +## > ## Do not audit attempts to read network config files. > ## > ## > Index: refpolicy-2.20201205/policy/modules/system/authlogin.if > =================================================================== > --- refpolicy-2.20201205.orig/policy/modules/system/authlogin.if > +++ refpolicy-2.20201205/policy/modules/system/authlogin.if > @@ -577,6 +577,23 @@ interface(`auth_read_shadow',` > > ######################################## > ## > +## Map the shadow passwords file (/etc/shadow) > +## > +## > +## > +## Domain allowed access. > +## > +## > +# > +interface(`auth_map_shadow',` > + gen_require(` > + type shadow_t; > + ') > + allow $1 shadow_t:file map; > +') > + > +######################################## > +## > ## Pass shadow assertion for reading. > ## > ## Merged. -- Chris PeBenito