openssl as a system library

Kees Cook kees at ubuntu.com
Mon Jun 10 21:09:01 UTC 2013


Hi,

On Wed, May 01, 2013 at 03:28:31PM +0100, Colin Watson wrote:
> On Wed, May 01, 2013 at 11:25:17AM +0100, Dave Walker wrote:
> > I would like openssl to be considered a system library in Ubuntu.  As
> > a developer, it seems very clear to me that it is essentially treated
> > as such with it's penetration in packages probably as common as other
> > shared libraries.
> 
> The key phrase in the GPL (at least v2) is "unless that component itself
> accompanies the executable".  Debian and Fedora (to take two examples)
> have historically disagreed about the interpretation of this phrase.
> The Debian position is explained in
> http://lists.debian.org/debian-legal/2002/10/msg00113.html, and in this
> case boils down to "if we're shipping both mongodb and openssl, Debian
> is a single OS and that constitutes the component accompanying the
> executable".
> 
> I'm afraid I agree with Debian's position on this and disagree with
> Fedora's, and would similarly require for Ubuntu that any GPLed package
> linking against OpenSSL contain an explicit exception sufficiently
> general to apply to both us and to people who make derivative works
> based on our package or who mirror our package.  If the upstream thinks
> that it does not infringe upon their particular requirements to use
> OpenSSL then in general we ought to be able to extract such an exception
> from them, while if they do think that it's an infringement then we
> shouldn't be shipping it that way anyway.

I agree that upstreams should pursue an explicit exception, if for no other
reason than it takes the guess work out of it.

That said, when I read the GPL, and consider the OS a monolithic thing,
and the software to add as a delivered blob of code, the exception is
clearly in favor of allowing the use of OpenSSL. Everything we need to
execute is already on the OS, and we install the single package, and it
works. OpenSSL is not bundled with the software, so we're fine.

> A further reason beyond Steve's explanation in the linked mail why I am
> wary of ever attempting to use the system library exception for
> libraries shipped as part of Ubuntu is that I think it's a subversion of
> the original intent of that clause of the GPL.  My understanding is that
> the original reason that clause is there was to permit distributing
> GPLed executables for non-free operating systems where for instance the
> C library was not available under a GPL-compatible licence; the
> bootstrapping problem there is obvious and it makes sense for the GPL to
> have provision for that case.  The GPL FAQ gives a modern example of
> distributing a binary linked against the Windows Visual C++ runtime
> library, and says (for GPLv2, I think) "To prevent unscrupulous
> distributors from trying to use the System Library exception as a
> loophole, the GPL says that libraries can only qualify as System
> Libraries as long as they're not distributed with the program itself".

I think the trouble comes from trying to decide if Ubuntu (or Debian)
is a monolithic OS. There is confusion because it appears that OpenSSL
is not _required_ to run the OS.

Here's the full sentence from the GPLv2:

"However, as a special exception, the source code distributed need not
include anything that is normally distributed (in either source or binary
form) with the major components (compiler, kernel, and so on) of the
operating system on which the executable runs, unless that component itself
accompanies the executable."

To me, "normally distributed" distinctly covers OpenSSL. It is in wide use,
and I consider it a rather critical piece of the system stack. I understand
"unless [OpenSSL] accompanies [software]" as meaning "living in the same
package", not "living in the same archive".

Since Ubuntu is installed from separate packages, I believe OpenSSL
does not "accompany" the software that uses it. Additionally I feel that
OpenSSL _is_ "normally distributed" with the rest of the OS. So to me,
there is no problem here.

As an additional note, my interpretation of the purpose of the GPL here is
to make sure all source is available. And to that end, we're dancing around
trying to understand this exception for a case where the thing in question
(OpenSSL) has full source available. So to me, we're again in good shape
since the point isn't to use some proprietary crypto library, but rather to
use this other piece of free software (that has some glitches in its
license wording).

