Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp5739842pxb; Tue, 16 Feb 2021 06:33:07 -0800 (PST) X-Google-Smtp-Source: ABdhPJyasnnkKKASTMyVORnJHYa8+Bc8AQ7SeSEB3wmCxZkDwGxdXIpBR0J2x/FrKqgNZ7hKpVBd X-Received: by 2002:a17:906:c286:: with SMTP id r6mr10929114ejz.202.1613485987418; Tue, 16 Feb 2021 06:33:07 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1613485987; cv=none; d=google.com; s=arc-20160816; b=v0y8yQOEwLqW3RzBh7bkezCESkgjCB5mB6OcFP/bjgFCP0hyibVbHgcuIGls1kZDt0 nuzabtkPpTbr65MedfTBVi147WSBsw2b3tri/ijy/byp8XyB35s3ZdVujzmMabmYwv3k 3gm9NU1OXBRhpfv3JKo/fXxqVnE+3Ao/xMy+rAOnhE+Wfr2yTMEekm2VUiZgcHT/C5/c shh+YOtRzCRV8YA5qqVSYaBoPTElq9bXGbk28YCFo8UQvaQYo6HThVqtT2D4evxVT5w6 GaDxz5GZqyYYuSYXAsPAuDVoE173n2G++x1ki5Qc6YP6O+7f5+/nwofeduLyJm2DCEWJ ZkuA== 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=g05zKe+6HOcHChVe57WvcuO2Rk79rjEDF4iC0Cq9MLo=; b=t4/SfX+OxyX6pSJRKprQD58FPjCZdAYb28O8xBEFOxqFagPRLNLN52YHxnf5Vd3h4s c3p6N3SFJBJ/BDlDRaWVSXiXu6tSbrkzHAjZTMdcqkuyuHkwrAorLdPCgrVp6YVpMsrf VZRbmYCKZD4YhrC/m/JAc4rYHALiSRep+hEqUxoWZR7FkJbFr4GBe/t/qlL7F7zyfXEJ U2lStvl6U/RUYLMkPL+U4/OsE12PS+0bmqv26nkHJxdCUaGbe4ZoeVyin85ylGcTbHHL IzPIKtOwBuitMDWWlc3t2DRSMm7X7JSeE7/66jt2OY0t03i2KN3YE1m/YCZhq0Yj6SKV 8kJA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ieee.org header.s=google header.b=TtbHfeir; 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 z26si942675edi.376.2021.02.16.06.33.02; Tue, 16 Feb 2021 06:33:07 -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=TtbHfeir; 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 S230204AbhBPOcY (ORCPT + 16 others); Tue, 16 Feb 2021 09:32:24 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52114 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230184AbhBPOcW (ORCPT ); Tue, 16 Feb 2021 09:32:22 -0500 Received: from mail-qv1-xf34.google.com (mail-qv1-xf34.google.com [IPv6:2607:f8b0:4864:20::f34]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5DD10C06174A for ; Tue, 16 Feb 2021 06:30:46 -0800 (PST) Received: by mail-qv1-xf34.google.com with SMTP id g3so4729508qvl.2 for ; Tue, 16 Feb 2021 06:30:46 -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=g05zKe+6HOcHChVe57WvcuO2Rk79rjEDF4iC0Cq9MLo=; b=TtbHfeirvwd0BUA3Mg4m1Obhq/lFNW8i8JpLuWRjy+kCFFwvx8/nQw/0h3dngz/8V3 IzAf+mmPV4poQU27wXRjRE175GVkEKbajqmw39Wx5Y2RWorTPnYcI1k659FjQdcuCkHa 2RlxOCvwGBwZCpCXZFmrkVFi+IpFHrqZNQIng= 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=g05zKe+6HOcHChVe57WvcuO2Rk79rjEDF4iC0Cq9MLo=; b=qXTfaUF+plZUzXrOeOsg3KzxUvzGGPliY+avjHtdSbIRSfAFqLkbLx7g+w/766JChG ZSqBQ46fMpIoZhGLZd8aIcV0CP41iD0SBzlR1sjf05pDOQK9epAp2JCKhDHU63rhCd8D rjytg/yPc9NlBErCuNJo2b5PpqkEEz5XmtQGZUgQ1/H8DiZCVoiBw0s6X2Nx+3eezhWX BUvsGKW2ch44gYlxvOgy13Q8Z2hsO5ZfpgYFhEYtYKMXwFzLQIq67/CdEOfez9RuVv3p 7eb3uISkCnwI2QtCEPudQRBvNlclPk+JZ7ytt6X6Jpc1reHNqlVphPMLbt1oDZUO39Xa 7tPg== X-Gm-Message-State: AOAM5333w4BNoKban1GY+vyqGM2Qq5JaA1iTctDq4ehUdJCnfayaNKhl 5ZFuuRbcf1+EEoA8YC+kXZ3OAkJ7XC8CdQ== X-Received: by 2002:a0c:f6d0:: with SMTP id d16mr16444451qvo.42.1613485845343; Tue, 16 Feb 2021 06:30:45 -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 k4sm10941771qth.40.2021.02.16.06.30.44 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 16 Feb 2021 06:30:44 -0800 (PST) Subject: Re: [PATCH] blkmapd To: Russell Coker , selinux-refpolicy@vger.kernel.org References: From: Chris PeBenito Message-ID: <70306b7d-7292-0fab-fcbe-93d033493791@ieee.org> Date: Tue, 16 Feb 2021 09:30:43 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.7.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 2/13/21 10:58 PM, Russell Coker wrote: > Patch for the blkmapd daemon that's part of the NFS server. > > I think this is ready for mergikng. > > Signed-off-by: Russell Coker > > Index: refpolicy-2.20210203/policy/modules/services/rpc.fc > =================================================================== > --- refpolicy-2.20210203.orig/policy/modules/services/rpc.fc > +++ refpolicy-2.20210203/policy/modules/services/rpc.fc > @@ -16,6 +16,7 @@ > /usr/lib/systemd/system/nfs.*\.service -- gen_context(system_u:object_r:nfsd_unit_t,s0) > /usr/lib/systemd/system/rpc.*\.service -- gen_context(system_u:object_r:rpcd_unit_t,s0) > > +/usr/sbin/blkmapd -- gen_context(system_u:object_r:blkmapd_exec_t,s0) > /usr/sbin/rpc\..* -- gen_context(system_u:object_r:rpcd_exec_t,s0) > /usr/sbin/rpc\.idmapd -- gen_context(system_u:object_r:rpcd_exec_t,s0) > /usr/sbin/rpc\.gssd -- gen_context(system_u:object_r:gssd_exec_t,s0) > @@ -27,6 +28,7 @@ > > /var/lib/nfs(/.*)? gen_context(system_u:object_r:var_lib_nfs_t,s0) > > +/run/blkmapd\.pid -- gen_context(system_u:object_r:rpcd_runtime_t,s0) > /run/rpc\.statd(/.*)? gen_context(system_u:object_r:rpcd_runtime_t,s0) > /run/rpc\.statd\.pid -- gen_context(system_u:object_r:rpcd_runtime_t,s0) > /run/sm-notify\.pid -- gen_context(system_u:object_r:rpcd_runtime_t,s0) > Index: refpolicy-2.20210203/policy/modules/services/rpc.te > =================================================================== > --- refpolicy-2.20210203.orig/policy/modules/services/rpc.te > +++ refpolicy-2.20210203/policy/modules/services/rpc.te > @@ -72,6 +72,14 @@ init_unit_file(nfsd_unit_t) > type var_lib_nfs_t; > files_mountpoint(var_lib_nfs_t) > > +rpc_domain_template(blkmapd) > + > +type blkmapd_runtime_t; > +files_runtime_file(blkmapd_runtime_t) > +files_runtime_filetrans(blkmapd_t, blkmapd_runtime_t, file, "blkmapd.pid") > +allow blkmapd_t blkmapd_runtime_t:file manage_file_perms; > + > + > ######################################## > # > # Common rpc domain local policy > @@ -279,6 +287,17 @@ optional_policy(` > > ######################################## > # > +# BLKMAPD local policy > +# > + > +allow blkmapd_t self:capability sys_rawio; > +allow blkmapd_t self:unix_dgram_socket create_socket_perms; > + > +fs_list_rpc(blkmapd_t) > +storage_raw_read_fixed_disk(blkmapd_t) > + > +######################################## > +# > # GSSD local policy > # Merged. -- Chris PeBenito