From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-17.3 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI,NICE_REPLY_A, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 62B78C433E0 for ; Tue, 16 Feb 2021 14:32:41 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 348CD64DF5 for ; Tue, 16 Feb 2021 14:32:41 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230204AbhBPOcY (ORCPT ); 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-Google-Smtp-Source: ABdhPJy63YIQ+MXjh6kbtUvUOodmr0+mrt/G9b8LFSBYT8hrnWf8vMznmdRcsHsVWevyX7YEY7DEGA== 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