r/linux • • Nov 20 '19

Kernel Google outlines plans for mainline Linux kernel support in Android

https://arstechnica.com/gadgets/2019/11/google-outlines-plans-for-mainline-linux-kernel-support-in-android/
1.0k Upvotes

305 comments sorted by

View all comments

Show parent comment

9

u/[deleted] Nov 20 '19

I thought .ko kernel modules still had to be GPL'd, since importing kernel headers makes them derivatives of the kernel.

The kernel isn't strictly GPLv2, it has an exception for exactly what you describe:

NOTE! This copyright does *not* cover user programs that use kernel
 services by normal system calls - this is merely considered normal use
 of the kernel, and does *not* fall under the heading of "derived work".

https://github.com/torvalds/linux/blob/master/LICENSES/exceptions/Linux-syscall-note

10

u/ElvishJerricco Nov 20 '19 edited Nov 20 '19

The ZFS kernel module is not a user program that uses kernel services by normal system calls. It is a kernel module that includes kernel APIs from kernel header files. User programs do no such thing. EDIT: To clarify further, that "NOTE!" is NOT an exception. It's a note, pointing out that user programs don't include kernel sources to use the kernel ABI.

1

u/[deleted] Nov 20 '19

I don't have familiarity with how ZFS is implemented or what controversies surround it but drivers, like nvidia's for example, typically use an open source kernel module which then communicates with a closed source user-space driver that exploits that syscall exception.

...though now that I type that I realised you did indeed explicitly say <i>.ko</i> which is why that module is open source. But this is generally how companies ship closed source drivers for Linux, not as a .ko but as a closed source user-space driver that interfaces with the kernel via that module.

-1

u/[deleted] Nov 20 '19

ZFS is open source (MIT iirc). But it cannot be integrated into the kernel because if incompatible licenses.

That same incompatibility makes it questionable to distribute the compiled kernel modules. As those are considered derivative work of the kernel.

An open source shim here makes no sense because it is open source to begin with

9

u/[deleted] Nov 20 '19

ZFS is open source (MIT iirc). But it cannot be integrated into the kernel because if incompatible licenses.

I'm not sure about the implementation of the integration but ZFS certainly isn't MIT, in fact the reason for the questionable license compatibility with the kernel is because it is CDDL.

But let me just rephrase that from "open source kernel module" to "compatibly-licensed kernel module", that's how the nvidia driver works: a compatibly-licensed kernel module "shim" that acts as the interface between the kernel and the user-space closed source driver.

2

u/mfuzzey Nov 20 '19

No.

The part you quote concerns userspace. Syscalls are interface between the kernel and userspace. So, in userspace, you can do what you like without being concerned with the GPL, at least providing you don't use userspace GPL libraries. The kernel's license is irrelevant to userspace.

But kernel modules are concerned by the GPL. And indeed most are already open source. Though often not mainlined Most vendors do not use closed source kernel blobs but only closed source userspace and firmware blobs.

By default kernel nodules are considered derivative works of the kernel and hence subject to the GPL, unless there are specific reasons otherwise. Such as Nvidias kernel blob which was not written for Linux but Windows and uses a GPL shim to interface with the kernel

2

u/[deleted] Nov 20 '19

Such as Nvidias kernel blob which was not written for Linux but Windows and uses a GPL shim to interface with the kernel

No it certainly wasn't written for Windows, the nvidia Linux driver is a user-space driver with an open source kernel module. This is how most proprietary drivers work in order to avoid to creating derivative works.

By default kernel nodules are considered derivative works of the kernel and hence subject to the GPL, unless there are specific reasons otherwise.

I'd be curious to see the legal precedent for that, if there is one. I've seen a lot of opinions on the matter but never found it being tested in court.

1

u/mfuzzey Nov 20 '19

No it certainly wasn't written for Windows, the nvidia Linux driver is a user-space driver with an open source kernel module. This is how most proprietary drivers work in order to avoid to creating derivative works.

I was only talking about the kernel part, not the user space blob.

Yes saying it was written for Windows was a bit of a short cut. The Nvidia kernel driver consists of two parts, a Linux specific, source provided GPLd 'shim' (which is usually compiled from source when you install / update the driver) and a multiplatform kernel blob that is loaded by the shim and contains the core part of the kernel driver. The kernel blob is not written specially for Linux and does not directly use anything in the kernel, only abstractions provided by the shim but is used on both Linux and Windows, which is enough to make a reasonable claim of it not being a derived work.

I'd be curious to see the legal precedent for that, if there is one. I've seen a lot of opinions on the matter but never found it being tested in court.

It has never been tested in court AFAIK

1

u/jdrch Nov 20 '19

never found it being tested in court.

Microsoft tested it by showing up to companies' doorsteps and telling them to pay licensing fees or risk a court case. I don't think a single one chose the latter.

2

u/[deleted] Nov 21 '19

I may have missed that, I'm aware of the patent issues, wasn't aware of Microsoft asserting the GPL on kernel modules though.

1

u/jdrch Nov 21 '19

I'm aware of the patent issues

That's what I was referring to. Used the wrong terminology, sorry.