From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 935BD158094 for ; Sat, 3 Sep 2022 19:54:08 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 99D05E07FE; Sat, 3 Sep 2022 19:54:07 +0000 (UTC) Received: from smtp.gentoo.org (dev.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 82F76E07C9 for ; Sat, 3 Sep 2022 19:54:07 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 87DC8340F52 for ; Sat, 3 Sep 2022 19:54:06 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 22681D4 for ; Sat, 3 Sep 2022 19:54:05 +0000 (UTC) From: "Jason Zaman" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Jason Zaman" Message-ID: <1662230515.1bc42bf81c5adfdbcc4c993e4d279b8e07e81094.perfinion@gentoo> Subject: [gentoo-commits] proj/hardened-refpolicy:master commit in: policy/ X-VCS-Repository: proj/hardened-refpolicy X-VCS-Files: policy/mcs X-VCS-Directories: policy/ X-VCS-Committer: perfinion X-VCS-Committer-Name: Jason Zaman X-VCS-Revision: 1bc42bf81c5adfdbcc4c993e4d279b8e07e81094 X-VCS-Branch: master Date: Sat, 3 Sep 2022 19:54:05 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Archives-Salt: 54b9f9b6-aba7-4281-9695-ab9666f302e8 X-Archives-Hash: e2a65dbbf8c2b036d4cd5d273a547f76 commit: 1bc42bf81c5adfdbcc4c993e4d279b8e07e81094 Author: Chris PeBenito linux microsoft com> AuthorDate: Mon Jun 20 14:54:46 2022 +0000 Commit: Jason Zaman gentoo org> CommitDate: Sat Sep 3 18:41:55 2022 +0000 URL: https://gitweb.gentoo.org/proj/hardened-refpolicy.git/commit/?id=1bc42bf8 mcs: Collapse constraints. Collapse file constraints as they are equivalent due to the same expresssions. Signed-off-by: Chris PeBenito linux.microsoft.com> Signed-off-by: Jason Zaman gentoo.org> policy/mcs | 36 ++++-------------------------------- 1 file changed, 4 insertions(+), 32 deletions(-) diff --git a/policy/mcs b/policy/mcs index e8006b11..af880058 100644 --- a/policy/mcs +++ b/policy/mcs @@ -66,27 +66,14 @@ gen_levels(1,mcs_num_cats) # # Note: # - getattr on dirs/files is not constrained. -# - /proc/pid operations are not constrained. -mlsconstrain file { read ioctl lock execute execute_no_trans } +mlsconstrain dir_file_class_set { open read ioctl lock write setattr append create unlink link rename relabelfrom relabelto } (( h1 dom h2 ) or ( t1 != mcs_constrained_type )); -mlsconstrain file { write setattr append unlink link rename } +mlsconstrain file { execute execute_no_trans } (( h1 dom h2 ) or ( t1 != mcs_constrained_type )); -mlsconstrain dir { search read ioctl lock } - (( h1 dom h2 ) or ( t1 != mcs_constrained_type )); - -mlsconstrain dir { write setattr append unlink link rename add_name remove_name } - (( h1 dom h2 ) or ( t1 != mcs_constrained_type )); - -mlsconstrain fifo_file { open } - (( h1 dom h2 ) or ( t1 != mcs_constrained_type )); - -mlsconstrain { lnk_file chr_file blk_file sock_file } { getattr read ioctl } - (( h1 dom h2 ) or ( t1 != mcs_constrained_type )); - -mlsconstrain { lnk_file chr_file blk_file sock_file } { write setattr } +mlsconstrain dir { search add_name remove_name rmdir } (( h1 dom h2 ) or ( t1 != mcs_constrained_type )); # New filesystem object labels must be dominated by the relabeling subject @@ -95,23 +82,8 @@ mlsconstrain { file lnk_file fifo_file } { create relabelto } ((( h1 dom h2 ) and ( l2 eq h2 )) or ( t1 != mcs_constrained_type )); -# new file labels must be dominated by the relabeling subject clearance -mlsconstrain { dir file lnk_file chr_file blk_file sock_file fifo_file } { relabelfrom } - (( h1 dom h2 ) or ( t1 != mcs_constrained_type )); - -mlsconstrain { dir file lnk_file chr_file blk_file sock_file fifo_file } { create relabelto } - (( h1 dom h2 ) or ( t1 != mcs_constrained_type )); - -mlsconstrain process { transition dyntransition } - (( h1 dom h2 ) or ( t1 != mcs_constrained_type )); - -mlsconstrain process { ptrace } - (( h1 dom h2) or ( t1 != mcs_constrained_type )); - -mlsconstrain process { sigkill sigstop } - (( h1 dom h2 ) or ( t1 != mcs_constrained_type )); -mlsconstrain process { signal } +mlsconstrain process { transition dyntransition ptrace sigkill sigstop signal } (( h1 dom h2 ) or ( t1 != mcs_constrained_type )); mlsconstrain { tcp_socket udp_socket rawip_socket sctp_socket } node_bind