News for hackers. Stuff that matters.
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 ;-)