> Now, MongoDB appears to be AGPLv3, and the GPLv3 is a bit more specific
> here.  It's thus worth a little reanalysis based on the text of the
> GPLv3.  Here it is:
> 
>     A "Standard Interface" means an interface that either is an official
>   standard defined by a recognized standards body, or, in the case of
>   interfaces specified for a particular programming language, one that
>   is widely used among developers working in that language.
>   
>     The "System Libraries" of an executable work include anything, other
>   than the work as a whole, that (a) is included in the normal form of
>   packaging a Major Component, but which is not part of that Major
>   Component, and (b) serves only to enable use of the work with that
>   Major Component, or to implement a Standard Interface for which an
>   implementation is available to the public in source code form.  A
>   "Major Component", in this context, means a major essential component
>   (kernel, window system, and so on) of the specific operating system
>   (if any) on which the executable work runs, or a compiler used to
>   produce the work, or an object code interpreter used to run it.
>   
>     The "Corresponding Source" for a work in object code form means all
>   the source code needed to generate, install, and (for an executable
>   work) run the object code and to modify the work, including scripts to
>   control those activities.  However, it does not include the work's
>   System Libraries, or general-purpose tools or generally available free
>   programs which are used unmodified in performing those activities but
>   which are not part of the work.  For example, Corresponding Source
>   includes interface definition files associated with source files for
>   the work, and the source code for shared libraries and dynamically
>   linked subprograms that the work is specifically designed to require,
>   such as by intimate data communication or control flow between those
>   subprograms and other parts of the work.
> 
> Now, first, we must consider whether it is possible to regard OpenSSL as
> a System Library here.  I am not entirely sure I understand the
> qualification in (a), but I think that it's trying to talk about glue
> libraries that you need to make use of system facilities: for example,
> in this model libc is merely a library that enables use of the work with
> the system's kernel.  But, in any case, if we only consider (b) (which
> we can do since it's "and"), OpenSSL does not merely serve to enable use
> of a work with anything (it provides significant facilities itself), and
> it does not implement a Standard Interface in any reading I can make of
> that term (this is usually interpreted to mean "if the GPL-incompatible
> library is just one choice of many that plug into the same generic slot,
> then it doesn't matter" - but the problem at hand here only arises
> because it hasn't been made to work with GnuTLS!).

I think another reading of "implement a Standard Interface" could describe
the crypto communication side. The protocols OpenSSL implements are very
public, so that seems to count. And even if not, since OpenSSL tends
to be the cross-platform defacto standard for crypto communications,
I would think "in the case of interfaces specified for a particular
programming language, one that is widely used among developers working
in that language." counts too. (See examples for OpenSSL in "Secure
Programming Cookbook for C and C++", or how it is the recommended way to
implement SSL in Wheeler's Secure Programs HOWTO:
http://www.dwheeler.com/secure-programs/Secure-Programs-HOWTO.html#CRYPTO )

Additionally there is the note "is available to the public in source
code form" for which OpenSSL certainly is again, which seems to follow
my earlier assumption about wanting to make sure all source is available
to the end user.

> Secondly, we need to consider whether OpenSSL meets the requirements of
> "general-purpose tools or generally available free programs which are
> used unmodified in performing those activities but which are not part of
> the work".  The example that follows appears to suggest that this is for
> things you use using narrow arm's-length interfaces, for example forking
> sed and reading its output, and it specifically calls out "shared
> libraries ... that the work is specifically designed to require" as
> cases that still fall under Corresponding Source.  Again, if MongoDB
> were not specifically designed to require OpenSSL - if it were possible
> to plug in something like GnuTLS - then we wouldn't be having this
> discussion in the first place.

Well, since I still consider it a system library, this isn't something
that needs to be considered. But if I did, I think this isn't really a
concern since the source for OpenSSL IS available.

> So I'm afraid that, while the reasoning does seem to differ for the
> GPLv3, I think the general position still stands.  In fact, since it
> isn't grounded in a dispute about whether two packages we ship
> "accompany" each other, the argument seems if anything stronger for the
> (A)GPLv3.

And ironically, I find the GPLv3 has even more support for my position. :)

> > One of the common bug and feature requests we get is squid to support
> > SSL[0][1].  We know that a significant volume of openssl users, take
> > the source package and make minimal modifications to rebuild it
> > locally, with openssl support.  Judging from the bug reports, this
> > also seems to affect ubuntu.com’s services that use SSL (ie, the
> > Ubuntu packages are not even fit for Ubuntu infrastructure).
> 
> In this specific case, at least one squid upstream developer has
> explicitly stated fairly recently that it's a violation to distribute
> squid linked against OpenSSL, so I have an extremely hard time seeing
> how we could possibly start doing so without a similarly explicit
> statement of permission, regardless of any unilateral decision about how
> we interpret the system library exception:
> 
>   http://www.squid-cache.org/mail-archive/squid-dev/201206/0075.html

How they choose to distribute compiled Squid binaries doesn't exactly
determine how Ubuntu should, though.

-Kees

-- 
Kees Cook



More information about the technical-board mailing list