Distributed Replicated Block Device (DRBD) development
 help / color / mirror / Atom feed
* [Drbd-dev] [PATCH] containers: add commands to correct SELinux context
@ 2023-05-25 14:49 Andrei Kvapil
  2023-05-26  7:08 ` Roland Kammerer
  0 siblings, 1 reply; 2+ messages in thread
From: Andrei Kvapil @ 2023-05-25 14:49 UTC (permalink / raw)
  To: drbd-dev; +Cc: Vasily Oleynikov

When running the entry.sh script with RAM-based module loading method, the
generated modules acquire the 'var_lib_t' context by default on certain systems.

This patch adds commands to correct the context to 'modules_object_t'
to allow seamless module loading on SELinux-enabled systems.

Co-developed-by: Vasily Oleynikov <vasily.oleynikov@flant.com>
---
 docker/entry.sh | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/docker/entry.sh b/docker/entry.sh
index 2c91734e6..978df6431 100644
--- a/docker/entry.sh
+++ b/docker/entry.sh
@@ -217,6 +217,10 @@ load_from_ram() {
 		find . -name "*.ko" -print0 | xargs -0 -n1 "/lib/modules/$(uname -r)/build/scripts/sign-file" "$CONFIG_MODULE_SIG_HASH" "${LB_SIGN}/signing_key.pem" "${LB_SIGN}/signing_key.x509" 
 	fi
 
+ 	chcon -t modules_object_t ./drbd.ko || true
+ 	chcon -t modules_object_t ./drbd_transport_tcp.ko || true
+ 	chcon -t modules_object_t ./drbd_transport_rdma.ko || true
+
 	insmod ./drbd.ko usermode_helper=disabled
 	insmod ./drbd_transport_tcp.ko
 	insmod ./drbd_transport_rdma.ko 2>/dev/null || true
-- 
2.32.0 (Apple Git-132)


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [Drbd-dev] [PATCH] containers: add commands to correct SELinux context
  2023-05-25 14:49 [Drbd-dev] [PATCH] containers: add commands to correct SELinux context Andrei Kvapil
@ 2023-05-26  7:08 ` Roland Kammerer
  0 siblings, 0 replies; 2+ messages in thread
From: Roland Kammerer @ 2023-05-26  7:08 UTC (permalink / raw)
  To: drbd-dev

On Thu, May 25, 2023 at 04:49:15PM +0200, Andrei Kvapil wrote:
> When running the entry.sh script with RAM-based module loading method, the
> generated modules acquire the 'var_lib_t' context by default on certain systems.
> 
> This patch adds commands to correct the context to 'modules_object_t'
> to allow seamless module loading on SELinux-enabled systems.
> 
> Co-developed-by: Vasily Oleynikov <vasily.oleynikov@flant.com>
> ---
>  docker/entry.sh | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/docker/entry.sh b/docker/entry.sh
> index 2c91734e6..978df6431 100644
> --- a/docker/entry.sh
> +++ b/docker/entry.sh
> @@ -217,6 +217,10 @@ load_from_ram() {
>  		find . -name "*.ko" -print0 | xargs -0 -n1 "/lib/modules/$(uname -r)/build/scripts/sign-file" "$CONFIG_MODULE_SIG_HASH" "${LB_SIGN}/signing_key.pem" "${LB_SIGN}/signing_key.x509" 
>  	fi
>  
> + 	chcon -t modules_object_t ./drbd.ko || true
> + 	chcon -t modules_object_t ./drbd_transport_tcp.ko || true
> + 	chcon -t modules_object_t ./drbd_transport_rdma.ko || true
> +
>  	insmod ./drbd.ko usermode_helper=disabled
>  	insmod ./drbd_transport_tcp.ko
>  	insmod ./drbd_transport_rdma.ko 2>/dev/null || true
> -- 
> 2.32.0 (Apple Git-132)

Thanks, I will queue that up for out of tree DRBD9.

Regards, rck

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2023-05-26  7:08 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-05-25 14:49 [Drbd-dev] [PATCH] containers: add commands to correct SELinux context Andrei Kvapil
2023-05-26  7:08 ` Roland Kammerer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox