News for hackers. Stuff that matters.
Re:CVE-2019-1347: When a mouse over a file is enough to cras... by millstone on Saturday November 16, 2019 @06:32PM (#21555614)
The crash is in parsing an executable file. Linux also performs this parsing in the kernel. Moving it to userland would be a microkernel design.
Re:CVE-2019-1347: When a mouse over a file is enough to cras... by duskwuff on Saturday November 16, 2019 @07:28PM (#21555813)
> The crash is in parsing an executable file.

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.

Re:CVE-2019-1347: When a mouse over a file is enough to cras... by mike_hock on Saturday November 16, 2019 @07:57PM (#21555889)
Why does it matter if I'm gonna execute it? The parsing doesn't need to be done in kernel space in either case.

Then again, the kernel already has such a gigantic attack surface that it doesn't matter if the ELF parser is part of it.

Re:CVE-2019-1347: When a mouse over a file is enough to cras... by duskwuff on Saturday November 16, 2019 @09:58PM (#21556290)
A UNIX-style process spawning interface, like exec() or posix_spawn(), requires the kernel to have some awareness of the executable format so that it can create a process from an executable image. It doesn't have to support every feature of the format, though.

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.

Re:CVE-2019-1347: When a mouse over a file is enough to cras... by saagarjha on Saturday November 16, 2019 @11:46PM (#21556606)
Your bootstrapping process and init can have their own, hardcoded format.
Re:CVE-2019-1347: When a mouse over a file is enough to cras... by malux85 on Sunday November 17, 2019 @08:37AM (#21557863)
Yeah I though the same thing. init is special
Re:CVE-2019-1347: When a mouse over a file is enough to cras... by jchw on Saturday November 16, 2019 @11:57PM (#21556633)
IIRC, the binfmt elf code in the Linux kernel basically only does enough elf parsing to map everything into memory and kick off the linker. Then the linker does the rest, in userland. It matters because the binfmt code can be very hardened and minimal, whereas the userspace can go and do whatever it wants.

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.

Re:CVE-2019-1347: When a mouse over a file is enough to cras... by mike_hock on Sunday November 17, 2019 @05:36AM (#21557341)
> Maybe somehow moving it to a different protection ring would be helpful; but same for the rest of the binfmts

And goes for a lot of other kernel code.

Re:CVE-2019-1347: When a mouse over a file is enough to cras... by saagarjha on Sunday November 17, 2019 @06:28AM (#21557482)
> IIRC, the binfmt elf code in the Linux kernel basically only does enough elf parsing to map everything into memory and kick off the linker.

Even for statically linked executables?

Re:CVE-2019-1347: When a mouse over a file is enough to cras... by NieDzejkob on Sunday November 17, 2019 @08:04AM (#21557747)
For a statically linked executable, the minimal parsing is enough to kick off the executable directly. After all, the linker is "just" a statically linked executable...
Re:CVE-2019-1347: When a mouse over a file is enough to cras... by rkeene2 on Sunday November 17, 2019 @09:09PM (#21561394)
One could use eBPF to do the parsing safely in the kernel ;-)
Re:CVE-2019-1347: When a mouse over a file is enough to cras... by Varriount on Saturday November 16, 2019 @08:48PM (#21556061)
But here's a question - supposing that this functionality was moved into a hypothetical library "pe.dll"/"pe.exe", how would the kernel load this library or executable? Wouldn't one run into a catch-22 situation?
Re:CVE-2019-1347: When a mouse over a file is enough to cras... by scintill76 on Saturday November 16, 2019 @09:11PM (#21556136)
I think they're saying that userland should handle whatever the mouseover is trying to do (another comment says it displays author and version info embedded in the exe). Things that actually require kernel privileges would remain in the kernel.
Re:CVE-2019-1347: When a mouse over a file is enough to cras... by paulddraper on Saturday November 16, 2019 @10:31PM (#21556397)
The kernel would probably statically link it.
Re:CVE-2019-1347: When a mouse over a file is enough to cras... by saagarjha on Sunday November 17, 2019 @06:29AM (#21557486)
…wouldn’t that have the effect of bringing this code back into the kernel’s address space?
Re:CVE-2019-1347: When a mouse over a file is enough to cras... by paulddraper on Sunday November 17, 2019 @06:52PM (#21560874)
The code itself would be in the kernel, but the "parsing while mousing over" invocation would be on userspace code.

That is, the parse logic could be a library linked by multiple application.

Re:CVE-2019-1347: When a mouse over a file is enough to cras... by Pick-A-Hill2019 on Sunday November 17, 2019 @07:58AM (#21557726)
wouldn't you load/call it during boot or when the mouse driver loads? If you have a mouse, you are almost certainly going to generate an on-mouse-over event at some point. The advantage is that it isn't running in ring 0.
Re:CVE-2019-1347: When a mouse over a file is enough to cras... by jacquesm on Saturday November 16, 2019 @06:37PM (#21555635)
> Moving it to userland would be a microkernel design.

Yes, please.

Re:CVE-2019-1347: When a mouse over a file is enough to cras... by StillBored on Saturday November 16, 2019 @07:50PM (#21555871)
Its crazy that the arguments against microkernels were basically 100% its slower.. Which these days is completely batshit insane because we are running software in VM's eating 10%+ system performance, written in languages like Java/Javascript/etc which eat another 50% before the cowboy coder comes along and imports 2GB of libraries which effectively trash the caches/tlb/etc at every opportunity due to the difficulty of creating caches with massive associativity. Which is how we get chat apps written in electron eating up a couple 4+Ghz cores and multiple GB of memory just to display what was basically possible in with mIRC and 64k of ram 20 years ago.

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.

Re:CVE-2019-1347: When a mouse over a file is enough to cras... by paulddraper on Saturday November 16, 2019 @10:33PM (#21556403)
Some computers have that software.

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.

Re:CVE-2019-1347: When a mouse over a file is enough to cras... by NullPrefix on Saturday November 16, 2019 @08:39PM (#21556036)
mIRC could not do inline gifs. You had to draw everything in ascii. Is that not a reason enough to spend several $k in a device to handle this?
Re:CVE-2019-1347: When a mouse over a file is enough to cras... by StillBored on Saturday November 16, 2019 @09:30PM (#21556196)
LOL, just post a link to the rich content, that is how its mostly done with hexchat these days. Of course you could just DCC the content to someone too.

But it serves to discourage anything that isn't actual conversation, which might not be a bad plan in the end.

Re:CVE-2019-1347: When a mouse over a file is enough to cras... by crankylinuxuser on Saturday November 16, 2019 @10:17PM (#21556352)
Having been on chat from slack to discord to reddit chat to telegram... I focus back on IRC for its simplicity and lack of video and image-spam

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 .

Re:CVE-2019-1347: When a mouse over a file is enough to cras... by catalogia on Saturday November 16, 2019 @11:14PM (#21556533)
Parsing and displaying a gif is not such a complicated matter that it comes anywhere close to excusing the resource gap between the two.
Re:CVE-2019-1347: When a mouse over a file is enough to cras... by josefx on Sunday November 17, 2019 @06:30AM (#21557488)
> Its crazy that the arguments against microkernels were basically 100% its slower.. Which these days is completely batshit insane because we are running software in VM's eating 10%+ system performance, ...

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.

Re:CVE-2019-1347: When a mouse over a file is enough to cras... by jacquesm on Sunday November 17, 2019 @08:21AM (#21557810)
Slow is very relative here, the performance penalties are on the order of 5 to 10% or so in absolute throughput terms, latency is usually much better in a microkernel based system because it can use the cores more effectively and even quite a bit of the message passing overhead can be caught as long as you stay on the same physical machine by using the paging mechanism.
Re:CVE-2019-1347: When a mouse over a file is enough to cras... by zaarn on Sunday November 17, 2019 @05:55AM (#21557382)
Linux uses libelf to parse the executable, it isn't in the kernel. It's a sort of weird process but binfmt will load libelf, which is then responsible for loading the ELF file.
Re:CVE-2019-1347: When a mouse over a file is enough to cras... by Vogtinator on Sunday November 17, 2019 @06:17AM (#21557454)
Nope: The Linux kernel has to parse and support all of the ELF stuff the INTERP of the executable needs.

fs/binfmt_elf.c is over 2k lines.