lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Date:	Fri, 3 Oct 2008 15:43:48 -0600 (MDT)
From:	Jeff Hansen <x@...fhansen.com>
To:	linux-kernel@...r.kernel.org
Subject: [PATCH] [MODULES]: Add KBUILD_EXTSYMVERS to supply external
 Module.symvers files

Some out-of-tree modules require other out-of-tree modules to load and
function.  This patch allows one module to supply the path(s) of the
modules it depends on by setting the KBUILD_EXTSYMVERS make variable.
The Module.symvers files from these path(s) will be included when
searching for symbol versions, and the resulting modules will have
proper symbol version information.
---
  scripts/Makefile.modpost |    2 ++
  scripts/mod/modpost.c    |   10 ++++++----
  2 files changed, 8 insertions(+), 4 deletions(-)

diff --git a/scripts/Makefile.modpost b/scripts/Makefile.modpost
index 9ee9783..a472d3c 100644
--- a/scripts/Makefile.modpost
+++ b/scripts/Makefile.modpost
@@ -81,6 +81,8 @@ modpost = scripts/mod/modpost                    \
   $(if $(CONFIG_MODVERSIONS),-m)                  \
   $(if $(CONFIG_MODULE_SRCVERSION_ALL),-a,)       \
   $(if $(KBUILD_EXTMOD),-i,-o) $(kernelsymfile)   \
+ $(if $(KBUILD_EXTSYMVERS),                      \
+   $(foreach dir,$(KBUILD_EXTSYMVERS),-i $(dir)/Module.symvers)) \
   $(if $(KBUILD_EXTMOD),-I $(modulesymfile))      \
   $(if $(KBUILD_EXTRA_SYMBOLS), $(patsubst %, -e %,$(EXTRA_SYMBOLS))) \
   $(if $(KBUILD_EXTMOD),-o $(modulesymfile))      \
diff --git a/scripts/mod/modpost.c b/scripts/mod/modpost.c
index 8f038e6..37de1c3 100644
--- a/scripts/mod/modpost.c
+++ b/scripts/mod/modpost.c
@@ -39,6 +39,7 @@ enum export {
  };

  #define PRINTF __attribute__ ((format (printf, 1, 2)))
+#define MAX_SYMVERS 16

  PRINTF void fatal(const char *fmt, ...)
  {
@@ -2044,19 +2045,20 @@ int main(int argc, char **argv)
  {
  	struct module *mod;
  	struct buffer buf = { };
-	char *kernel_read = NULL, *module_read = NULL;
+	char *kernel_read[MAX_SYMVERS] = { 0 }, *module_read = NULL;
  	char *dump_write = NULL;
  	char *markers_read = NULL;
  	char *markers_write = NULL;
  	int opt;
  	int err;
+	int kernel_reads = 0;
  	struct ext_sym_list *extsym_iter;
  	struct ext_sym_list *extsym_start = NULL;

  	while ((opt = getopt(argc, argv, "i:I:e:cmsSo:awM:K:")) != -1) {
  		switch (opt) {
  		case 'i':
-			kernel_read = optarg;
+			kernel_read[kernel_reads++] = optarg;
  			break;
  		case 'I':
  			module_read = optarg;
@@ -2102,8 +2104,8 @@ int main(int argc, char **argv)
  		}
  	}

-	if (kernel_read)
-		read_dump(kernel_read, 1);
+	while (kernel_reads > 0)
+		read_dump(kernel_read[--kernel_reads], 1);
  	if (module_read)
  		read_dump(module_read, 0);
  	while (extsym_start) {
-- 
1.5.6.4

---------------------------------------------------
"If someone's gotta do it, it might as well be me."
                 x@...fhansen.com
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