Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp4049401pxb; Sat, 13 Feb 2021 19:59:00 -0800 (PST) X-Google-Smtp-Source: ABdhPJyx4IMiAmLMZVYcBjO16IBOg/xsAVtsYiYrMdICWJ+4bFb4Fa5byqi0YWacFRsZ+aUFniwj X-Received: by 2002:a17:906:4057:: with SMTP id y23mr10024023ejj.476.1613275140244; Sat, 13 Feb 2021 19:59:00 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1613275140; cv=none; d=google.com; s=arc-20160816; b=AUUwUGE18xSac1jKorvtaZ0XLv3/JV5Gq52/i7w8AWgB4bYgPvxNaIZcaIIn9/TU8P QYDK9LHxVTI6EIdB0X2Nz4c8s8Bw+LgYggfpEtL//DY9jpUO2JSTH4HOw4RSb04RhYIk o5MRRyhhjapeR58YTa+U9ZzbBlG8mmmxToOw0PYYTLvAw4cHhYdFSm2awAhaFwM/r74M JYFhqd27IBoT6GG8rYh3suaU0B1AFDaUmidzMEfbUiOJ9b+IiwvUP5kGYsA0jEzFwD0x eyT/PhF8LC6xC5ZgZA2+qhN4aceYQGsdi47UDPQKaVg0UcmnB3NSNuiwLf1JI9QPIcNa UT/A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-disposition:mime-version:message-id :subject:to:from:date:dkim-signature; bh=yHHZlgs3qIxhMl2iDU5tzN4ld1Fae2/L+ONv2VToOAU=; b=ZugOpLfKPJWGJZthCv+t7eO6BGK6357N7KsVaehmrv3WSlTKEATYL4jRBl41OdPckt 9YE/H+J/v/FUaoqjqmd8ULXdPp0gWjXd4goW5IK186jE0kwbfP7tgJ2GZbKwrHmkYZ3G aawtKJek54PyN3BRfMeOeMbxinLKiZewfxrvOixbNrYdDLQa5PJtoct2JVgIaXu2Uj1C kEz5hL7cTsW1v0uGjmaOQCd9VBnPW4cJ2qmyS+HVp79xDWcSqd2AdNwsuUezzfAmR9Oz FCNwPbRCaoZQUj1H8gOgY/bqta432CrnrY1ko4gBuxM/ciBTDEbVleEsfaasA9DkmTOB oqSw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@coker.com.au header.s=2008 header.b=p+tnjp28; 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=REJECT sp=REJECT dis=NONE) header.from=coker.com.au Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id c8si9225248eja.735.2021.02.13.19.58.53; Sat, 13 Feb 2021 19:59:00 -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=@coker.com.au header.s=2008 header.b=p+tnjp28; 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=REJECT sp=REJECT dis=NONE) header.from=coker.com.au Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229575AbhBND6w (ORCPT + 16 others); 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 #