LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
From: Bodo Eggert <7eggert@gmx.de>
To: Jan Engelhardt <jengelh@linux01.gwdg.de>
Cc: Bodo Eggert <7eggert@gmx.de>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	Andrew Morton <akpm@osdl.org>,
	Jon Masters <jonathan@jonmasters.org>,
	Alexey Dobriyan <adobriyan@gmail.com>
Subject: Re: [PATCH/RFC] alternative aproach to: Ban module license tag string termination trick
Date: Sat, 3 Feb 2007 15:04:23 +0100 (CET)	[thread overview]
Message-ID: <Pine.LNX.4.58.0702031350360.2384@be1.lrz> (raw)
In-Reply-To: <Pine.LNX.4.61.0702031213220.27840@yvahk01.tjqt.qr>

On Sat, 3 Feb 2007, Jan Engelhardt wrote:
> On Feb 3 2007 03:08, Bodo Eggert wrote:

> >This patch changes the module license handling code to:
> >- allow modules to have multiple licenses
> >- access GPL symbols if at least one license is GPL-compatible
> 
> I strongly nak that. If you combine two object files (e.g. foo.o, bar.o)
> that have different licenses, the resulting object file (comb.o) IMHO
> constitutes a combined work, and hence the GPL should be applied to all of
> it. That obviously "does not work" - what good is a GPL comb.o file if you
> don't have the source to bar.o? I think a module (.ko) should be denied
> access to GPL symbols if any of the MODULE_LICENSE()s are not GPL.

IMO it's called MODULE_LICENSE, not CFILE_LICENSE, therefore license 
strings in the module apply to the complete module.

> Otherwise, ndiswrapper, CiscoVPN, etc. would just add a dummy.c GPL file
> with a MODULE_LICENSE("GPL") in there and get the symbols.

Using an extra GPL .o is like MODULE_LICENSE("GPL")/* for nothing*/;,
you can't really do something about it.

> Though you
> could still get at the GPL symbols by use of a dedicated wrapper (think
> nvidia kernel module), I would not want to make it easier for them by
> allowing your two points. At best, foo.o and bar.o should be compiled
> independently to foo.ko and bar.ko and work with EXPORT_SYMBOLs.

IMO, using separate modules is the only thing you can do if you don't want 
to license your complete code using GPL.

> >The license handling code was kind of strange:
> > - The kernel itself would only consider the first license, while modpost
> >   looks at all of them.
> > - If you offer your module under a non-GPL license in addition to GPL,
> >   modpost would consider this module to be non-GPL. Therefore you can't
> >   say MODULE_LICENSE("GPL");\nMODULE_LICENSE("completely free");
> 
> The idea to allow MODULE_LICENSE("GPL");\nMODULE_LICENSE("Public Domain");
> is good, but how would you interpret an .o file (with no source!) with
> MODULE_LICENSE("GPL");\nMODULE_LICENSE("Proprietary") ? (Well, see above)

reiserfs is available under a Proprietary license, too. Obviously this is OK.

> >Prohibiting the \0-trick is done by storing the length of the license
> >behind the license itself, uuencoded, as $=xyz.
> >
> >Currently, only 18 bits (256 KB) of the length are stored, but storing up
> >to 30 bits is possible without changing anything besides the macro.
> >
> >You can still trick this code by including "...\0license=GPL\0$=$\0..." or
> >by manually fabricating this string into .modinfo. Fix: Document this to
> >mean that you actually GPL-license the module. 
> 
> $=$ is interpreted as what? [Ah ok, uuencoded uint32_t] That does not look
> good. What if the length thing does not immediately come after the license
> string? (E.g. someone hand-crafted a .ko)

In this case, the tag is not recognized and will be skipped as if it were
misspelled. I could also just bail out and deny loading the module.

> static const char *const gpl_compatible[];
> 
> >+	    "GPL",
> >+		"GPL v2",
> >+		"GPL and additional rights",
> >+		"Dual BSD/GPL",
> >+		"Dual MIT/GPL",
> >+		"Dual MPL/GPL",
> 
> If we allowed multiple MODULE_LICENSE()s, all the Dual XYZ/GPL
> combinations and so can go, since it would be possible to have
> MODULE_LICENSE("GPL")\nMODULE_LICENSE("BSD");, simplifying the
> module loader code.

ACK, and "BSD" etc. should be included. I kept the combinations for 
backward-compatibility. Possibly we could warn on using them.

-- 
A bone to the dog is not charity. Charity is the bone shared with the dog, when
you are just as hungry as the dog.
	-- Jack London

  parent reply	other threads:[~2007-02-03 14:05 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-02-03  2:08 Bodo Eggert
2007-02-03  8:14 ` Russell King
2007-02-03 11:38   ` Jan Engelhardt
2007-02-03 19:56   ` Alan
2007-02-03 20:12     ` Randy Dunlap
2007-02-03 11:32 ` Jan Engelhardt
2007-02-03 11:54   ` Theodore Tso
2007-02-03 14:04   ` Bodo Eggert [this message]
2007-02-03 19:47     ` Alan
2007-02-03 20:02 ` Alan
2007-02-05 13:08   ` Bodo Eggert

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=Pine.LNX.4.58.0702031350360.2384@be1.lrz \
    --to=7eggert@gmx.de \
    --cc=adobriyan@gmail.com \
    --cc=akpm@osdl.org \
    --cc=jengelh@linux01.gwdg.de \
    --cc=jonathan@jonmasters.org \
    --cc=linux-kernel@vger.kernel.org \
    --subject='Re: [PATCH/RFC] alternative aproach to: Ban module license tag string termination trick' \
    /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

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 NNTP newsgroup(s).