unofficial mirror of libc-alpha@sourceware.org
 help / color / mirror / Atom feed
* [PATCH v4] rtld: Add --no-default-paths option
@ 2021-07-06 10:21 Fergus Dall via Libc-alpha
  2021-07-06 10:21 ` [PATCH v4 1/2] " Fergus Dall via Libc-alpha
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Fergus Dall via Libc-alpha @ 2021-07-06 10:21 UTC (permalink / raw)
  To: libc-alpha; +Cc: fweimer, chromeos-toolchain, clumptini, joseph

Changes from previous patchset:
 - Incorporated vapier's suggestions.
 - Initialized the path buffers in the tests, as strcat-ing into an
   uninitialized buffer is undefined behavior.
 - Stop adding support_install_prefix in tst-no-default-paths-dlopen
   when constructing the path to the system lib directory. This
   happened to work because I tested with prefix=/, but is in general
   unnecessary and incorrect.



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

* [PATCH v4 1/2] rtld: Add --no-default-paths option
  2021-07-06 10:21 [PATCH v4] rtld: Add --no-default-paths option Fergus Dall via Libc-alpha
@ 2021-07-06 10:21 ` Fergus Dall via Libc-alpha
  2021-07-06 10:21 ` [PATCH v4 2/2] rtld: Add tests for new " Fergus Dall via Libc-alpha
  2021-07-19  8:34 ` [PATCH v4] rtld: Add " Fergus Dall via Libc-alpha
  2 siblings, 0 replies; 7+ messages in thread
From: Fergus Dall via Libc-alpha @ 2021-07-06 10:21 UTC (permalink / raw)
  To: libc-alpha; +Cc: fweimer, chromeos-toolchain, clumptini, Fergus Dall, joseph

This option causes the default library search path to be skipped,
using only the paths in DT_RPATH, LD_LIBRARY_PATH, and
DT_RUNPATH. This option implies --inhibit-cache, as there is no point
in searching a cache of system libraries when we are not using the
system libraries at all.

This is necessary to preserve negative search results when isolating
applications from the system libraries. This can be important when an
application uses dlopen at run time to load optional libraries.

When a shared library is required by the application, it can be
isolated by putting appropriate versions of the libraries in
directories specified in LD_LIBRARY_PATH, because the library search
will always terminate before potentially loading any system libraries.

On the other hand, if the application should be run without an
optional library, the search will proceed past the LD_LIBRARY_PATH
directories into the default system libraries, potentially causing an
incorrect library to be linked.
---
 NEWS                       |  4 ++++
 elf/dl-load.c              |  6 ++++--
 elf/dl-support.c           |  2 ++
 elf/dl-usage.c             |  2 ++
 elf/rtld.c                 | 10 ++++++++++
 sysdeps/generic/ldsodefs.h |  3 +++
 6 files changed, 25 insertions(+), 2 deletions(-)

diff --git a/NEWS b/NEWS
index 8e72946c3f..790034d837 100644
--- a/NEWS
+++ b/NEWS
@@ -60,6 +60,10 @@ Major new features:
   to call async-signal-safe functions (such as raise or execve).  This function
   is currently a GNU extension.
 
+* The dynamic linker has gained the --no-default-paths option, which
+  causes it to ignore libraries in the default (compiled in) system
+  paths even if all higher precedence locations have been searched.
+
 Deprecated and removed features, and other changes affecting compatibility:
 
 * The function pthread_mutex_consistent_np has been deprecated; programs
diff --git a/elf/dl-load.c b/elf/dl-load.c
index a08df001af..0a14cbb87c 100644
--- a/elf/dl-load.c
+++ b/elf/dl-load.c
@@ -2258,7 +2258,8 @@ _dl_map_object (struct link_map *loader, const char *name,
       if (fd == -1
 	  && ((l = loader ?: GL(dl_ns)[nsid]._ns_loaded) == NULL
 	      || __glibc_likely (!(l->l_flags_1 & DF_1_NODEFLIB)))
-	  && __rtld_search_dirs.dirs != (void *) -1)
+	  && __rtld_search_dirs.dirs != (void *) -1
+	  && __glibc_likely (GLRO(dl_search_default_paths)))
 	fd = open_path (name, namelen, mode, &__rtld_search_dirs,
 			&realname, &fb, l, LA_SER_DEFAULT, &found_other_class);
 
@@ -2438,7 +2439,8 @@ _dl_rtld_di_serinfo (struct link_map *loader, Dl_serinfo *si, bool counting)
      a way to indicate that in the results for Dl_serinfo.  */
 
   /* Finally, try the default path.  */
-  if (!(loader->l_flags_1 & DF_1_NODEFLIB))
+  if (!(loader->l_flags_1 & DF_1_NODEFLIB)
+      && __glibc_likely (GLRO(dl_search_default_paths)))
     add_path (&p, &__rtld_search_dirs, XXX_default);
 
   if (counting)
diff --git a/elf/dl-support.c b/elf/dl-support.c
index dfc9ab760e..def75550aa 100644
--- a/elf/dl-support.c
+++ b/elf/dl-support.c
@@ -144,6 +144,8 @@ size_t _dl_minsigstacksize = CONSTANT_MINSIGSTKSZ;
 
 int _dl_inhibit_cache;
 
+int _dl_search_default_paths;
+
 unsigned int _dl_osversion;
 
 /* All known directories in sorted order.  */
diff --git a/elf/dl-usage.c b/elf/dl-usage.c
index 5ad3a72559..b5ae44932a 100644
--- a/elf/dl-usage.c
+++ b/elf/dl-usage.c
@@ -247,6 +247,8 @@ setting environment variables (which would be inherited by subprocesses).\n\
   --inhibit-cache       Do not use " LD_SO_CACHE "\n\
   --library-path PATH   use given PATH instead of content of the environment\n\
                         variable LD_LIBRARY_PATH\n\
+  --no-default-paths    do not use the default library search path\n\
+                        (this option implies --inhibit-cache)\n\
   --glibc-hwcaps-prepend LIST\n\
                         search glibc-hwcaps subdirectories in LIST\n\
   --glibc-hwcaps-mask LIST\n\
diff --git a/elf/rtld.c b/elf/rtld.c
index fbbd60b446..8eb76b8998 100644
--- a/elf/rtld.c
+++ b/elf/rtld.c
@@ -360,6 +360,7 @@ struct rtld_global_ro _rtld_global_ro attribute_relro =
     ._dl_fpu_control = _FPU_DEFAULT,
     ._dl_pagesize = EXEC_PAGESIZE,
     ._dl_inhibit_cache = 0,
+    ._dl_search_default_paths = 1,
 
     /* Function pointers.  */
     ._dl_debug_printf = _dl_debug_printf,
@@ -1204,6 +1205,15 @@ dl_main (const ElfW(Phdr) *phdr,
 	    _dl_argc -= 2;
 	    _dl_argv += 2;
 	  }
+	else if (! strcmp (_dl_argv[1], "--no-default-paths"))
+	  {
+	    GLRO(dl_search_default_paths) = 0;
+	    GLRO(dl_inhibit_cache) = 1;
+
+	    ++_dl_skip_args;
+	    --_dl_argc;
+	    ++_dl_argv;
+	  }
 	else if (! strcmp (_dl_argv[1], "--inhibit-rpath")
 		 && _dl_argc > 2)
 	  {
diff --git a/sysdeps/generic/ldsodefs.h b/sysdeps/generic/ldsodefs.h
index 176394de4d..d7c9b9e477 100644
--- a/sysdeps/generic/ldsodefs.h
+++ b/sysdeps/generic/ldsodefs.h
@@ -551,6 +551,9 @@ struct rtld_global_ro
   /* Do we read from ld.so.cache?  */
   EXTERN int _dl_inhibit_cache;
 
+  /* Do we search the default system paths?  */
+  EXTERN int _dl_search_default_paths;
+
   /* Copy of the content of `_dl_main_searchlist' at startup time.  */
   EXTERN struct r_scope_elem _dl_initial_searchlist;
 
-- 
2.32.0.93.g670b81a890-goog


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

* [PATCH v4 2/2] rtld: Add tests for new --no-default-paths option
  2021-07-06 10:21 [PATCH v4] rtld: Add --no-default-paths option Fergus Dall via Libc-alpha
  2021-07-06 10:21 ` [PATCH v4 1/2] " Fergus Dall via Libc-alpha
@ 2021-07-06 10:21 ` Fergus Dall via Libc-alpha
  2021-07-19  8:34 ` [PATCH v4] rtld: Add " Fergus Dall via Libc-alpha
  2 siblings, 0 replies; 7+ messages in thread
From: Fergus Dall via Libc-alpha @ 2021-07-06 10:21 UTC (permalink / raw)
  To: libc-alpha; +Cc: fweimer, chromeos-toolchain, clumptini, Fergus Dall, joseph

---
 elf/Makefile                      | 15 ++++-
 elf/tst-no-default-paths-dlinfo.c | 96 ++++++++++++++++++++++++++++++
 elf/tst-no-default-paths-dlopen.c | 97 +++++++++++++++++++++++++++++++
 elf/tst-no-default-paths-helper.c | 69 ++++++++++++++++++++++
 support/Makefile                  |  1 +
 support/support.h                 |  4 ++
 support/support_paths.c           |  6 ++
 7 files changed, 285 insertions(+), 3 deletions(-)
 create mode 100644 elf/tst-no-default-paths-dlinfo.c
 create mode 100644 elf/tst-no-default-paths-dlopen.c
 create mode 100644 elf/tst-no-default-paths-helper.c

diff --git a/elf/Makefile b/elf/Makefile
index 698a6ab985..267e920561 100644
--- a/elf/Makefile
+++ b/elf/Makefile
@@ -224,7 +224,7 @@ tests += restest1 preloadtest loadfail multiload origtest resolvfail \
 	 tst-tls-ie tst-tls-ie-dlmopen argv0test \
 	 tst-glibc-hwcaps tst-glibc-hwcaps-prepend tst-glibc-hwcaps-mask \
 	 tst-tls20 tst-tls21 tst-dlmopen-dlerror tst-dlmopen-gethostbyname \
-	 tst-dl-is_dso
+	 tst-dl-is_dso tst-no-default-paths-helper
 #	 reldep9
 tests-internal += loadtest unload unload2 circleload1 \
 	 neededtest neededtest2 neededtest3 neededtest4 \
@@ -232,7 +232,8 @@ tests-internal += loadtest unload unload2 circleload1 \
 	 tst-ptrguard1 tst-stackguard1 tst-libc_dlvsym \
 	 tst-create_format1 tst-tls-surplus tst-dl-hwcaps_split
 tests-container += tst-pldd tst-dlopen-tlsmodid-container \
-  tst-dlopen-self-container tst-preload-pthread-libc
+  tst-dlopen-self-container tst-preload-pthread-libc \
+  tst-no-default-paths-dlopen tst-no-default-paths-dlinfo
 test-srcs = tst-pathopt
 selinux-enabled := $(shell cat /selinux/enforce 2> /dev/null)
 ifneq ($(selinux-enabled),1)
@@ -442,7 +443,8 @@ ifeq (yes,$(build-shared))
 ifeq ($(run-built-tests),yes)
 tests-special += $(objpfx)tst-pathopt.out $(objpfx)tst-rtld-load-self.out \
 		 $(objpfx)tst-rtld-preload.out $(objpfx)argv0test.out \
-		 $(objpfx)tst-rtld-help.out
+		 $(objpfx)tst-rtld-help.out \
+		 $(objpfx)tst-no-default-paths-helper.out
 endif
 tests-special += $(objpfx)check-textrel.out $(objpfx)check-execstack.out \
 		 $(objpfx)check-wx-segment.out \
@@ -1295,6 +1297,13 @@ tst-tst-dlopen-self-no-pie = yes
 CFLAGS-tst-dlopen-self-pie.c += $(pie-ccflag)
 LDFLAGS-tst-dlopen-self-container += -Wl,-rpath,\$$ORIGIN
 
+$(objpfx)tst-no-default-paths-dlopen.out: $(objpfx)tst-no-default-paths-helper
+$(objpfx)tst-no-default-paths-dlinfo.out: $(objpfx)tst-no-default-paths-helper
+$(objpfx)tst-no-default-paths-helper.out:
+	touch $@
+	$(evaluate-test)
+$(objpfx)tst-no-default-paths-helper: $(libdl) $(objpfx)tst-no-default-paths-helper.o
+
 CFLAGS-ifuncmain1pic.c += $(pic-ccflag)
 CFLAGS-ifuncmain1picstatic.c += $(pic-ccflag)
 CFLAGS-ifuncmain1staticpic.c += $(pic-ccflag)
diff --git a/elf/tst-no-default-paths-dlinfo.c b/elf/tst-no-default-paths-dlinfo.c
new file mode 100644
index 0000000000..b9f534f14d
--- /dev/null
+++ b/elf/tst-no-default-paths-dlinfo.c
@@ -0,0 +1,96 @@
+/* Test that dlinfo respects --no-default-paths
+   Copyright (C) 2021 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, see
+   <https://www.gnu.org/licenses/>.  */
+
+#include <gnu/lib-names.h>
+#include <string.h>
+#include <sys/wait.h>
+#include <support/support.h>
+#include <support/subprocess.h>
+#include <support/xunistd.h>
+
+const char libs_dir[] = "/tmp/tst-no-default-paths-dlinfo";
+const char elf_dir[] = "/elf";
+const char marker_lib[] = "/libmarkermod1.so";
+const char libc[] = "/" LIBC_SO;
+const char libdl[] = "/" LIBDL_SO;
+const char helper_program[] = "/tst-no-default-paths-helper";
+
+// Link system lib into libs_dir so the child process can access it
+static void
+link_system_lib_to_dir (const char *system_lib)
+{
+  char lib_src[4096] = {};
+  strcpy (lib_src, support_slibdir_prefix);
+  strcat (lib_src, system_lib);
+
+  char lib_dest[4096] = {};
+  strcpy (lib_dest, libs_dir);
+  strcat (lib_dest, system_lib);
+
+  unlink (lib_dest);
+  xsymlink (lib_src, lib_dest);
+}
+
+// Link libmarker into libs_dir also
+static void
+link_libmarker (void)
+{
+  char marker_src[4096] = {};
+  strcpy (marker_src, support_objdir_root);
+  strcat (marker_src, elf_dir);
+  strcat (marker_src, marker_lib);
+
+  char marker_dest[4096] = {};
+  strcpy (marker_dest, libs_dir);
+  strcat (marker_dest, marker_lib);
+
+  unlink (marker_dest);
+  xsymlink (marker_src, marker_dest);
+}
+
+static int
+do_test (void)
+{
+  xmkdirp (libs_dir, 0755);
+
+  link_system_lib_to_dir (libc);
+  link_system_lib_to_dir (libdl);
+  link_libmarker ();
+
+  char helper_path[4096] = {};
+  strcpy (helper_path, support_objdir_root);
+  strcat (helper_path, elf_dir);
+  strcat (helper_path, helper_program);
+
+  char *const argv[] =
+      {
+        strdup (support_container_elf_ldso_path),
+        strdup ("--no-default-paths"),
+        strdup ("--library-path"),
+        strdup (libs_dir),
+        helper_path,
+        strdup ("dlinfo"),
+        NULL
+      };
+
+  int ret = support_subprogram_wait (argv[0], argv);
+
+  return WEXITSTATUS (ret);
+}
+
+#include <support/test-driver.c>
diff --git a/elf/tst-no-default-paths-dlopen.c b/elf/tst-no-default-paths-dlopen.c
new file mode 100644
index 0000000000..c74beaa970
--- /dev/null
+++ b/elf/tst-no-default-paths-dlopen.c
@@ -0,0 +1,97 @@
+/* Test that --no-default-paths doesn't search system dirs
+   Copyright (C) 2021 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, see
+   <https://www.gnu.org/licenses/>.  */
+
+#include <gnu/lib-names.h>
+#include <string.h>
+#include <sys/wait.h>
+#include <support/support.h>
+#include <support/subprocess.h>
+#include <support/xunistd.h>
+
+const char libs_dir[] = "/tmp/tst-no-default-paths-dlopen";
+const char elf_dir[] = "/elf";
+const char marker_lib[] = "/libmarkermod1.so";
+const char libc[] = "/" LIBC_SO;
+const char libdl[] = "/" LIBDL_SO;
+const char helper_program[] = "/tst-no-default-paths-helper";
+
+// Link system lib into libs_dir so the child process can access it
+static void
+link_system_lib_to_dir (const char *system_lib)
+{
+  char lib_src[4096] = {};
+  strcpy (lib_src, support_slibdir_prefix);
+  strcat (lib_src, system_lib);
+
+  char lib_dest[4096] = {};
+  strcpy (lib_dest, libs_dir);
+  strcat (lib_dest, system_lib);
+
+  unlink (lib_dest);
+  xsymlink (lib_src, lib_dest);
+}
+
+// Link libmarker into the system libs directory, where the child should *not*
+// be able to find it.
+static void
+link_libmarker (void)
+{
+  char marker_src[4096] = {};
+  strcpy (marker_src, support_objdir_root);
+  strcat (marker_src, elf_dir);
+  strcat (marker_src, marker_lib);
+
+  char marker_dest[4096] = {};
+  strcat (marker_dest, support_slibdir_prefix);
+  strcat (marker_dest, marker_lib);
+
+  unlink (marker_dest);
+  xsymlink (marker_src, marker_dest);
+}
+
+static int
+do_test (void)
+{
+  xmkdirp (libs_dir, 0755);
+
+  link_system_lib_to_dir (libc);
+  link_system_lib_to_dir (libdl);
+  link_libmarker ();
+
+  char helper_path[4096] = {};
+  strcpy (helper_path, support_objdir_root);
+  strcat (helper_path, elf_dir);
+  strcat (helper_path, helper_program);
+
+  char *const argv[] =
+    {
+      strdup (support_container_elf_ldso_path),
+      strdup ("--no-default-paths"),
+      strdup ("--library-path"),
+      strdup (libs_dir),
+      helper_path,
+      strdup ("dlopen"),
+      NULL
+    };
+
+  int ret = support_subprogram_wait (argv[0], argv);
+
+  return WEXITSTATUS (ret);
+}
+
+#include <support/test-driver.c>
diff --git a/elf/tst-no-default-paths-helper.c b/elf/tst-no-default-paths-helper.c
new file mode 100644
index 0000000000..6ccab27deb
--- /dev/null
+++ b/elf/tst-no-default-paths-helper.c
@@ -0,0 +1,69 @@
+/* Helper for --no-default-paths tests
+   Copyright (C) 2021 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, see
+   <https://www.gnu.org/licenses/>.  */
+
+#include <array_length.h>
+#include <dlfcn.h>
+#include <string.h>
+#include <support/check.h>
+#include <support/support.h>
+#include <stdio.h>
+
+const char marker_lib[] = "libmarkermod1.so";
+const char usage[] = "Call this as \"helper dlopen\" or \"helper dlinfo\"\n";
+
+int
+main (int argc, char *argv[])
+{
+  if (argc < 2)
+    FAIL_EXIT1 (usage);
+
+  int mode;
+  if (strcmp (argv[1], "dlopen") == 0)
+    mode = 0;
+  else if (strcmp (argv[1], "dlinfo") == 0)
+    mode = 1;
+  else
+    FAIL_EXIT1 (usage);
+
+  void *handle = dlopen ("libmarkermod1.so", RTLD_LAZY);
+  if (handle == NULL)
+    {
+      if (mode)
+        FAIL_EXIT1 ("Failed to load libmarkermod1.so\n");
+      return 0;
+    }
+  else if (handle && mode == 0)
+    FAIL_EXIT1 ("Loaded libmarkermod1.so successfully!\n");
+
+  Dl_serinfo *buffer = xmalloc (sizeof(*buffer));
+  if (dlinfo (handle, RTLD_DI_SERINFOSIZE, buffer))
+    FAIL_EXIT1 ("dlinfo failed: %s\n", dlerror());
+
+  buffer = xrealloc (buffer, buffer->dls_size);
+  if (dlinfo (handle, RTLD_DI_SERINFO, buffer))
+    FAIL_EXIT1 ("dlinfo failed: %s\n", dlerror ());
+
+  // Checking if two paths are equal is tricky, so just check that there's
+  // exactly one and that it starts with /tmp, which should be sufficient to
+  // prove that the system paths have been excluded.
+  TEST_VERIFY_EXIT (buffer->dls_cnt == 1);
+  const char *name = buffer->dls_serpath[0].dls_name;
+  TEST_VERIFY_EXIT (strstr (name, "/tmp") == name);
+
+  return 0;
+}
diff --git a/support/Makefile b/support/Makefile
index 5c69f0de4b..9730f6b7dc 100644
--- a/support/Makefile
+++ b/support/Makefile
@@ -212,6 +212,7 @@ CFLAGS-support_paths.c = \
 		-DSRCDIR_PATH=\"`cd .. ; pwd`\" \
 		-DOBJDIR_PATH=\"`cd $(objpfx)/..; pwd`\" \
 		-DOBJDIR_ELF_LDSO_PATH=\"`cd $(objpfx)/..; pwd`/elf/$(rtld-installed-name)\" \
+		-DCONTAINER_ELF_LDSO_PATH=\"$(rtlddir)/$(rtld-installed-name)\" \
 		-DINSTDIR_PATH=\"$(prefix)\" \
 		-DLIBDIR_PATH=\"$(libdir)\" \
 		-DBINDIR_PATH=\"$(bindir)\" \
diff --git a/support/support.h b/support/support.h
index 9ec8ecb8d7..21f994067d 100644
--- a/support/support.h
+++ b/support/support.h
@@ -108,6 +108,10 @@ extern const char support_objdir_root[];
    e.g. OBJDIR_PATH/elf/ld-linux-x86-64.so.2  */
 extern const char support_objdir_elf_ldso[];
 
+/* Corresponds to the path to the runtime linker for containerised tests,
+   e.g. /lib64/ld-linux-x86-64.so.2  */
+extern const char support_container_elf_ldso_path[];
+
 /* Corresponds to the --prefix= passed to configure.  */
 extern const char support_install_prefix[];
 /* Corresponds to the install's lib/ or lib64/ directory.  */
diff --git a/support/support_paths.c b/support/support_paths.c
index d18e71e38b..4a14d4e78e 100644
--- a/support/support_paths.c
+++ b/support/support_paths.c
@@ -44,6 +44,12 @@ const char support_objdir_elf_ldso[] = OBJDIR_ELF_LDSO_PATH;
 # error please -DOBJDIR_ELF_LDSO_PATH=something in the Makefile
 #endif
 
+#ifdef CONTAINER_ELF_LDSO_PATH
+const char support_container_elf_ldso_path[] = CONTAINER_ELF_LDSO_PATH;
+#else
+# error please -DCONTAINER_ELF_LDSO_PATH=something in the Makefile
+#endif
+
 #ifdef INSTDIR_PATH
 /* Corresponds to the --prefix= passed to configure.  */
 const char support_install_prefix[] = INSTDIR_PATH;
-- 
2.32.0.93.g670b81a890-goog


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

* Re: [PATCH v4] rtld: Add --no-default-paths option
  2021-07-06 10:21 [PATCH v4] rtld: Add --no-default-paths option Fergus Dall via Libc-alpha
  2021-07-06 10:21 ` [PATCH v4 1/2] " Fergus Dall via Libc-alpha
  2021-07-06 10:21 ` [PATCH v4 2/2] rtld: Add tests for new " Fergus Dall via Libc-alpha
@ 2021-07-19  8:34 ` Fergus Dall via Libc-alpha
  2021-07-28  6:12   ` Fergus Dall via Libc-alpha
  2 siblings, 1 reply; 7+ messages in thread
From: Fergus Dall via Libc-alpha @ 2021-07-19  8:34 UTC (permalink / raw)
  To: libc-alpha; +Cc: fweimer, chromeos-toolchain, clumptini, joseph

Ping!

I haven't gotten a response for this yet.

Have I adequately made the case that this feature should exist? All the
comments on previous iterations of this patchset focused on relatively
minor details and I'm not sure if I should take that positively or not.

On Tue, Jul 6, 2021 at 8:21 PM Fergus Dall <sidereal@google.com> wrote:

> Changes from previous patchset:
>  - Incorporated vapier's suggestions.
>  - Initialized the path buffers in the tests, as strcat-ing into an
>    uninitialized buffer is undefined behavior.
>  - Stop adding support_install_prefix in tst-no-default-paths-dlopen
>    when constructing the path to the system lib directory. This
>    happened to work because I tested with prefix=/, but is in general
>    unnecessary and incorrect.
>
>
>

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

* Re: [PATCH v4] rtld: Add --no-default-paths option
  2021-07-19  8:34 ` [PATCH v4] rtld: Add " Fergus Dall via Libc-alpha
@ 2021-07-28  6:12   ` Fergus Dall via Libc-alpha
  2021-08-02  2:34     ` Fergus Dall via Libc-alpha
  0 siblings, 1 reply; 7+ messages in thread
From: Fergus Dall via Libc-alpha @ 2021-07-28  6:12 UTC (permalink / raw)
  To: libc-alpha; +Cc: fweimer, chromeos-toolchain, clumptini, joseph

Ping!

Still looking for a review

On Mon, Jul 19, 2021 at 6:34 PM Fergus Dall <sidereal@google.com> wrote:

> Ping!
>
> I haven't gotten a response for this yet.
>
> Have I adequately made the case that this feature should exist? All the
> comments on previous iterations of this patchset focused on relatively
> minor details and I'm not sure if I should take that positively or not.
>
> On Tue, Jul 6, 2021 at 8:21 PM Fergus Dall <sidereal@google.com> wrote:
>
>> Changes from previous patchset:
>>  - Incorporated vapier's suggestions.
>>  - Initialized the path buffers in the tests, as strcat-ing into an
>>    uninitialized buffer is undefined behavior.
>>  - Stop adding support_install_prefix in tst-no-default-paths-dlopen
>>    when constructing the path to the system lib directory. This
>>    happened to work because I tested with prefix=/, but is in general
>>    unnecessary and incorrect.
>>
>>
>>

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

* Re: [PATCH v4] rtld: Add --no-default-paths option
  2021-07-28  6:12   ` Fergus Dall via Libc-alpha
@ 2021-08-02  2:34     ` Fergus Dall via Libc-alpha
  2021-08-02  3:44       ` Carlos O'Donell via Libc-alpha
  0 siblings, 1 reply; 7+ messages in thread
From: Fergus Dall via Libc-alpha @ 2021-08-02  2:34 UTC (permalink / raw)
  To: libc-alpha; +Cc: fweimer, chromeos-toolchain, clumptini, joseph

Ping

On Wed, Jul 28, 2021 at 4:12 PM Fergus Dall <sidereal@google.com> wrote:

> Ping!
>
> Still looking for a review
>
> On Mon, Jul 19, 2021 at 6:34 PM Fergus Dall <sidereal@google.com> wrote:
>
>> Ping!
>>
>> I haven't gotten a response for this yet.
>>
>> Have I adequately made the case that this feature should exist? All the
>> comments on previous iterations of this patchset focused on relatively
>> minor details and I'm not sure if I should take that positively or not.
>>
>> On Tue, Jul 6, 2021 at 8:21 PM Fergus Dall <sidereal@google.com> wrote:
>>
>>> Changes from previous patchset:
>>>  - Incorporated vapier's suggestions.
>>>  - Initialized the path buffers in the tests, as strcat-ing into an
>>>    uninitialized buffer is undefined behavior.
>>>  - Stop adding support_install_prefix in tst-no-default-paths-dlopen
>>>    when constructing the path to the system lib directory. This
>>>    happened to work because I tested with prefix=/, but is in general
>>>    unnecessary and incorrect.
>>>
>>>
>>>

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

* Re: [PATCH v4] rtld: Add --no-default-paths option
  2021-08-02  2:34     ` Fergus Dall via Libc-alpha
@ 2021-08-02  3:44       ` Carlos O'Donell via Libc-alpha
  0 siblings, 0 replies; 7+ messages in thread
From: Carlos O'Donell via Libc-alpha @ 2021-08-02  3:44 UTC (permalink / raw)
  To: Fergus Dall, libc-alpha; +Cc: fweimer, clumptini, joseph, chromeos-toolchain

On 8/1/21 10:34 PM, Fergus Dall wrote:
>>>> Changes from previous patchset:
>>>>  - Incorporated vapier's suggestions.
>>>>  - Initialized the path buffers in the tests, as strcat-ing into an
>>>>    uninitialized buffer is undefined behavior.
>>>>  - Stop adding support_install_prefix in tst-no-default-paths-dlopen
>>>>    when constructing the path to the system lib directory. This
>>>>    happened to work because I tested with prefix=/, but is in general
>>>>    unnecessary and incorrect.

I looked over the series in patchwork, particularly looking for a broader
explanation of use cases in the commit, but I didn't see it there, and
I went back over the various discussions around the patch series but didn't
see any justification there either. This doesn't constitute an objection
to the series, but just a note that the work is missing a purpose statement.

What is the purpose behind adding this behaviour?

What use cases exist?

How do users use this feature?

How do you see chromeos using the feature?

I can think of some ways to use this but I'm interested to hear your
explanation, and seeing that echoed in a man page, manual, or detailed
commit message.

-- 
Cheers,
Carlos.


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

end of thread, other threads:[~2021-08-02  3:44 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-07-06 10:21 [PATCH v4] rtld: Add --no-default-paths option Fergus Dall via Libc-alpha
2021-07-06 10:21 ` [PATCH v4 1/2] " Fergus Dall via Libc-alpha
2021-07-06 10:21 ` [PATCH v4 2/2] rtld: Add tests for new " Fergus Dall via Libc-alpha
2021-07-19  8:34 ` [PATCH v4] rtld: Add " Fergus Dall via Libc-alpha
2021-07-28  6:12   ` Fergus Dall via Libc-alpha
2021-08-02  2:34     ` Fergus Dall via Libc-alpha
2021-08-02  3:44       ` Carlos O'Donell via Libc-alpha

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).