lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <Zqv9BOjxLAgyNP5B@hatbackup>
Date: Thu, 1 Aug 2024 17:24:20 -0400
From: "John B. Wyatt IV" <jwyatt@...hat.com>
To: Shuah Khan <skhan@...uxfoundation.org>
Cc: linux-pm@...r.kernel.org, Thomas Renninger <trenn@...e.com>,
	Shuah Khan <shuah@...nel.org>,
	Linus Torvalds <torvalds@...ux-foundation.org>,
	Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
	linux-kernel@...r.kernel.org, John Kacur <jkacur@...hat.com>,
	Tomas Glozar <tglozar@...hat.com>,
	"John B. Wyatt IV" <sageofredondo@...il.com>
Subject: Re: [PATCH 0/2][RFC] Add SWIG Bindings to libcpupower

Addressing the licensing first:

> On Tue, Jul 30, 2024 at 02:48:41PM -0600, Shuah Khan wrote:
> > On 7/24/24 16:11, John B. Wyatt IV wrote:
> > Note that while SWIG itself is GPL v3+ licensed; the resulting output, the
> > bindings code, is permissively licensed. Please see
> > https://swig.org/legal.html for more details.
> 
> Adding Linus and Greg for their feedback and input on this proposal.
> 
> What does it mean by "the resulting output, the bindings code is
> permissively licensed."
> 
> I would like to get a better understanding of the licensing angle
> since this code adds dependency on SWIG which is GPL v3+ to build
> the proposed python bindings.

Copying and pasting from the link above:

/begin

The intention of the SWIG license is to ensure that the SWIG source code (the
code that is compiled into the SWIG executable) remains free software by using
the GPL license on the SWIG source code. SWIG is a code generator and
the intention of the SWIG license is also to enable distribution of the output
code under license terms of the user's choice/requirements. 

[snip html license links]

When SWIG is used as it is distributed by the SWIG developers, its output is
not governed by SWIG's license (including the GPL). SWIG's output contains
code from three sources:

* code generated by SWIG, which is not governed by copyright;
* code copied from the SWIG library which is permissively licensed to be
redistributed without restriction;
* code derived from the user's input, which may be governed by the license of 
he code supplied by the user.

So, while the input supplied to SWIG may affect the license of SWIG's output
(e.g. if the input code is licensed under a copyleft or proprietary license),
SWIG's license does not affect the license of the output. This is consistent
with the FSF's FAQ entries on this subject (GPLOutput and 
WhatCaseIsOutputGPL), because the SWIG code copied into the output by 
SWIG is not GPL-licensed. 

/end

The output of SWIG depends on SWIG's library which is permissively
licensed + the license of the .o files used, which is libcpupower, which is
GPLv2 licensed. Therefore, any bindings generated from libcpupower is GPL v2.

SWIG Library and Examples license:

 The SWIG library and examples, under the Lib and Examples top level 
 directories, are distributed under the following terms:

  You may copy, modify, distribute, and make derivative works based on
  this software, in source code or object code form, without
  restriction. If you distribute the software to others, you may do
  so according to the terms of your choice. This software is offered as
  is, without warranty of any kind.

The snipped license links link to the GPL v3, SWIG's declaration of the GPL 3 or
a later version with the above permissive declaration for output, and a link
to four university licenses that all look permissive.

https://swig.org/Release/LICENSE-UNIVERSITIES

The resulting generated code can be linked and distributed with GPL v2
binaries. I am not a lawyer, but this is my understanding of what they
declare on their website above.

Please let me know if this clarifies this.

>
> On 7/24/24 16:11, John B. Wyatt IV wrote:
> > SWIG is a tool packaged in Fedora and other distros that can generate
> > bindings from C and C++ code for several languages including Python,
> > Perl, and Go. We at Red Hat are interested in adding binding support to
> > libcpupower so Python tools like rteval or tuned can make easy use of it.
> > 
> 
> Can you elaborate on the use-case and what rteval currently does and
> how it could benefit from using libcpupower with the bindings?

rteval is a Python program used to measure realtime performance. We wanted to
test the effect of enabling some levels of idle-stat to see how it affects
latency, and didn't want to reinvent the wheel. We thought that the Python
bindings could be useful to other people as well who might want to call
cpupower too from Python. I did some testing and was able to achieve this with
SWIG. We sent the patchset to see what folks thought about this.

> 
> > 
> > Another question is do you want more test files like the .py example? Would
> > this be used as part of a greater test suite?
> 
> I would like to see document outlining the dependencies and examples of how
> this would be used. I see the README which says that
> 
> "Next you will need to install SWIG. Using Fedora:"
> 
> The document will have to include more than Fedora instructions. Instead
> of a README I would like to see a document.

Understood. I wanted to get an idea of how we would structure the makefile
first.

-- 
Sincerely,
John Wyatt
Software Engineer, Core Kernel
Red Hat


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