Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

samples: add Rust GPL access test sample #866

Open
wants to merge 1 commit into
base: rust
Choose a base branch
from

Conversation

ojeda
Copy link
Member

@ojeda ojeda commented Aug 15, 2022

Greg asked me to double-check whether we could use GPL symbols from
non-GPL compatible Rust kernel modules.

So I decided to ensure this in the CI via this sample.

Signed-off-by: Miguel Ojeda ojeda@kernel.org

Greg asked me to double-check whether we could use GPL symbols from
non-GPL compatible Rust kernel modules.

So I decided to ensure this in the CI via this sample.

Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
@@ -0,0 +1,53 @@
// SPDX-License-Identifier: GPL-2.0
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this line be:

Suggested change
// SPDX-License-Identifier: GPL-2.0
// SPDX-License-Identifier: Happy Little Accidents License

?

Copy link
Member Author

@ojeda ojeda Aug 16, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The comment on top of module! is intended to clarify this, but maybe I should clarify it further if it is not clear: no, the module is still GPL-2.0 (otherwise, we would have an issue adding it to the kernel) and the bogus value for the license field is only there out of necessity for the test.

I think this is fine, since the SPDX line is what really counts legally and the MODULE_LICENSE is just a technical mechanism to prevent mistakes -- from the docs:

   Loadable kernel modules also require a MODULE_LICENSE() tag. This tag is
   neither a replacement for proper source code license information
   (SPDX-License-Identifier) nor in any way relevant for expressing or
   determining the exact license under which the source code of the module
   is provided.

   The sole purpose of this tag is to provide sufficient information
   whether the module is free software or proprietary for the kernel
   module loader and for user space tools.

and from Thomas Gleixner's commit message:

      - None of the MODULE_LICENSE strings can be used for expressing or
        determining the exact license
    
      - Their sole purpose is to decide whether the module is free software or
        not.

We may still trigger an alarm in the future in some script somewhere when they detect the mismatch (in 5.0, apparently ~25% of modules got it wrong... not sure how things are now :-), but I guess those scripts could have an exception set.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Got it, thanks!

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not at all, thanks to you for checking! :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants