Unsafe at any clock speed: Linux kernel security needs a rethink
arstechnica.com
arstechnica.com
There are engineers from multiple vendors collaborating on this project, and they have been using the kernel-hardening list for traffic control and for an initial review of the patches before asking that they be pulled. The progress section of this LWN article[3] shows that they've been quite successful so far --- or perhaps, it would be more accurate to say they've made a good start.
[1] https://lwn.net/Articles/662219/
[2] http://www.openwall.com/lists/kernel-hardening/
[3] https://lwn.net/Articles/698827/https://www.youtube.com/watch?v=aMkCKeZ8xZw
All the available videos from the Linux Security Summit are listed here:
Patch and release only works against inept opponents, and there are more non-inept opponents. It won't work against opponents who can develop or buy their own exploits. Patch and release gives the illusion of working because it stops vast numbers of inept attacks from clowns who just want to send spam emails.
Someone in military base security once said that you have to avoid tying up too much of your resources chasing kids throwing rocks at the perimeter fence. The real threat is the janitor who has access to the spare parts stores. Patch and release, and pattern-matching virus scanners, are chasing kids throwing rocks.
His point is that cars used to be built assuming there would never be an accident. They were very comfortable until you crashed into something, and then everyone died. Today cars are built defensively, so that when the unforeseen happens, you are still protected.
That's the idea. Building in defenses that protect you against unknown bugs and exploits.
If you want to think of this in the car safety analogy then consider all possible ways of killing someone in a car before and after the changes in safety standards. In the bad old days random events could kill you but if you had a targeted attacker they could use the same techniques and just drive a car into you, or force you into a wall. Now with newer safety standards the chance that a random event would kill you is much reduced, but the targeted attacker (assuming they don't just fire a bunker buster at you) needs to spend time researching the type of car, finding weak points, developing something to exploit those weak points etc.
So it goes with exploit mitigations. It wasn't that long ago that running a fuzzer on a product (and sadly fuzzers are still useful) would yield a massive amount of trivially exploitable bugs. These days, not as much, at least in mature platforms. You could think of the fuzzer discovered "random" bugs to be the case exploit mitigations are trying to protect against (re random collisions which car safety protect against). Even the simplest stuff like stack cookies make exploitation significantly harder. Are there no stack overflow bugs? Nope they still exist. Are they completely unexploitable? Nope, especially in the hands of a skilled attacker. Are you protected against randomly introduced bugs which cause a stack overflow and have a low chance of having some useful behaviour which makes them exploitable? Absolutely.
Honestly if someone _wants_ to _kill_ you I'm sure they could. If the attacker is willing to spend the time, effort and money to find better, more exploitable bugs and you're a target worthy of their efforts then you're screwed no matter what exploit mitigations you put in place (this is why imo bug hunting still has some semblance of value). But are you _that_ important? Would the FBI be willing to a throw a $1m iOS exploit at you for example?
The adversary is out of the picture here - you want to write your kernel in a way that makes accidental bugs hard/harmless. (i.e. prevent “random crashes”)
I am not saying they are wrong, but they didn't give me much reason to believe they are right.
If that is so, then the vulnerability described is likely to be an issue, perhaps later, perhaps sooner, but within some given time frame during which the ubiquity of the 'net will be ever expanding.
Perhaps the solution is to guide the users in some very 'user' friendly adaptation of a 'man. page' that describes with elegant confidence the methodologies germane to creating a keycode that would allow for said 'users' to give themselves the safety from the perchance nefariously driven 'code poets' who would otherwise be able to derive social insecurity from whatever access might be available to them.
Long winded reply to say we need to not think about stoppping using Linux, but instead use a nice little intro for those who don't know enough (or even very little) regarding how to code a patch in their own kernel.
Given that the tech will be integrating NLP more and more, I could even imagine a 'talk through' with some 'Ask Jeeves'-esque personal assistant.
The whole thing is essentially a trust issue. Who's writing the code and who's debugging it to give all of the nUbs (yes, I use the old abbrev.) enough insight to give a little polish and shine to their appliances and machines.
Whew, lotta writing there :d
This has nothing to do with non-programmers.
I agree that point is preposterous, but it is their point.
Unfortunately, by not really crediting or even acknowledging this research (and also ignoring a lot of work thats been happening in academia on hardening commodity kernels and applications), the Linux kernel is a)playing catch up to other operating systems (instead of adapting newer techniques) and b) alienating researchers even further.
A lot of their work has not been accepted into the mainline linux kernel ... but it's hard for me to see how this is a problematic sort of "not really crediting or even acknowledging". If anything, it pushes people to go to the source, grsecurity itself, for their "hardened" kernels. It seems that grsec/pax do have a lot of recognition as a result.
Yes, the inventors and developers of these hardening techniques want to be praised and have their work immediately used as-is to save the world. But we don't all have to want the same thing, to have the same priorities. We don't all face the same threats, nor performance and feature requirements. If people want to make the various trade-offs in favor of a significantly more "hardened" kernel, they've been free to use grsecurity or openbsd for quite a while. No need to blame linux-mainline maintainers for the people who have not made that choice. There's really no unfair lock-in going on here...
Those measures are meant to protect user space, not the kernel.
They aren't going to move the kernel to a microkernel type design and besides, using advanced hardware features is out, because that would too closely tie the kernel to a single architecture. You could argue there is a business case for Intel and ARM to produce hardened Linux forks for their respective architectures as a form of competitive advantage, but since it hasn't happened in the past, I wouldn't be optimistic.
Also historical precedent has shown they aren't going to get tough on the vendor drivers. The kernel is filled with binary blobs (mostly firmwares), and as the article points out, vendor drivers are where the lion's share of the bugs are coming from.
True robustness arises from design thinking, not detail obsessing.
Food for thought: the Windows Subsystem for Linux proves that it's possible to implement the Linux kernel ABI without actually being Linux.
I'm not sure how far you could go re-implementing the ABI on top of a microkernel architecture.
but I think Linux is more than the kernel. If you break user land assumptions about filesystem layout, shared libraries, permissions, etc - are you in a better place as a 95% Linux with better security? From experience people aren't very happy with partial measures to make things linux like.
If you use the MS model (I really wish they had taken posix more seriously 20 years ago), you inherit all of Linux as model, with a different implementation.
If you leave the user/kernel boundary intact, have you improved the state of the world? To what extent are the security issues a result of the model and to what extent the implementation?
For example, accesses to userspace memory all go through copy_from_user() / copy_to_user() / access_ok() and related functions. Behind this, S390 implements separate kernel/user address spaces; x86_64 implements SMAP; ARM64 implements PAN.
Unless there is any substantial claim, articles like these are bullshit to me.
One of the problems (already solved now) was that the kernel had unlimited access to userspace, ie. once you've found a kernel bug that permits the kernel to do something wrong involving user-supplied arguments, you could prepare data/code and then use the bug to make the kernel read or act on your prepared data. Now that most kernel code is blocked from reading most userspace, you have less ability to direct the kernel's behaviour when you want to exploit a bug.
There's more. It's good stuff.
Given that it's buggy and that linux is widely used, we can also safely assume that someone will try to exploit the bugs, which makes it sensible to limit the likely possible consequences of bug. Or put differently, to minimise the risk that a bug is a vulnerability.
1. Most devices are not administered by IT Professionals
This is true and must be taken into consideration, but while every layman can't be a sysadmin, neither can you, I think in 2016, simply take a position of "I don't need to understand any of this, and everything should Just Work." I don't think that's realistic, if you want the home automation we see in the Jetsons, if you want smart devices in your home setup to make your coffee at exactly 5:56 AM, then you need to step up and take a little responsibility for learning how this stuff works and how to set it up. Now is it realistic for end users to perform kernel updates, testing functionality, and changing out for new packages as needed? Of course not. But a basic understanding of the underlying technology helps in a long way in troubleshooting the inevitable problems that will arise, and in letting you choose, intelligently, what OEM's to do business with.
2. Manufacturers leaving devices un-updated, unmaintained after production
This is asinine, especially for the devices that require online connectivity. You already have a more-or-less constant WAN connection, so why on Earth can't these devices update their firmware when required? The answer is of course that after-sale support is not profitable but that too is unacceptable, if you're going to bake computers into your products, you as a company need to step the hell up and support them, not just throw them on the market for a quick buck and then run away with the cash.
My 0.02.
Also, even if manufacturers are held to account more, we will still see severe bugs, IMO, in Linux or even some hypothetically more secure, future OS.
As it's framed in this article at least, I think the automotive manufacturer metaphor falls down at some point (even if most cars now run Linux too). I think software is just vastly more complex and we are just now learning how to cope with that complexity.
In a cell phone? Sure, because the replacement process is a somewhat annoying sales appointment at $carrier. In a thermostat? No, because it should last years. Maybe decades if it's a good one. IoT falls apart in this arena because the hardware is designed to be replaced often, and that's exactly what house hardware should not be.
And if the software is too complex, then don't do it. Do it right or don't bother.
The idea being that these patching companies would become recognised brands, and the manufacturer would get to put a "Supported by FooCorp until 2031" badge on their packaging, and consumers would start to expect to see this.
No, maybe you won't be able to set it up with a smartphone and 2 minutes, but it also might WORK BETTER if it wasn't able to do that.
If an engineer builds a bridge and it falls down, s/he will get punished for it.
If a doctor or a lawyer makes a similar hard mistake, s/he will get punished for it.
The same needs to happen to software engineering, specially given that in most countries software engineering is a degree with the respective Engineering Order.
For example, we can't hold Linus Torvalds liable when the Linux Kernel has a bug (perhaps not even if it was deliberate!). If we even tried to, the entire project would likely come to a screeching halt.
How is this model of liability compatible with large open source codebases?
And frankly, if your thermostat malfunctions and runs your heat full bore for a weekend while you're out of town, I don't think it's unreasonable to say that, assuming basic requirements were present for functionality (power, connectivity to the furnace, etc.) that the company should be responsible if their system went wrong solely because of poorly designed software. If for nothing else than your outrageous heating bill.
And again, if a company's response is "well we don't want to be responsible for your furnace" then my response is "then don't be making fraking thermostats, because that's what they're FOR!"
So I would agree that in this hypothetical case, the IoT company needs a custom kernel patch on their device, and hopefully it gets upstreamed.
But if all this occurs after your furnace is shot, you're left asking the manufacturer, "Why did you use Linux at all in this product?" You would think they'd then accept responsibility but what if they do try to blame the Linux project and have expensive lawyers to back them up?
This all seems to add up to a potential spaghetti mess of blame where the legal model is "doctors and lawyers and bridge builders." In fact I think these problems need to be addressed outside current legal and regulatory systems which frankly can't keep up with the pace of open source software.
Yes, like in other fields. Obviously people are not chased out of town for as small error.
It's when people conspire together to hide big problems that liability becomes important.
[1]: https://en.wikipedia.org/wiki/Midori_(operating_system)
Better replace the kernel with L4 and a good set of services. Except those platforms have way fewer developers also because they are not as easy to develop for.
If there is political support, the research will eventually produce the desired results.
We already had such managed environments in the 60's and 70's, those researchers and companies would be in heaven if they could even have a Raspberry PI like hardware at their disposal.
I like the philosophy of trying to squash whole classes of bugs and generally trying to reduce the attack surface, versus one-by-one bugfixes.
I am curious about the solutions the Linux developer community will come up with to address this. There are many, many very smart developers and I look forward to some creativity :)
I am optimistically hopeful that proposed solutions will not involve anything resembling a central authority that must be trusted -- something based on Certificate Authorities (or any analog to Microsoft's Trusted Computing model), would be really disappointing.
ISTM that most distros use central software repositories, already? And that is very much a good thing? Definitely anything run by M$ or a similar firm could have conflicting goals, but don't paint e.g. the Debian Project with the same brush.
Any Linux user is free to use whatever distro they want. Once you've chosen a flavor of Linux, in theory you could even run your own apt/rpm repository. There is no requirement that a Linux user must trust some third-party or their system won't run. Let's keep it that way :)
They use a theorem prover to validate drivers.
Static analysis is a enforced on the Windows source code via the Security Development Lifecycle Checks.
VC++ has quite a few security options that are enabled and used to compile the kernel.
After the whole Windows XP Swiss cheese episodes they ramped up quite a few security processes.
Windows 10 allows for individual application sandboxing.
Not only we have millions of embedded devices shipping microkernel OSes on them, we also have the transition to type-1 hypervisors, and now the slow adoption of unikernels.
Also Apple, Microsoft and Google are increasing the scope of sandboxing on their OSes.
There were some BUILD 2016 presentations about Window 10 sandboxing, but I would need to search for them, which I cannot currently do.
Its astoundingly rare to get owned purely by a kernel exploit. Yes they are used, but mostly when initial access has been obtained.
So what can actually be done to harden the Linux kernel?
No need to "rethink" kernel security, just use grsecurity.
Better to just stick with the status quo and not ask too many questions.
...what a very poor choice of words.
The most dangerous software is one you can never update. Android leads the tivoization of devices globally.
Linux has LTS support for 15 years. WinXP was supported for 13 years.
Is this the same Linux Foundation that gave Microsoft Keynote Position at the last LinuxCon?