All of lore.kernel.org
 help / color / mirror / Atom feed
* Re-enabling non-GPL driver access to disk partition information
@ 2010-01-29 14:15 Derek Atkins
  2010-01-29 14:47 ` Al Viro
                   ` (3 more replies)
  0 siblings, 4 replies; 10+ messages in thread
From: Derek Atkins @ 2010-01-29 14:15 UTC (permalink / raw)
  To: linux-kernel; +Cc: warlord

[-- Attachment #1: Type: text/plain, Size: 1612 bytes --]

Hi Linuxers,

I've been working on a proprietary disk driver which has been working
for the past couple years on Linux as old as 2.6.18.  Unfortunately,
as of 2.6.28 it appears that some of the gendisk interfaces (read:
structure members) I was using were moved behind an RCU and other
GPL-ONLY accessor interfaces.  I appologize for coming at this so
late, but I don't monitor LKML and I only noticed this when we tried
to port our driver to Ubuntu 9.04 and Fedora 11, and then had delays
in getting this email out.

In particular, there is now no way for a proprietary driver to access
the gendisk partition array, to enumerate the existing partitions, or to
get information about existing partitions.  All those interfaces are now
GPL-Only, (whereas access to the structure members before were perfectly
legal for non-GPL modules).  But now the partition structure is sitting
behind the GPL-Only RCU abstraction.

While I can hack around this to some extent, I'd rather have real
interfaces I can use and play nicely with the Linux disk driver APIs.
Therefore, I propose to convert a few of these interfaces to non-GPL
export for general driver use.  The list of functions I propose to
change:

disk_get_part()
put_device() (needed for the inline disk_put_part() function)

disk_part_iter_init()
disk_part_iter_next()
disk_part_iter_exit()

I hope this patch is acceptable to the Linux community and makes it
quickly into a published Linux release.

Thanks,

-derek

** drivers/base/core.c
** block/genhd.c
Re-enable non-GPL access to disk partition information

Approved By:  Derek Atkins <warlord@MIT.EDU>


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: Diff for re-enabling access to partition information --]
[-- Type: text/x-patch, Size: 1295 bytes --]

--- drivers/base/core.c~	2009-03-23 19:12:14.000000000 -0400
+++ drivers/base/core.c	2009-10-16 12:15:57.000000000 -0400
@@ -1200,7 +1200,7 @@
 EXPORT_SYMBOL_GPL(device_del);
 EXPORT_SYMBOL_GPL(device_unregister);
 EXPORT_SYMBOL_GPL(get_device);
-EXPORT_SYMBOL_GPL(put_device);
+EXPORT_SYMBOL(put_device);
 
 EXPORT_SYMBOL_GPL(device_create_file);
 EXPORT_SYMBOL_GPL(device_remove_file);
--- block/genhd.c~	2009-03-23 19:12:14.000000000 -0400
+++ block/genhd.c	2009-10-16 12:18:16.000000000 -0400
@@ -72,7 +72,7 @@
 
 	return part;
 }
