14 ms·
> Grsecurity will rather terminate userland programs or, in some rare cases, panic the kernel if it finds itself in an undefined state. This is exactly what you
by amelius 9y ago
> Grsecurity will rather terminate userland programs or, in some rare cases, panic the kernel if it finds itself in an undefined state. This is exactly what you want if you care about security, but it's not a trade-off everyone is happy with (including Linus).
I'd also like my kernel to halt whenever an assertion does not hold, for the sake of keeping my sanity; not just for security.
Why would you not want this?
- jhasse 9y agoFor the cases where it was a false-positive.
- otabdeveloper1 9y agoA.k.a. 99.9999% of the time.
- payne92 9y agoFor the same reason people drive with their “check engine” light on: It’s frequently better to have a working system (i.e. “I’m late for work”), than to chase an indicator that may not represent a real problem (an actual security intrusion).
- Slavius 9y agoI can't think of single useful piece of software nowdays that is exposed to public and can't run in active-active load balanced or clustered scenario. If your kernel/system/userland-app misbehaves it simply needs to be shut down, reported and examined. It might have been some random memory block the last time your app made an buffer overflow, but it could as well be the stack pointer next time...
- mjw1007 9y agoWeb browsers are, for practical purposes, exposed to the public. Linux doesn't run only on servers.
- Slavius 9y agoSo what happens when your browser crashes? I experience that on a regular basis. Id' rather have my browser crash/killed instead of slowly overwriting my filesystem buffers or corrupting my stack pointer... Other than that browser are multi-thread/process applications. Usually only a single tab or a plugin crashes unless core browser process is affected. Most users would accept the trade off between crashed browser and infected/corrupted system.
- jhasse 9y ago> or corrupting my stack pointer... in that case, it will crash with a SIGSEGV sooner or later anyway
- Slavius 9y ago...or is being remotely exploited and it silently succeeds. Who wants that?
- jhasse 9y agoThat is very unlikely. Crashing would happen 100% of the time though. Most people want that trade-off (meaning: If their browser would crash, they would switch to another one, even it was less secure).
- Slavius 9y agoCorrupting SP is part of almost every exploit and I can guarantee you that it is very likely (going to cause harm on your system). Try to pull Metasploit GIT repo to get some idea about thousands of payloads that do corrupt SP without crashing the host...
- jhasse 9y agoYes, but how many of all cases of corrupted stack pointers are exploits?
- makomk 9y agoRemember, we're necessarily just talking about servers here; every single hospital has mission-critical client machines that cannot go down and obviously those aren't load balanced or clustered. (Though mostly they seem to be running Windows.)
- TickleSteve 9y agoFor safety-critical systems, resetting on a fault is very much factored into the worst-case response time and expected behaviour. PANIC on fault is exactly what you design into the systems.
- digi_owl 9y agoSo why is not the world running on C64s?
- TickleSteve 9y agoThe world does run on microcontrollers that have roughly the same processing capability as a c64... The vast majority of processors sold are not i5 or i7 level but microcontrollers.
- mcguire 9y agoNever had a single problem take down all of your instances at once, eh?
- CGamesPlay 9y agoWhen the invalid write overwrites some piece of data your application doesn't care about (or more likely some feature in some driver you don't care about). Especially when the trade-off is the web site goes down.
- jstanley 9y agoBecause you'd rather just do your work and not have to deal with unnecessary kernel panics? If the system can continue running, it should do.
- muppetman 9y agoSay there's a minor error in a network driver. Yes, it might be exploitable by a smart person. But the error only triggers once a day when a counter rolls over. Do you really want your box to lock up and panic when this error is encountered, or do you just want your box to keep working. I'm firmly in the first camp (I'll take lock up and freeze thanks) but 99% of users don't care about a bug like that and just want the box to keep working.
- jbangert 9y agoBut do you want your box to send silently corrupted data for the next two years? Or would you rather reboot every night, and maybe escalate to your red hat support contract, where someone will then fix the underlying bug (for which you now have crashdumps),
- AndrewDucker 9y agoI'd want it to log that it's going wrong, and report that so that it can be fixed.
- azernik 9y agoIf you're a desktop user, or a sysadmin without said support contract, you want the former.
- marcosdumay 9y agoWhat data exactly is being corrupted? Fail fast is a great philosophy for end-user software. But it is not that strictly good for middleware, and is almost certainly wrong for a kernel.
- jandrese 9y agoThat Redhat support contract won't save you from a bug in a binary blob network driver. Crashing the whole kernel at the drop of a hat seems like a pretty extreme stance to take as a general policy IMHO. Killing and restarting the driver will usually suffice, although some data may be lost and have to be retransmitted.
- 9y ago
- lima 9y agoIt's a deliberate trade off. Not panicking results in uncaught exploitation attempts, and panicking will result in crashes where a vanilla kernel would happen to survive. It should have been made a sysctl toggle.
- iforgotpassword 9y agoServers: yes, phone/home PC: no. Maybe my dev machine but my wife wouldn't be happy with a kernel panic while writing an email. Like Linus said, this would go unreported with the average user because they just reboot in annoyance.
- digi_owl 9y agoMore and more it feels like the _sec world wants to go back to C64s dialing into big irons...
- drinchev 9y agoLinux is used in so many critical systems. What happens when a security bug stops the ventilating machine of a person lying in hospital bed, or halts the screen of a surgeon. Not to mention voting machines, ISP's, telecoms. For me having all those stopped, when properly exploited, looks more like a very scary DoS attack vector. Imagine a security f*ck up, like Heartbleed, but this time with an option to halt kernels / systems.
- teamhappy 9y agoFirst things first: Kernels panic and processes crash. If your medical equipment or telco/ISP system can't recover from that then you're in trouble anyway. Why they crash doesn't really matter in that context. As far as voting machines go, kernel panic sounds waaay better than executing malicious code. > Imagine a security f*ck up, like Heartbleed, but this time with an option to halt kernels / systems. IIRC heartbleed didn't allow you to execute code (it allowed you to read more memory than you should have been able to). A better example is every flash player bug ever. Would you rather that thing crashes or executes malicious code? Keep in mind that the malicious code can also shut down your system. Also keep in mind that we're talking about userspace programs right now. This thread is about kernel bugs. Userspace programs already have the option to ask the kernel to kill them if they misbehave. A lot of them do that (using features like seccomp filter) and many more should. (Chrome and Firefox both use seccomp filter I think.)
- AnIdiotOnTheNet 9y agoI see. It's ok because we'll just pass the buck and make it someone else's problem.
- teamhappy 9y agoLet's say somebody gives you an USB stick and you plug it into your laptop. Which of the following scenarios would you like to see? 1. 0-day in the kernel's USB code. You're part of stuxnet now. 2. 0-day in the kernel's USB code. You're part of stuxnet now. You also get a message that tells you how and where to report the bug that was exploited. 3. 0-day in the kernel's USB code. Your computer crashes. You're not part of stuxnet. You also get a message that tells you how and where to report the bug that was exploited. Linus is wrong (it happens). Exploit mitigation techniques aren't debugging tools. They're exploit mitigation techniques. The fact that they also produce useful debugging information is secondary.
- huhtenberg 9y ago> Why would you not want this? I was writing paper, on a PC, that was like "pip pip pip pip pip" and then... like half of my paper was gone.. and I was like... It devoured my paper. It was really good paper. And then I had to write it again and had to do it fast so it wasn’t as good. It’s kind of... a bummer. https://www.youtube.com/watch?v=VMt2MK67-Qw https://www.youtube.com/watch?v=VMt2MK67-Qw
- Santosh83 9y agoAFAICS, Linus also wants it, but he wants a panic to be preceded by a rather lengthy span with just a warning, allowing the concerned dev to actually fix the error. Essentially he's saying: "take it slow, and don't break user experience."
- makomk 9y agoDue to the aggressive nature of grsecurity, a lot of the assertions it trips on are bogus; either they didn't understand the code they were securing or they changed the rules without properly updating all the affected code. For example, there was a particularly obnoxious panic in the tty layer a few versions back that was entirely the result of this.
- zzzcpan 9y agoA better way of course is not to halt on assertion, but to limit the scope of any potential problem in a such way, that an assertion could only crash a tiny isolated thing and trigger its restart, possibly not impacting availability whatsoever. You still get your sanity, but also get users happy with a rock solid thing that just works even in a presence of errors. The idea is known as supervision trees.
- Fnoord 9y agoI think a good tradeoff could be that with containers, the individual containers are hardened, whereas the kernel's host OS is not. The host OS doesn't do much except keeping the containers running.
- _asummers 9y agoErlang VM works this way, if someone's looking for a program that does this in practice. They have the mantra "let it crash". Something higher than you is in a better position to handle your error and restart you to a known good state.
- babarock 9y ago> Why would you not want this? You don't want your machine to start crashing after installing the latest kernel. Or at least, that's the golden rule of Linux development. If phones start crashing after installing the latest Android update, people won't see this as a security/stability improvement. They'll simply see the new version as buggy and of poor quality.
- rhinoceraptor 9y agoIf an assertion does not hold, you have a real problem. The kernel has in-memory data corruption. Either from buggy code, bad memory, solar radiation, etc. So if that assertion is in the file system, maybe your kernel should die before it corrupts your data permanently.
- mcguire 9y agoDepends. How attached are you to getting work done today? I too would like to live in a world where sanity preserving assertions have rational consequences. But that world is not this world, and pretending it is won't help you get there.
- kazinator 9y ago> This is exactly what you want if you care about security, A deliberate panic could be the basis of a denial-of-service exploit.