From 6f3975b9b10b8a3f45624fc8e945b9638127efda Mon Sep 17 00:00:00 2001 From: Krzesimir Nowak Date: Wed, 12 Jan 2022 18:06:59 +0100 Subject: [PATCH] sec-policy/selinux-base: Add patch for ping The patch adds stuff that another patch in sec-policy/selinux-base-policy will use to allow user to call "ping -I ". Patch based on: https://github.com/fedora-selinux/selinux-policy/pull/403 --- .../selinux-base/files/icmp-bind.patch | 40 +++++++++++++++++++ .../selinux-base-2.20200818-r2.ebuild | 1 + 2 files changed, 41 insertions(+) create mode 100644 sdk_container/src/third_party/coreos-overlay/sec-policy/selinux-base/files/icmp-bind.patch diff --git a/sdk_container/src/third_party/coreos-overlay/sec-policy/selinux-base/files/icmp-bind.patch b/sdk_container/src/third_party/coreos-overlay/sec-policy/selinux-base/files/icmp-bind.patch new file mode 100644 index 0000000000..a2d653caf2 --- /dev/null +++ b/sdk_container/src/third_party/coreos-overlay/sec-policy/selinux-base/files/icmp-bind.patch @@ -0,0 +1,40 @@ +diff -u -r refpolicy/policy/modules/kernel/corenetwork.if.in refpolicy2/policy/modules/kernel/corenetwork.if.in +--- refpolicy/policy/modules/kernel/corenetwork.if.in 2022-01-12 16:59:47.572670384 -0000 ++++ refpolicy2/policy/modules/kernel/corenetwork.if.in 2022-01-12 17:01:54.974858982 -0000 +@@ -879,6 +879,24 @@ + + ######################################## + ## ++## Bind ICMP sockets to generic nodes. ++## ++## ++## ++## Domain allowed access. ++## ++## ++# ++interface(`corenet_icmp_bind_generic_node',` ++ gen_require(` ++ type node_t; ++ ') ++ ++ allow $1 node_t:icmp_socket node_bind; ++') ++ ++######################################## ++## + ## Bind TCP sockets to generic nodes. + ## + ## +diff -u -r refpolicy/policy/modules/kernel/corenetwork.te.in refpolicy2/policy/modules/kernel/corenetwork.te.in +--- refpolicy/policy/modules/kernel/corenetwork.te.in 2022-01-12 16:59:47.573670362 -0000 ++++ refpolicy2/policy/modules/kernel/corenetwork.te.in 2022-01-12 17:03:12.754142616 -0000 +@@ -373,7 +373,7 @@ + + # Bind to any network address. + allow corenet_unconfined_type port_type:{ tcp_socket udp_socket rawip_socket sctp_socket } name_bind; +-allow corenet_unconfined_type node_type:{ tcp_socket udp_socket rawip_socket sctp_socket } node_bind; ++allow corenet_unconfined_type node_type:{ icmp_socket tcp_socket udp_socket rawip_socket sctp_socket } node_bind; + + # Infiniband + corenet_ib_access_all_pkeys(corenet_unconfined_type) diff --git a/sdk_container/src/third_party/coreos-overlay/sec-policy/selinux-base/selinux-base-2.20200818-r2.ebuild b/sdk_container/src/third_party/coreos-overlay/sec-policy/selinux-base/selinux-base-2.20200818-r2.ebuild index 63859fde4d..50935ad704 100644 --- a/sdk_container/src/third_party/coreos-overlay/sec-policy/selinux-base/selinux-base-2.20200818-r2.ebuild +++ b/sdk_container/src/third_party/coreos-overlay/sec-policy/selinux-base/selinux-base-2.20200818-r2.ebuild @@ -43,6 +43,7 @@ BDEPEND="sys-devel/m4 PATCHES=( "${FILESDIR}"/0001-policy-modules-kernel-all-more-actions-for-kernel.patch "${FILESDIR}"/0001-policy-ms-MCS-restricts-relabelfrom.patch + "${FILESDIR}"/icmp-bind.patch ) S=${WORKDIR}/