-EXPORT_SYMBOL_GPL(disk_get_part);
+EXPORT_SYMBOL(disk_get_part);
 
 /**
  * disk_part_iter_init - initialize partition iterator
@@ -107,7 +107,7 @@
 
 	rcu_read_unlock();
 }
-EXPORT_SYMBOL_GPL(disk_part_iter_init);
+EXPORT_SYMBOL(disk_part_iter_init);
 
 /**
  * disk_part_iter_next - proceed iterator to the next partition and return it
@@ -163,7 +163,7 @@
 
 	return piter->part;
 }
-EXPORT_SYMBOL_GPL(disk_part_iter_next);
+EXPORT_SYMBOL(disk_part_iter_next);
 
 /**
  * disk_part_iter_exit - finish up partition iteration
@@ -179,7 +179,7 @@
 	disk_put_part(piter->part);
 	piter->part = NULL;
 }
-EXPORT_SYMBOL_GPL(disk_part_iter_exit);
+EXPORT_SYMBOL(disk_part_iter_exit);
 
 static inline int sector_in_part(struct hd_struct *part, sector_t sector)
 {

[-- Attachment #3: Type: text/plain, Size: 261 bytes --]


-- 
       Derek Atkins, SB '93 MIT EE, SM '95 MIT Media Laboratory
       Member, MIT Student Information Processing Board  (SIPB)
       URL: http://web.mit.edu/warlord/    PP-ASEL-IA     N1NWH
       warlord@MIT.EDU                        PGP key available

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

* Re: Re-enabling non-GPL driver access to disk partition information
  2010-01-29 14:15 Re-enabling non-GPL driver access to disk partition information Derek Atkins
@ 2010-01-29 14:47 ` Al Viro
  2010-01-29 15:09 ` Rik van Riel
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 10+ messages in thread
From: Al Viro @ 2010-01-29 14:47 UTC (permalink / raw)
  To: Derek Atkins; +Cc: linux-kernel

On Fri, Jan 29, 2010 at 09:15:09AM -0500, Derek Atkins wrote:

> In particular, there is now no way for a proprietary driver to access
> the gendisk partition array, to enumerate the existing partitions, or to
> get information about existing partitions.  All those interfaces are now
> GPL-Only, (whereas access to the structure members before were perfectly
> legal for non-GPL modules).  But now the partition structure is sitting
> behind the GPL-Only RCU abstraction.

Why the hell does disk driver care about partitioning in the first place?

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

* Re: Re-enabling non-GPL driver access to disk partition information
  2010-01-29 14:15 Re-enabling non-GPL driver access to disk partition information Derek Atkins
  2010-01-29 14:47 ` Al Viro
@ 2010-01-29 15:09 ` Rik van Riel
  2010-01-29 15:38   ` Derek Atkins
  2010-01-29 15:23 ` Alan Cox
  2010-01-29 22:06 ` Greg KH
  3 siblings, 1 reply; 10+ messages in thread
From: Rik van Riel @ 2010-01-29 15:09 UTC (permalink / raw)
  To: Derek Atkins; +Cc: linux-kernel

On 01/29/2010 09:15 AM, Derek Atkins wrote:
> Hi Linuxers,
>
> I've been working on a proprietary disk driver which has been working
> for the past couple years on Linux as old as 2.6.18.  Unfortunately,
> as of 2.6.28 it appears that some of the gendisk interfaces (read:
> structure members) I was using were moved behind an RCU and other
> GPL-ONLY accessor interfaces.

RCU is patented, with permission for GPL code to use the algorithm.

Exposing RCU bits to non-GPL modules would be rather pointless, since
those don't have permission (from IBM, the RCU patent holder) to use
RCU, anyway.

-- 
All rights reversed.

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

* Re: Re-enabling non-GPL driver access to disk partition information
  2010-01-29 14:15 Re-enabling non-GPL driver access to disk partition information Derek Atkins
  2010-01-29 14:47 ` Al Viro
  2010-01-29 15:09 ` Rik van Riel
@ 2010-01-29 15:23 ` Alan Cox
  2010-01-29 22:06 ` Greg KH
  3 siblings, 0 replies; 10+ messages in thread
From: Alan Cox @ 2010-01-29 15:23 UTC (permalink / raw)
  To: Derek Atkins; +Cc: linux-kernel, warlord

> get information about existing partitions.  All those interfaces are now
> GPL-Only,

The kernel is GPL licensed. Please don't assume an EXPORT_SYMBOL() means
the GPL does not apply or that this magically indicates it isn't a
derivative work.

Alan

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

* Re: Re-enabling non-GPL driver access to disk partition information
  2010-01-29 15:09 ` Rik van Riel
@ 2010-01-29 15:38   ` Derek Atkins
  0 siblings, 0 replies; 10+ messages in thread
From: Derek Atkins @ 2010-01-29 15:38 UTC (permalink / raw)
  To: Rik van Riel, Alan Cox; +Cc: linux-kernel, Tejun Heo

Hi,

Rik van Riel <riel@redhat.com> writes:

> RCU is patented, with permission for GPL code to use the algorithm.
>
> Exposing RCU bits to non-GPL modules would be rather pointless, since
> those don't have permission (from IBM, the RCU patent holder) to use
> RCU, anyway.

I'm neither asking for or suggesting non-GPL access to RCU.  Rather I'm
asking for non-GPL access to genhd partition information.  In particular
I'm looking for:

- # of actual partitions (which I used to obtain by iterating the table
  and counting -- yes, I know, gross)
- for each partition:
  * partition start sector
  * partition size

Alan Cox <alan@lxorguk.ukuu.org.uk> writes:

>> get information about existing partitions.  All those interfaces are now
>> GPL-Only,
>
> The kernel is GPL licensed. Please don't assume an EXPORT_SYMBOL() means
> the GPL does not apply or that this magically indicates it isn't a
> derivative work.

I'm not making that assumption, and the lawyers involved have made that
very very clear.  (I've spent more time in meetings with lawyers in the
past month than I have working on code).  However, that's why I'm just
asking for EXPORT_SYMBOL() instead of EXPORT_SYMBOL_GPL(), because I'm
not sure I can license my module under the GPL (although it can be
released under other licenses, but that doesn't give me access to
GPL-Only symbols).

I'd prefer to be able to access the partition objects directly as I had
been doing for a couple years.  However I do have other alternatives if
this patch (or something like it) wont be accepted.

-derek

-- 
       Derek Atkins, SB '93 MIT EE, SM '95 MIT Media Laboratory
       Member, MIT Student Information Processing Board  (SIPB)
       URL: http://web.mit.edu/warlord/    PP-ASEL-IA     N1NWH
       warlord@MIT.EDU                        PGP key available

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

* Re: Re-enabling non-GPL driver access to disk partition information
  2010-01-29 14:15 Re-enabling non-GPL driver access to disk partition information Derek Atkins
                   ` (2 preceding siblings ...)
  2010-01-29 15:23 ` Alan Cox
@ 2010-01-29 22:06 ` Greg KH
  2010-01-30  4:02   ` David Newall
  3 siblings, 1 reply; 10+ messages in thread
From: Greg KH @ 2010-01-29 22:06 UTC (permalink / raw)
  To: Derek Atkins; +Cc: linux-kernel

On Fri, Jan 29, 2010 at 09:15:09AM -0500, Derek Atkins wrote:
> 
> Approved By:  Derek Atkins <warlord@MIT.EDU>

What does that mean?

> --- drivers/base/core.c~	2009-03-23 19:12:14.000000000 -0400
> +++ drivers/base/core.c	2009-10-16 12:15:57.000000000 -0400

Wrong diff level.

> @@ -1200,7 +1200,7 @@
>  EXPORT_SYMBOL_GPL(device_del);
>  EXPORT_SYMBOL_GPL(device_unregister);
>  EXPORT_SYMBOL_GPL(get_device);
> -EXPORT_SYMBOL_GPL(put_device);
> +EXPORT_SYMBOL(put_device);

No, sorry, I've already successfully taken legal action against
companies who have tried to go around the driver core's GPL-only
symbols, so I can not, and will not, make this change.

thanks,

greg k-h

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

* Re: Re-enabling non-GPL driver access to disk partition information
  2010-01-29 22:06 ` Greg KH
@ 2010-01-30  4:02   ` David Newall
  2010-02-03  2:10     ` Greg KH
  0 siblings, 1 reply; 10+ messages in thread
From: David Newall @ 2010-01-30  4:02 UTC (permalink / raw)
  To: Derek Atkins; +Cc: linux-kernel

Greg KH wrote:
> On Fri, Jan 29, 2010 at 09:15:09AM -0500, Derek Atkins wrote:
>   
>> -EXPORT_SYMBOL_GPL(put_device);
>> +EXPORT_SYMBOL(put_device);
>>     
>
> No, sorry, [...] I can not, and will not, make this change.
>   


Derek,

Consider writing a GPL wrapper module.

David

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

* Re: Re-enabling non-GPL driver access to disk partition information
  2010-01-30  4:02   ` David Newall
@ 2010-02-03  2:10     ` Greg KH
  2010-02-03 15:28       ` David Newall
  0 siblings, 1 reply; 10+ messages in thread
From: Greg KH @ 2010-02-03  2:10 UTC (permalink / raw)
  To: David Newall; +Cc: Derek Atkins, linux-kernel

On Sat, Jan 30, 2010 at 02:32:20PM +1030, David Newall wrote:
> Greg KH wrote:
>> On Fri, Jan 29, 2010 at 09:15:09AM -0500, Derek Atkins wrote:
>>   
>>> -EXPORT_SYMBOL_GPL(put_device);
>>> +EXPORT_SYMBOL(put_device);
>>>     
>>
>> No, sorry, [...] I can not, and will not, make this change.
>>   
>
>
> Derek,
>
> Consider writing a GPL wrapper module.

Ah, the old "GPL condom" try.  Sorry, but this has been tried many times
in the past, and have been shut down every time.  See the Samba history
of this for lots of details as to why this does not work.

good luck,

greg k-h

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

* Re: Re-enabling non-GPL driver access to disk partition information
  2010-02-03  2:10     ` Greg KH
@ 2010-02-03 15:28       ` David Newall
  2010-02-04  0:30         ` Robert Hancock
  0 siblings, 1 reply; 10+ messages in thread
From: David Newall @ 2010-02-03 15:28 UTC (permalink / raw)
  To: Greg KH; +Cc: Derek Atkins, linux-kernel

Greg KH wrote:
> On Sat, Jan 30, 2010 at 02:32:20PM +1030, David Newall wrote:
>   
>> Greg KH wrote:
>>     
>>> On Fri, Jan 29, 2010 at 09:15:09AM -0500, Derek Atkins wrote:
>>>   
>>>       
>>>> -EXPORT_SYMBOL_GPL(put_device);
>>>> +EXPORT_SYMBOL(put_device);
>>>>     
>>>>         
>>> No, sorry, [...] I can not, and will not, make this change.
>>>   
>>>       
>> Derek,
>>
>> Consider writing a GPL wrapper module.
>>     
>
> Ah, the old "GPL condom" try.  Sorry, but this has been tried many times
> in the past, and have been shut down every time.  See the Samba history
> of this for lots of details as to why this does not work.


Samba vs The Money merely shows that The Money failed to put up a 
sufficient defence. Good result for FOSS, but I recommend against you 
betting your home on it.

Anyway, I was thinking of something a little more substantial that what 
you perhaps read into my suggestion. There's usually a substantial gap 
between the pure needs of a driver and the facilities offered by an 
operating system. In the case in question, for example, the need is to 
count the number of partitions, and the facility offered is get_device, 
or something. A tiny GPL module that calls get_device and returns a 
count sounds eminently defensible.

In addition--and please keep in mind that I'm unfamiliar with the 
internals of the kernel--it seems to me there's an obvious similarity 
with USL vs BSD, alleging copyright for verbatim copying of macro 
constants, amongst other things. A lesson that learned then was that you 
can't prevent someone from using provided facilities necessary for use 
of the operating system. I don't know what put_device does, but I know 
what it sounds like; it sounds like it's something that you have to use, 
and so one can use it, even in proprietary code. I imagine this idea 
will irritate those who put in the hard yards, but FOSS has to play by 
the same rules as the monied end of town. You might want to think about 
this carefully, because if it's taken all the way through court and the 
GPL-only claim rejected, there may well be a run-on effect on all of the 
symbols marked GPL-only. Those who want to thwart proprietary kernel 
modules may find it prudent to generously give up this symbol rather 
than risking the lot.

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

* Re: Re-enabling non-GPL driver access to disk partition information
  2010-02-03 15:28       ` David Newall
@ 2010-02-04  0:30         ` Robert Hancock
  0 siblings, 0 replies; 10+ messages in thread
From: Robert Hancock @ 2010-02-04  0:30 UTC (permalink / raw)
  To: David Newall; +Cc: Greg KH, Derek Atkins, linux-kernel

On 02/03/2010 09:28 AM, David Newall wrote:
> Greg KH wrote:
>> On Sat, Jan 30, 2010 at 02:32:20PM +1030, David Newall wrote:
>>> Greg KH wrote:
>>>> On Fri, Jan 29, 2010 at 09:15:09AM -0500, Derek Atkins wrote:
>>>>> -EXPORT_SYMBOL_GPL(put_device);
>>>>> +EXPORT_SYMBOL(put_device);
>>>> No, sorry, [...] I can not, and will not, make this change.
>>> Derek,
>>>
>>> Consider writing a GPL wrapper module.
>>
>> Ah, the old "GPL condom" try. Sorry, but this has been tried many times
>> in the past, and have been shut down every time. See the Samba history
>> of this for lots of details as to why this does not work.
>
>
> Samba vs The Money merely shows that The Money failed to put up a
> sufficient defence. Good result for FOSS, but I recommend against you
> betting your home on it.
>
> Anyway, I was thinking of something a little more substantial that what
> you perhaps read into my suggestion. There's usually a substantial gap
> between the pure needs of a driver and the facilities offered by an
> operating system. In the case in question, for example, the need is to
> count the number of partitions, and the facility offered is get_device,
> or something. A tiny GPL module that calls get_device and returns a
> count sounds eminently defensible.
>
> In addition--and please keep in mind that I'm unfamiliar with the
> internals of the kernel--it seems to me there's an obvious similarity
> with USL vs BSD, alleging copyright for verbatim copying of macro
> constants, amongst other things. A lesson that learned then was that you
> can't prevent someone from using provided facilities necessary for use
> of the operating system. I don't know what put_device does, but I know
> what it sounds like; it sounds like it's something that you have to use,
> and so one can use it, even in proprietary code. I imagine this idea
> will irritate those who put in the hard yards, but FOSS has to play by
> the same rules as the monied end of town. You might want to think about
> this carefully, because if it's taken all the way through court and the
> GPL-only claim rejected, there may well be a run-on effect on all of the
> symbols marked GPL-only. Those who want to thwart proprietary kernel
> modules may find it prudent to generously give up this symbol rather
> than risking the lot.

The GPL flag on the symbols has no legal weight. What does have legal 
weight is whether whatever you're linking into the kernel can be 
considered a derivative work of the kernel or not. The intent of the 
EXPORT_SYMBOL_GPL flag is to warn that if you're using these symbols, 
then you're hooking into something sufficiently internal that you may be 
considered a derivative work. However, using symbols marked GPL in a 
non-GPL module doesn't necessarily mean you're violating the GPL, nor 
does not using them mean you're not. The only one that can give a 
definitive answer for any particular piece of code is likely a lawyer.

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

end of thread, other threads:[~2010-02-04  0:30 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-01-29 14:15 Re-enabling non-GPL driver access to disk partition information Derek Atkins
2010-01-29 14:47 ` Al Viro
2010-01-29 15:09 ` Rik van Riel
2010-01-29 15:38   ` Derek Atkins
2010-01-29 15:23 ` Alan Cox
2010-01-29 22:06 ` Greg KH
2010-01-30  4:02   ` David Newall
2010-02-03  2:10     ` Greg KH
2010-02-03 15:28       ` David Newall
2010-02-04  0:30         ` Robert Hancock

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.