5

I've found that my most recent project has been taking a significant portion code from a GNU GPL code base. While i’m aware that the nature of copyright law allows for such usage, I’m unclear about the concept of ‘fair use’ as it pertains to code.

Specifically, I’m wondering how much of a given work of software can be claimed under fair use? I understand that this might vary based on jurisdiction and the specific license of the software, but any general guidance or resources to understand this better would be greatly appreciated.

tuskiomi
  • 151
  • 7
  • Very definitely related, possibly actually a duplicate: How much is "substantial portion" in MIT licence?; in particular I'd echo the statement from the answer there: "assume that it applies to any portion, no matter the size." – Philip Kendall Mar 26 '24 at 21:48
  • @PhilipKendall this is only one portion of fair use, there are many other factors. I would also like to politely reject the idea that a substantial portion is any portion, as that goes against nearly every ruling on copyright's fair use test regarding the substantiality of a claimed work, at least in the US. – tuskiomi Mar 26 '24 at 21:50
  • But in an open source context, do you want to be that test case? I feel at this point this question would be better suited for Law SE, because there's nothing actually specific to open source about it - it applies equally to all code. – Philip Kendall Mar 26 '24 at 21:55
  • My thought process was that Open source is more suited for this question as enforcement of open source is exclusively built on copyright & contract law, as well as this question being about code specifically. I'm happy to move it if your thoughts are the consensus. – tuskiomi Mar 26 '24 at 21:57
  • The code you are using is covered under a license contract, not just copyright. Does the license allow for re-using the covered code in another project? – doneal24 Mar 27 '24 at 16:02
  • @tuskiomi You're not just quoting a few lines of text out of context though. By your description though, you are using that GPL code for its intended purpose within your own project, without adhering to the license terms. That clearly falls foul of any definition of "free use". – Graham Mar 27 '24 at 22:10
  • @tuskiomi you've now accumulated several answers to your question. Could we ask that you either accept one or clarify what in your original question remains, to your mind, unanswered? Accepting answers to questions is part of the community compact here, and drives the site's reputation system for both asker and answerer. (My apologies if you already know this.) – MadHatter Mar 28 '24 at 06:08
  • What do you mean by "you've found that it's been taking a significant portion of code". In copyright, there is a significant difference between "I took code from this other project" and "I wrote some code and it happens that it's very similar some other code elsewhere". So, which case applies to your situation? – Brandin Mar 28 '24 at 08:14
  • @MadHatter Not yet. I'm awaiting a response / edit to one of the current answer. – tuskiomi Mar 28 '24 at 17:33
  • The answer you're waiting for is well into the field of professional legal advice, which we don't give (and which those who do give, charge for). If that's your only reason for not accepting Bart's answer, the question may risk getting closed instead. – MadHatter Mar 28 '24 at 17:45
  • @MadHatter let's close the question then. – tuskiomi Mar 28 '24 at 18:13
  • @tuskiomi Taking what you believe to be a significant amount of code from a GPL project without respecting the license certainly violates the spirit of the license. Ethically, that alone should be reason enough not to do it, even if you might have some chance of getting away with it. – Lily Finley Mar 28 '24 at 22:55
  • Three. It takes three licks. - General guidance is : you have money that they can sue you for, or you are in any way shape or form preventing them revenue. – Mazura Mar 29 '24 at 03:04
  • I’m voting to close this question because the original poster has indicated that (s)he is after professional legal advice, which we don't (and can't) give. – MadHatter Mar 29 '24 at 06:16

3 Answers3

18

Fair use is not a right that you have, but it is a way to defend yourself against a claim of copyright infringement. In the end, it is a judge who decides if your use of the copyrighted work falls under the fair use doctrine or not.

In determining if something is fair use, four factors are considered:

  1. For what reason the re-use occurred. If you quote parts of a work to give context to the critique you are writing, that is more likely to be ruled fair use than if you copy something just to save yourself the time of writing code with a similar functionality.
  2. The nature of the copyrighted (original) work. This seems to relate largely to if the work should be protected by copyright in full, or if if it contains parts that are not subject to copyright protection.
  3. The amount and substantiality of the re-use. This is the point that relates to the amount of code that you copied.
  4. The effect of the re-use on the potential market of the original. If your re-use is in competition with the original, or even if you could have obtained a license for your re-use, then it is less likely to be considered fair use.

When looking at open-source software, the fourth consideration is likely to be a killer against using the fair use defense. A license to use the code, and even to transform it, is available, so just pay the price and be done with it (where the price is not necessarily a money transfer to the suppliers of the code).

MadHatter
  • 48,547
  • 4
  • 122
  • 166
Bart van Ingen Schenau
  • 29,549
  • 3
  • 46
  • 83
  • 9
    +1 from me. I'd also note that free software tends to travel internationally, and fair use "rights" are not as elastic everywhere else as they are in the US. The UK, for example, doesn't have them at all; it has "fair dealing" exceptions instead, and I don't believe your proposed use comes under any of the activities covered by fair dealing. I really encourage you, as I think Bart does, not to play fast and loose with the GPL; if you've used copyleft code, accept that your code will also need to be copylefted. – MadHatter Mar 27 '24 at 08:25
  • 6
    Companies that produce commercial software, and have an organised view of open source, generally presume that the amount of GPL source they can incorporate is zero. – John Dallman Mar 27 '24 at 16:18
  • In some cases, the scènes à faire doctrine may protect certain snippets of code. Copying something like: do {} while(!(UART0->TXSTAT & UART_TXSTAT_TXREADY)); UART0->TXREG = data; from a piece of code shouldn't be viewed as copyright infringement, because on a particular processor, if one uses the documented names for I/O registers, there really wouldn't be a whole lot of room for creativity. Sure one might use !=0 instead of the ! operator, but if the symbol names are supplied in the target chip vendor's reference manual, the notion of "wait for thing to become ready, then write it"... – supercat Mar 27 '24 at 22:21
  • ...is sufficiently commonplace that many such constructs are inherently non-copyrightable. – supercat Mar 27 '24 at 22:22
  • @Bart the official criterion for number 4 is whether or not the derivative 'usurps the market' of the base work. I'm a bit skeptical that ANY work could usurp the market for a freely distributed open source work, except a derivative distributed under a less-restrictive license. I'm also unclear how the ability to obtain a license contributes to usurping the market. Can you explain this further? – tuskiomi Mar 28 '24 at 02:23
  • 1
    @tuskiomi, Wikipedia prtobably explains it better than I could: https://en.wikipedia.org/wiki/Fair_use#4._Effect_upon_work's_value – Bart van Ingen Schenau Mar 28 '24 at 08:11
  • 3
    @supercat, I expect your example to fall under the Merger doctrine, because there are so few ways to use the (hardware) API and get the desired effect. That is a completely different concept than fair use. – Bart van Ingen Schenau Mar 28 '24 at 08:14
  • For point 2, it sounds to me like you're confusing this with "scènes à faire" or the abstraction-filtration comparison test; which I believe are separate considerations from fair use (fair use deals with things that you copied which definitely are protectible). For factor 2, most descriptions I've seen say that the "nature" is about what kind of work we're talking about. E.g. whether it's a poem or a work of art, or whether it's a non-fiction biography. See https://copyright.columbia.edu/basics/fair-use.html – Brandin Mar 28 '24 at 08:23
  • @BartvanIngenSchenau: Indeed, but many people interpret some of the justifications for using small snippets as being part of "fair use" despite the fact that they're separate, and it's important to note that excluding some such usages from "fair use" doesn't imply that they're not justifiable under other legal doctrines. – supercat Mar 28 '24 at 14:42
  • I'm still not conviced on #4, wikipedia seems to cite an inapplicable court case referenced when it says "This consideration has weighed against commercial copy shops that make copies of articles in course-packs for college students, when a market already existed for the licensing of course-pack copies.", but if we look at the case cited (Princeton Univ. Press v. Mich. Document Servs., Inc., 99 F.3d 1381), the court ruled should defendant’s conduct become widespread, plaintiffs’ licensing revenue stream would “shrivel.”. This cannot be the case for ANY open source work. – tuskiomi Mar 28 '24 at 15:22
  • so then the question remains, what market damage could be done, and how would the courts evaluate this? – tuskiomi Mar 28 '24 at 15:26
  • @tuskiomi, one way to evaluate the market damage is to estimate the cost of developing the code in question -- by violating copyright, you are harming the developer's ability to get paid for their work. This can go up fast -- for example, SLOCCount estimates that LibJPEG (a library for reading and writing JPEG images) is worth about a half-million dollars. – Mark Mar 28 '24 at 23:27
  • @Mark how is a developer getting paid for his/her GPL work? – tuskiomi Mar 29 '24 at 01:06
  • 1
    @tuskiomi, by selling it to people who don't want to comply with the GPL. – Mark Mar 29 '24 at 01:25
5

There's no international fair use doctrine, so it varies by jurisdiction. That means relying on "Fair Use" might not be very helpful, if you don't want a resulting software product derived from it to be restricted to the more permissive jurisdictions.

T.E.D.
  • 229
  • 1
  • 3
3

In this particular case, the answer is: none

fair use is any copying of copyrighted material done for a limited and “transformative” purpose, such as to comment upon, criticize, or parody a copyrighted work. (source)

What you are describing is the creation of a derivative work, which falls entirely under copyright laws the moment you use any of the original code at all.

And since the GPL is a copyleft licence, by using code that is covered by the GPL, your entire software can now be distributed only under the terms of the GPL. Thank you for your (involuntary) contribution to Free Software.


The way to avoid this scenario is to either write all the code internally, or if you absolutely want to copy how someone else did it without getting into copyright issues, to use a clean-room implementation where the people actually writing the code never see the design you are copying and instead have it explained to them by those who have. With good procedures and extensive documentation of what exactly passed between these two teams.

In most cases, proper clean-room implementations are more effort than just writing it all from scratch.

MadHatter
  • 48,547
  • 4
  • 122
  • 166
Tom
  • 139
  • 4
  • As wIkipedia notes, "viral license" is a pejorative term, and not everybody round here is all that keen on it. – MadHatter Mar 27 '24 at 21:05
  • @MadHatter I'm a big GPL fan and don't consider it insulting or anything. But if you have a better term the expresses teh same meaning, feel free to suggest an edit. – Tom Mar 27 '24 at 21:47
  • OK, thanks, I've done that. – MadHatter Mar 28 '24 at 06:05
  • It's not clear to me that copying code from an open source project necessarily constitutes creating a derived work in every case. Also, you are right that creating derived works is an action protected by copyright, but it is not clear why you are ignoring the OP's point about fair use (which would be a potential defense against against copyright infringement claims arising from creating a derived work without permission). – John Bollinger Mar 28 '24 at 15:21
  • 1
    @JohnBollinger creating a derivative work is NOT a form of fair use. Fair use is if you quote a small piece of a copyrighted work to report on it, comment on it, make fun of it, etc. But the OP's company specifically copies a piece of code to save themselves the effort of writing it from scratch. This is not an instance of fair use. – Tom Mar 28 '24 at 16:53
  • You seem to be making a category error, @Tom. Fair use is not a specific kind of use of copyrighted material. It is a specific kind of legal defense against a claim of copyright infringement. For example, suppose I create a parody of a popular song. The result is absolutely a derivative work of the original song. And creating that derivative is almost certainly protected in the U.S. under the fair use doctrine. Creating a derivative work definitely can be protected as a fair use of copyrighted material. – John Bollinger Mar 28 '24 at 17:10
  • @JohnBollinger I'm aware of the legal details, the "transformative" nature of fair use, etc. - but you see, a parody is exactly the kind of stuff fair use was made for (comments, journalism, parody, etc.). Taking someone else's code and using it in your code is not, it is very clearly a derivative work. See https://www.copyright.gov/circs/circ14.pdf for more details. – Tom Mar 28 '24 at 20:02
  • @Tom, this answer claims that the OP's use of the GPL work in question could not be protected under the fair use doctrine because it constitutes creating a derivative work. That clearly is not a valid argument, as the parody example demonstrates. More generally, you seem to be making assumptions -- probably warranted, but assumptions nonetheless -- about the nature of the OP's use of the copyrighted work. There just isn't enough information provided to make a good analysis. – John Bollinger Mar 29 '24 at 12:56
  • @JohnBollinger I don't see what could be misunderstood or is missing from the OP question when he clearly states that a project they're working on has taken considerable amounts of code (which in itself voids a fair use defense) from a GPL project. It really is very simple: OP wants to copy GPL code without abiding by the GPL and is wondering if "fair use" is a magic bullet that'll allow him to do so. And the answer is very clearly no. – Tom Mar 29 '24 at 13:26