|
|
Log in / Subscribe / Register

A new stable security tree

By Jake Edge
April 13, 2016

The history of the stable kernel tree goes all the way back to some mailing list discussions in 2005. It has clearly been a great success that now spans multiple supported kernel versions, some of which are supported for two years as part of the long-term support initiative and some that are supported for far longer than that. But there have always been worries in some quarters that following the stable kernels—with fairly frequent updates including many patches—might introduce more bugs than would be fixed (at least bugs relevant to a particular user). So, a "security fix only" stable kernel has some appeal, which is exactly what Sasha Levin announced on April 11.

Levin described his "linux-stable security tree" (which is available as a Git tree) as "a derivative tree from the regular stable tree that would contain only commits that fix security vulnerabilities". The repository contains branches and -security tags for all stable series starting with 3.0 (though some of those are now unsupported), which gives an idea of what kinds of fixes he is targeting. Levin plans to support all of the maintained stable kernels with a -security variant. He went on to outline the reasons behind his plan:

Quite a few users of the stable trees pointed out that on complex deployments, where validation is non-trivial, there is little incentive to follow the stable tree after the product has been deployed to production. There is no interest in "random" kernel fixes and the only requirements are to keep up with security vulnerabilities.

Given this, a few projects preferred to delay important kernel updates, and a few even stopped updating the tree altogether, exposing them to critical vulnerabilities.

This project provides an easy way to receive only important security commits, which are usually only a few in each release, and makes it easy to incorporate them into existing projects.

One major problem, of course, is defining what constitutes a "security fix". Greg Kroah-Hartman, who is the founder of the stable trees and still maintains several of them, wondered how Levin would "define 'security vulnerabilities'". He noted that everyone's needs are different, so they should either do the cherry-picking themselves or simply rely on one of the stable trees: "It's not that much churn at all, given the % of the mainline tree". He also pointed out that there are fixes that have gone into the stable trees that weren't recognized as security flaws until long after those trees were released. Anyone who was cherry-picking fixes might well have missed one or more of those and been exposed to vulnerabilities for far longer than necessary.

Levin replied that the security tree would carry patches for "anything that qualified for a CVE plus anything exploitable by a local unprivileged user". He noted that the security trees would simply be "a subset of [its] corresponding -stable tree". But Kroah-Hartman expressed further concern about the goals of the project:

If you only take things you "know" are issues, well, you miss lots of fixes that were really security things but only found out later, so people have to [scramble] to fix their kernels much faster than they needed to.

Putting up a tree like this isn't going to cause people to update their trees any quicker. If they haven't been doing it now, they aren't going to do it with this tree, as their workloads don't allow them to take updated kernel trees.

In short, it's not the fact that we have stable trees that are "too big" for them to take, it's the fact that they just can't take and test updates properly.

But there are plenty of patches that end up in the stable trees that actually introduce bugs, Levin said. He pointed to the number of "Fixes:" tags that refer to commits in the stable tree as an indicator of that. Furthermore:

Look at the opposite side of this question: why would anyone take a commit that fixes a bug he doesn't care about? Are the benefits really worth it considering the risks?

There are also fixes for CVEs that have not made it into the stable tree, he said, typically because they were not sent to the stable maintainers when they were merged and a CVE was requested later once the security implications were known. While Levin did not say so directly, it would seem that the idea is that the maintainers of this new tree could help ensure those fixes get into the stable tree, since that provides the path for them to reach the stable security tree as well. But, he acknowledged that the tree would not be able to achieve "100% success rate, but this is the same story as the stable tree and the patch selection there".

Beyond that, though, Levin said that reviewing a few cherry-picked fixes, rather than the 100+ fixes all over the tree that often come with a stable release will help certain projects:

Projects get to the point they don't want to update their whole kernel tree anymore so that just freezes because they don't want to re-validate the whole thing over and over, but they still cherry pick upstream and out-of-tree commits that they care about.

The stable kernels do tend to have a lot of patches. 4.5.1 had 238, the 4.4 series has had 1004 patches through 4.4.7, and the 3.14 series contains 4580 patches through 3.14.66. The trees in Levin's repository show markedly fewer patches.

Willy Tarreau, who had been maintaining the 2.6.32 stable kernel until its recent end of life, was worried that the use of "security" in the name of the tree will lead users astray:

I tend to think that the term "security" in the tree's name is misleading the users into thinking that what they find there is enough for them. Most incompetent admins think they need only "security" fixes. Maybe you should use the term "minimal" or something like this to indicate that this is the smallest set of fixes that should absolutely be running on any system.

Tarreau suggested an alternate strategy to create an "easily searchable" list of mainline commits that were security fixes. Those could perhaps be put into a tree: "We could even amend the commit messages to mention the CVE id once it's assigned, and sometimes 'relies on this preliminary patch'." But it would be "tough work" and difficult to find someone interested in doing it. In the end, though, he believes the underlying problem boils down to "more of an issue educating our users than an issue with the code we distribute".

Kroah-Hartman agreed with Tarreau about the education problem, but also complained that there are "users that just don't want to upgrade as it's 'hard' for them". There is no real difference in taking 200 patches in an update versus 100, he said, so the "small subset" argument doesn't make sense to him. But Levin had previously suggested that stable-security tree releases might carry on the order of five patches, so it's clear that the two have clashing visions of how it will all play out.

The one participant in the discussion who is strictly a user of the stable kernels (rather than a maintainer and user) was Eddie Chapman. He said that the quality of the stable kernels has always been excellent in his experience; he has run into regressions only rarely and uses the stable tree for "virtually all my own projects, as well as many clients' projects". He agreed with much of what Kroah-Hartman and Tarreau said in the thread and warned: "IMO you deserve everything you get if you only applied the fixes in Sasha's new tree and ignored the stable releases completely."

With that said, though, Chapman is in favor of the new tree. He recognizes that the line between a bug fix and a security fix is blurry, but any assistance in narrowing down which fixes are applied is welcome.

Where I will find this very useful is in having a "place" where I can see what are probably the most important security fixes applicable to the stable trees I am interested in. Because if I may offer one criticism of the kernel stable trees in general, it is that it is very hard to find and identify fixes for known security vulnerabilities. Whenever I want to update the kernel in one of my projects, I find myself having to hunt around a lot for information, stringing together bits from bug reports, mailing lists, git commits, to track down whether or not a particular vulnerability is fixed in a stable tree. Not always, sometimes it is very clear that a particular fix in a particular stable release fixes a known vulnerability, especially with commits e.g. referencing CVEs in the header or commit message. At other times there might be absolutely nothing in the fix to indicate this fixes a known vulnerability.

So anything which improves visibility, which this certainly does, is a good thing in my opinion.

But Tarreau is skeptical that the tree will generally be used in the right way. The security fixes will only appear in it if they are already in the stable tree, which means that fixes that are missed by the stable maintainers (which is common for him, he said) won't be present.

At first I thought "oh cool, a repository of known things that must absolutely be fixed, that will help me do my backports" and in the end I fear it will be blindly used by end users who don't understand what they're missing but who still believe they limit the risk of upgrades.

Chapman agreed that there is a risk, but "I think it is better than no repository". Users who are blindly applying fixes are already in trouble, "so things can't really effectively get any worse", he said. Blindly applying a small set of fixes from the stable-security tree will perhaps help in a relatively small way: "Their situation might then be upgraded from 100% screwed to maybe only 70% screwed".

That's where the conversation trailed off, at least for now. In the end, the proof will be in the pudding. If Levin can provide a tree that is useful to some projects—and perhaps help get some additional fixes into the stable tree itself—it will be a success. If, on the other hand, it ends up causing more headaches than it solves, it seems likely that it will just go away at some point. Only time will tell.


Index entries for this article
SecurityLinux kernel


to post comments

A new stable security tree

