CVE-2019-1347: When a mouse over a file is enough to crash your system
blog.tetrane.com
blog.tetrane.com
Yes, please.
NT tends to be conceptually about the right trade-off (micro-kernel design, but no context switching) but then they go do stupid crap like this.
But it serves to discourage anything that isn't actual conversation, which might not be a bad plan in the end.
In rare instances pictures add to the conversation. But 99 times out of 100, that pic is some reaction gif (spongebob, wat, etc). And I'd argue that these reaction images are completely worthless.
In a way, it's also the comparison between fb or reddit vs HN or lobste.rs .
Others don't, for example tons of embedded devices.
If you have a small, fast kernel it could be used on a variety of devices, from Raspberry Pi to Mac Pro.
The difference is I can avoid most of that crap when I have to write performance sensitive code, I cannot avoid a slow system without dropping down to the hardware.
In a context that doesn't involve executing it. On a Linux system, this functionality would probably be implemented with libelf or libbfd, neither of which depends on the kernel.
Then again, the kernel already has such a gigantic attack surface that it doesn't matter if the ELF parser is part of it.
A model in which this happens in userspace is conceivable, but it'd be pretty weird. Besides, it introduces a chicken-and-egg problem -- if you need a process to launch a process, you need some sort of special case for init.
Of course the ELF parsing doesn't literally have to be done by the kernel, but there's no obvious good place to put it otherwise, considering it's a critical bit. If security is the real concern, then why wouldn't you just drop privileges while parsing ELF instead? I don't see the benefit to moving this code outside of the kernel. Maybe somehow moving it to a different protection ring would be helpful; but same for the rest of the binfmts.
I believe the Windows loader that loads PE files, is in fact in the kernel, along with a lot of other stuff. At the end of the day, when the Windows NT kernel was architected, speed was really important and security practices were not matured. I mean, the kernel handles or at once handled a lot of stuff, especially related to the GUI and even network RPCs and network services.
And goes for a lot of other kernel code.
Even for statically linked executables?
That is, the parse logic could be a library linked by multiple application.
fs/binfmt_elf.c is over 2k lines.
That's a radical piece of software, though. I've never seen anything like that before.
The text and technical details supporting the screen caps is very dense and hard to approach as a complete outsider. I would love to have a glossary with all the terms and initialisms/acronyms in use. PTE (apparently means page table entry), for example, is something I've never heard of before.
Or "low level/back end" developers; people knowledgeable with operating systems, assembly, and hardware.
I looked at the article and it made me mad because it seemed to be a bunch of nonsense.
I mean the second video paragraph is: "A closer look at the memcpy arguments shows that this address is built as 0xfffff8035b2a0000 + 0xe7ff, so we taint the value 0xe7ff to find where it comes from." But there's absolutely zero explanation of what we're looking at.
So it made me mad because it made me feel stupid for not understanding it, when in reality it's just poorly written. Poor communication is theft.
The fact that it does this in the kernel is foolish, but there's functionality directly tied to this, not an indirect chain of things that results in parsing this for little reason.
One old example: I have an old friend who used to do sysadmin work in the Windows 2k days, and he would often get gigs by speeding up services by 5-15% within a day. His go-to trick was to log into the headless win2k server and disable the screensaver process, then wait.
The CVE here literally has nothing to do with privilege separation or being unable to distinguish between user mode and kernel mode. It's this simple:
* Someone in user-space wanted to parse an executable to get information on it
* A syscall is exposed to parse an executable
* They used the syscall to parse the executable, and that code path had a bug in it which triggered a BSOD (since the failure was in kernel mode).
In the end, this is just "a syscall had a bug in it that caused a kernel crash, and a user-mode application issued the syscall on mouse-over".
I'm not sure what I'd suggest instead, though - this specific case would be nice if we had kept the parser in userspace, but that just turns "hovering triggers kernel-mode crash" into "attempting to execute causes kernel-mode crash", presumably.
[Rant about wanting more trusted codepaths having static analysis and/or managed languages goes here.]
Then you ask the broker to load this corrupt .exe file, and it crashes, and now your system (which hasn't bluescreened! hooray, we win!) can't run executables anymore. Under those circumstances, I would just take the OS down and generate a dump that someone can open up in a kernel debugger instead of letting it stumble along half-broken in a way that makes the problem hard to diagnose.
I don’t understand why reading the metadata of a file (even of an executable file) should need heightened privileges. What am I missing?
QuickLook is implemented via a horrific process where multiple plug-ins share the same address space :(
EDIT: Apparently they are videos, but you can still add thumbnail images to native HTML5 videos without loading 40 script files (that uMatrix reported).