From 1816ba0e27d84da9ca85f8e647dd0019ff718b40 Mon Sep 17 00:00:00 2001 From: Dave Dykstra <2129743+DrDaveD@users.noreply.github.com> Date: Feb 18 2020 23:18:30 +0000 Subject: update to 3.5.3-1.1 --- diff --git a/4974.patch b/4974.patch deleted file mode 100644 index f0d9f89..0000000 --- a/4974.patch +++ /dev/null @@ -1,213 +0,0 @@ -From fd50472486365819fe95e164c4c67ecf0c5803b4 Mon Sep 17 00:00:00 2001 -From: Cedric Clerget -Date: Fri, 24 Jan 2020 15:52:08 +0100 -Subject: [PATCH] Fix a logic error when 'allow setuid = no' with a privileged - installation was forced root user to always fallback to user namespace. Add - CAP_SYS_ADMIN check for root user to automatically fallback to user namespace - if the capability is missing. - ---- - cmd/internal/cli/actions_linux.go | 35 +++++++++++----- - pkg/util/capabilities/process.go | 58 +++++++++++++++++++++++++++ - pkg/util/capabilities/process_test.go | 51 +++++++++++++++++++++++ - 3 files changed, 134 insertions(+), 10 deletions(-) - create mode 100644 pkg/util/capabilities/process.go - create mode 100644 pkg/util/capabilities/process_test.go - -diff --git a/cmd/internal/cli/actions_linux.go b/cmd/internal/cli/actions_linux.go -index 8cc823379e..1d68ae9876 100644 ---- a/cmd/internal/cli/actions_linux.go -+++ b/cmd/internal/cli/actions_linux.go -@@ -33,9 +33,11 @@ import ( - "github.com/sylabs/singularity/pkg/image/unpacker" - "github.com/sylabs/singularity/pkg/runtime/engine/config" - singularityConfig "github.com/sylabs/singularity/pkg/runtime/engine/singularity/config" -+ "github.com/sylabs/singularity/pkg/util/capabilities" - "github.com/sylabs/singularity/pkg/util/crypt" - "github.com/sylabs/singularity/pkg/util/gpu" - "github.com/sylabs/singularity/pkg/util/namespaces" -+ "golang.org/x/sys/unix" - ) - - // EnsureRootPriv ensures that a command is executed with root privileges. -@@ -216,23 +218,42 @@ func execStarter(cobraCmd *cobra.Command, image string, args []string, name stri - engineConfig.SetImage(abspath) - } - -+ // privileged installation by default - useSuid := true - - // singularity was compiled with '--without-suid' option - if buildcfg.SINGULARITY_SUID_INSTALL == 0 { - useSuid = false -+ -+ if !UserNamespace && uid != 0 { -+ sylog.Verbosef("Unprivileged installation: using user namespace") -+ UserNamespace = true -+ } - } - - // use non privileged starter binary: -- // - if we are the root user -- // - if we are already running inside a user namespace -+ // - if running as root -+ // - if already running inside a user namespace - // - if user namespace is requested -- // - if 'allow setuid = no' is set in singularity.conf -+ // - if running as user and 'allow setuid = no' is set in singularity.conf - if uid == 0 || insideUserNs || UserNamespace || !engineConfig.File.AllowSetuid { - useSuid = false -- if buildcfg.SINGULARITY_SUID_INSTALL == 1 && !engineConfig.File.AllowSetuid { -+ -+ // fallback to user namespace: -+ // - for non root user with setuid installation and 'allow setuid = no' -+ // - for root user without effective capability CAP_SYS_ADMIN -+ if uid != 0 && buildcfg.SINGULARITY_SUID_INSTALL == 1 && !engineConfig.File.AllowSetuid { - sylog.Verbosef("'allow setuid' set to 'no' by configuration, fallback to user namespace") - UserNamespace = true -+ } else if uid == 0 && !UserNamespace { -+ caps, err := capabilities.GetProcessEffective() -+ if err != nil { -+ sylog.Fatalf("Could not get process effective capabilities: %s", err) -+ } -+ if caps&uint64(1< - 3.5.3-1.1 +- Upgrade to upstream 3.5.3, keeping only patch #4768 on el8 + * Fri Jan 24 2020 Dave Dykstra - 3.5.2-1.2 - Add patch for PR #4974. Only the src rpm is being used, for building a --without-suid installation, so this won't be released diff --git a/sources b/sources index f3824d9..e8e7a1c 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (singularity-3.5.2.tar.gz) = 1c426839f7b45437700b08f8ed9cad5e920b2f77d215e3d865dfea7498d785b12351d3b34ea0f53335c5bd465c2cf2dfd417784900765241c58feae1960735a1 +SHA512 (singularity-3.5.3.tar.gz) = b8bb44539e78eaf74c1b97e5bae8fae1f390412456d76b573fffe2a90240b182db1aec60aee80715547c3edfbaa0607506e2727a575bc951223f9a7c3be0a97e