Posted Apr 14, 2016 14:00 UTC (Thu) by Seegras (guest, #20463) [Link] (1 responses)

I've got the same concerns as Greg Kroah-Hartman here. I don't think you'll ever know exactly whether the bug you've fixed could also have been a security vulnerability.

And I'm going further than that, I don't run any old "Long Term" kernels, but only the newest stable. Because I think every bug could be a vulnerability, and because any bug fixed is a good thing, and outweighs the cost of a possible regression.

A new stable security tree

Posted Apr 16, 2016 14:10 UTC (Sat) by spender (guest, #23067) [Link]

Evidence shows the latest kernels have the largest number of bugs. If by your statement you think "every bug could be a vulnerability" then in your attempt to avoid vulnerabilities you've actually decided to run a kernel with (demonstrably) the highest number of them.

-Brad

A new stable security tree

Posted Apr 14, 2016 18:51 UTC (Thu) by fandingo (guest, #67019) [Link] (1 responses)

Bunch of bikeshedding if you ask me. It's a "security" tree, not a "secure" tree. There's no guarantee of security -- just that it's a centralized place where work is being done to integrate as many security patches as possible and get them out to users who don't want mainline.

> In the end, the proof will be in the pudding.

FYI: The proof of the pudding is in the eating, not in itself.

A new stable security tree

Posted Apr 17, 2016 20:25 UTC (Sun) by jospoortvliet (guest, #33164) [Link]

I bet Jake expects a hidden knife in that pudding...

A new stable security tree

Posted Apr 14, 2016 21:20 UTC (Thu) by eblau (subscriber, #105388) [Link]

I agree with and applaud Levin's new security tree. I'm currently running the 4.1.x long term support tree. I was recently broken by a change that was accepted in to 4.1.18 that broke the cryptsetup tool and rendered my system temporarily unbootable until cryptsetup was updated.

Full details here:

https://bugs.archlinux.org/task/48230

and the specific comment I agree with here:

https://bugs.archlinux.org/task/48230#comment144315

It should be unacceptable to break user space and doubly so with LTS kernel trees. It's nice to see that there will be an alternative tree that takes a more conservative approach that is less likely to cause breakage for users happy with the kernel release they are on.

A new stable security tree

Posted Apr 15, 2016 0:09 UTC (Fri) by dlang (guest, #313) [Link]

If the update isn't provided by the distro, the type of people who are afraid to take -stable patches won't take these either.

It doesn't matter if it's only 1 patch, these are the same people who run 5-8 year old versions of things with no backported fixes because they aren't 'allowed' to use something not provided by the distro.

Less is more

Posted Apr 15, 2016 8:08 UTC (Fri) by johannbg (guest, #65743) [Link]

Fragmenting the kernel further then it already is not a wise choice to do, let alone basing that fragmentation on someone's perception of security ( it's either a bug or design flaw, no more no less, so treat it as such ) and a fragmented community's around vulnerabilities and exposures ( today CVE tomorrow DCVE, OVI, DWF etc, each cross referencing each other for added obfuscation fun ) but hey let's do that anyway and slap the security in the name of tree because that makes it sooooo muuchhh mooore secure. Hurray for bright ideas <sigh>

A new stable security tree

Posted Apr 15, 2016 9:24 UTC (Fri) by error27 (guest, #8346) [Link] (1 responses)

Instead of amending the commit message with the CVE, we could do what Eugene Teo used to do and maintain a tree with the CVE commits tagged. Then you can do `git tag -l | grep 2016` to see all the CVEs
issued this year.

Most kernel devs don't bother with the CVE process. If you look through the CVE lists you can see that the xen and keys subsystems use CVEs. Redhat and Suse file for CVEs. If the CVE requires help from security@kernel.org, those get a CVE when they are forwarded to linux-distros. Otherwise it's mostly up to the reporter to file for a CVE. Perhaps in the kernel CCing stable is sort of a substitute for filing a CVE, but a lot of other bugs go to stable besides security issues.

Anyway, it would be nice if we had that kernel-auditing mailing list. It died from lack of interest in the old days but it might work these days. I would join.

A new stable security tree

Posted Apr 16, 2016 3:36 UTC (Sat) by eugeneteo (guest, #108261) [Link]

Here's the post I sent about CVE tagged Linux kernel git repositories https://lkml.org/lkml/2010/12/1/571. You can either create new tags or branches for upstream security patches. I still think this is useful, and I hope to see someone continue with my work. Thanks!

A new stable security tree

Posted Apr 18, 2016 4:43 UTC (Mon) by marcH (subscriber, #57642) [Link] (2 responses)

> He recognizes that the line between a bug fix and a security fix is blurry,...

Yet there are plenty fixes which are clearly on one side or the other.

There seems to be people in this discussion who can't understand that for a professional sysadmin the consequences of a (typically rare) crash are totally different than the consequences of an (often certain) breach.

There's also an important and practical risk difference between a yet undiscovered or largely secret vulnerability versus one known by every script kiddie in the universe. In simpler terms: not all but most of us just get on with our lives despite being "hackable" (or hacked) by the NSA. Ransomware seems much less fun.

> The stable kernels do tend to have a lot of patches. 4.5.1 had 238, the 4.4 series has had 1004 patches through 4.4.7, and the 3.14 series contains 4580 patches through 3.14.66. The trees in Levin's repository show markedly fewer patches.

These numbers tell more than all the rest of the discussion.

Based on the "a bug is bug" motto, do the 3.14 maintainer(s) really think there were 4580 real + potential vulnerabilities in 3.14? (And that 4580 patches can be completely regression free?)

Congratulations to Levin for resisting the approach "Bugs are too hard to grade so let's not even try" approach and best of luck.

A new stable security tree

Posted Apr 18, 2016 8:25 UTC (Mon) by NAR (subscriber, #1313) [Link] (1 responses)

The problem is that some of the bugs are potential vulnerabilities for some and unnecessary churn for others. Take this example from the 3.14.64 changelog:

Justin Maggard (1):
cifs: fix out-of-bounds access in lease parsing

Maciej W. Rozycki (1):
MIPS: traps: Fix SIGFPE information leak from `do_ov' and `do_trap_or_bp'

Are they potential vulnerabilities? If you're using cifs or running on MIPS, they are. If not, they aren't. Should these go into that security tree?

A new stable security tree

Posted Apr 18, 2016 10:48 UTC (Mon) by itvirta (guest, #49997) [Link]

Apart from maintainer time taken, patches like that shouldn't have any downsides either if you're not using CIFS or MIPS.
Churn sounds a bit negative, I'd just call them irrelevant.


Copyright © 2016, Eklektix, Inc.
This article may be redistributed under the terms of the Creative Commons CC BY-SA 4.0 license
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds