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=-15.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED 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 9AAE1C433E0 for ; Sun, 14 Feb 2021 03:59:08 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 5824E64DA1 for ; Sun, 14 Feb 2021 03:59:08 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229575AbhBND6w (ORCPT ); Sat, 13 Feb 2021 22:58:52 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36914 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229485AbhBND6w (ORCPT ); Sat, 13 Feb 2021 22:58:52 -0500 Received: from smtp.sws.net.au (smtp.sws.net.au [IPv6:2a01:4f8:140:71f5::dada:cafe]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F0751C061574 for ; Sat, 13 Feb 2021 19:58:10 -0800 (PST) Received: from xev.coker.com.au (localhost [127.0.0.1]) by smtp.sws.net.au (Postfix) with ESMTP id DB5BFF2C5 for ; Sun, 14 Feb 2021 14:58:06 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=coker.com.au; s=2008; t=1613275087; bh=yHHZlgs3qIxhMl2iDU5tzN4ld1Fae2/L+ONv2VToOAU=; l=2329; h=Date:From:To:Subject:From; b=p+tnjp28zX/YJwRIlokzMXo9fkGM7eZscODC39rFtQpQGmzPg20CyJ08qW4C5sQhA H21ZilKRnoxtgRwjA9ME8SRBAQgZ+W8oqvzaOaNP38xQ/UDzymNQvbffgEyx3H6cxV J1MncCBa+bBdk6PqenDfkHG3BtFGpsR/KxakfDcQ= Received: by xev.coker.com.au (Postfix, from userid 1001) id B40CF1373F7A; Sun, 14 Feb 2021 14:58:00 +1100 (AEDT) Date: Sun, 14 Feb 2021 14:58:00 +1100 From: Russell Coker To: selinux-refpolicy@vger.kernel.org Subject: [PATCH] blkmapd 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 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 #