public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Andreas Gruenbacher <agruen@suse.de>
To: Ram Pai <linuxram@us.ibm.com>
Cc: Greg KH <greg@kroah.com>, Jan Beulich <jbeulich@novell.com>,
	sam@ravnborg.org, linux-kernel@vger.kernel.org
Subject: Re: GPL-only symbols issue
Date: Tue, 9 May 2006 19:31:35 +0200	[thread overview]
Message-ID: <200605091931.35753.agruen@suse.de> (raw)
In-Reply-To: <1147154238.7203.62.camel@localhost>

On Tuesday, 09 May 2006 07:57, Ram Pai wrote:
> On Mon, 2006-05-08 at 21:25 -0700, Greg KH wrote:
> > On Mon, May 08, 2006 at 09:12:15AM +0200, Jan Beulich wrote:
> > > Sam,
> > >
> > > would it seem reasonable a request to detect imports of GPL-only
> > > symbols by non-GPL modules also at build time rather than only at run
> > > time, and at least warn about such?

I would appreciate such a check: it avoids unnecessary errors later. See 
my proposed patch in the next message.

> > Ram has some tools that might catch this kind of thing.  He's posted his
> > scripts to lkml in the past, try looking in the archives.
>
> The patches are at
>
> http://sudhaa.com/~ram/misc/kernelpatch
>
> The patch of interest for you would be modpost.patch
> I have a script and some code that can poke into a given .ko file and
> warn against symbols that don't match what the kernel exports.

I like the extension that modpost.patch adds. Statistics gathering like your 
other patch does doesn't need to be in the mainline kernel IMVHO, but I don't 
really mind. Here is a bugfix to modpost.patch:

Index: linux-2.6.16/scripts/mod/modpost.c
===================================================================
--- linux-2.6.16.orig/scripts/mod/modpost.c
+++ linux-2.6.16/scripts/mod/modpost.c
@@ -811,8 +817,12 @@ static void read_dump(const char *fname,
 					*d != '\0')
 			goto fail;
 
-		if (!(strcmp(export, "EXPORT_GPL_ONLY")))
+		if (strcmp(export, "EXPORT_SYMBOL_GPL") == 0)
 			export_type = 1;
+		else if (strcmp(export, "EXPORT_SYMBOL") == 0)
+			export_type = 0;
+		else
+			goto fail;
 
 		if (!(mod = find_module(modname))) {
 			if (is_vmlinux(modname)) {

Andreas

  parent reply	other threads:[~2006-05-09 17:30 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-05-08  7:12 GPL-only symbols issue Jan Beulich
2006-05-08 20:23 ` Sam Ravnborg
2006-05-09  4:25 ` Greg KH
2006-05-09  5:57   ` Ram Pai
2006-05-09 13:11     ` Philip R. Auld
2006-05-09 17:31     ` Andreas Gruenbacher [this message]
2006-05-09 17:31     ` [PATCH] Check for license compliance at build time Andreas Gruenbacher
2006-05-09 20:55       ` Ram Pai
2006-05-09 22:24         ` Sam Ravnborg
2006-06-17 21:06   ` GPL-only symbols issue Sam Ravnborg

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200605091931.35753.agruen@suse.de \
    --to=agruen@suse.de \
    --cc=greg@kroah.com \
    --cc=jbeulich@novell.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linuxram@us.ibm.com \
    --cc=sam@ravnborg.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox