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>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1323879603-2961-1-git-send-email-linville@tuxdriver.com>
Date:	Wed, 14 Dec 2011 11:20:03 -0500
From:	"John W. Linville" <linville@...driver.com>
To:	Ben Hutchings <ben@...adent.org.uk>
Cc:	"Luis R. Rodriguez" <mcgrof@...jolero.org>,
	linux-kernel@...r.kernel.org, Dave Jones <davej@...hat.com>,
	Greg KH <greg@...ah.com>,
	Debian kernel maintainers <debian-kernel@...ts.debian.org>,
	Rusty Russell <rusty@...tcorp.com.au>,
	linux-wireless@...r.kernel.org,
	"John W. Linville" <linville@...driver.com>
Subject: [RFC] modpost: add option to allow external modules to avoid taint

In some cases, it might be desirable to package a module from an
external source tree alongside the base kernel.  In those cases, it
might also be desirable to not have those modules tainting the kernel.

This patch provides a mechanism for an external module build to declare
itself as an "integrated build".  Such a module is then treated the same
as an intree module.

Signed-off-by: John W. Linville <linville@...driver.com>
---
Any thoughts on this?  I'm thinking of adding this to Fedora kernels,
where I have been working to integrate the compat-wireless package as
part of the base kernel RPM.

 scripts/Makefile.modpost |    1 +
 scripts/mod/modpost.c    |   10 ++++++++--
 2 files changed, 9 insertions(+), 2 deletions(-)

diff --git a/scripts/Makefile.modpost b/scripts/Makefile.modpost
index 08dce14..160c6fb 100644
--- a/scripts/Makefile.modpost
+++ b/scripts/Makefile.modpost
@@ -81,6 +81,7 @@ modpost = scripts/mod/modpost                    \
  $(if $(KBUILD_EXTMOD),-o $(modulesymfile))      \
  $(if $(CONFIG_DEBUG_SECTION_MISMATCH),,-S)      \
  $(if $(KBUILD_EXTMOD)$(KBUILD_MODPOST_WARN),-w) \
+ $(if $(INTEGRATED_BUILD),-B) \
  $(if $(cross_build),-c)
 
 quiet_cmd_modpost = MODPOST $(words $(filter-out vmlinux FORCE, $^)) modules
diff --git a/scripts/mod/modpost.c b/scripts/mod/modpost.c
index 2bd594e..5d077f9 100644
--- a/scripts/mod/modpost.c
+++ b/scripts/mod/modpost.c
@@ -43,6 +43,9 @@ static int warn_unresolved = 0;
 static int sec_mismatch_count = 0;
 static int sec_mismatch_verbose = 1;
 
+/* Is this a module being built as part of an integrated package? */
+static int integrated_build = 0;
+
 enum export {
 	export_plain,      export_unused,     export_gpl,
 	export_unused_gpl, export_gpl_future, export_unknown
@@ -1851,7 +1854,7 @@ static void add_header(struct buffer *b, struct module *mod)
 
 static void add_intree_flag(struct buffer *b, int is_intree)
 {
-	if (is_intree)
+	if (is_intree || integrated_build)
 		buf_printf(b, "\nMODULE_INFO(intree, \"Y\");\n");
 }
 
@@ -2101,7 +2104,7 @@ int main(int argc, char **argv)
 	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) {
+	while ((opt = getopt(argc, argv, "i:I:e:cmsSo:awM:K:B")) != -1) {
 		switch (opt) {
 		case 'i':
 			kernel_read = optarg;
@@ -2139,6 +2142,9 @@ int main(int argc, char **argv)
 		case 'w':
 			warn_unresolved = 1;
 			break;
+		case 'B':
+			integrated_build = 1;
+			break;
 		default:
 			exit(1);
 		}
-- 
1.7.4.4

--
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