News for hackers. Stuff that matters.
Re:Linux Syscall Support by masklinn on Thursday November 07, 2024 @07:05AM (#42075929)
> I just don’t see an advantage.

You don’t have to deal with C ABI requirements with respect to stack, or registers management. You also don’t need to do dynamic linking.

On the other hand all of that comes back to bone you if you’re trying to benefit from vDSO without going through a libc.

Re:Linux Syscall Support by titzer on Thursday November 07, 2024 @09:00AM (#42076699)
> You also don’t need to do dynamic linking.

This is a big one. Linking against libc on many platforms also means making your binaries relocatable. It's a lot of unnecessary, incidental complexity.

Re:Linux Syscall Support by rcxdude on Thursday November 07, 2024 @09:11AM (#42076786)
It also means giving up ASLR, though.
Re:Linux Syscall Support by titzer on Thursday November 07, 2024 @09:23AM (#42076868)
You can still randomize heap allocations (but not with as much entropy), as usually the heap segment is quite large. But you don't get randomization of, e.g. the code.

ASLR is a weak defense. It's akin to randomizing which of the kitchen drawers you'll put your jewelry in. Not the same level of security as say, a locked safe.

Attacks are increasingly sophisticated, composed of multiple exploits in a chain, one of which is some form of ASLR bypass. It's usually one of the easiest links in the chain.

Re:Linux Syscall Support by LegionMammal978 on Thursday November 07, 2024 @09:19AM (#42076841)
> On the other hand all of that comes back to bone you if you’re trying to benefit from vDSO without going through a libc.

At least the vDSO functions really don't need much in the way of stack space: generally there's nothing much there but clock_gettime() and gettimeofday(), which just read some values from the vvar area.

The bigger pain, of course, is actually looking up the symbols in the vDSO, which takes at least a minimal ELF parser.

Re:Linux Syscall Support by t-8ch on Thursday November 07, 2024 @10:03AM (#42077231)
The kernel also provides a minimal vdso elf parser:

https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/lin...

Re:Linux Syscall Support by masklinn on Thursday November 07, 2024 @10:04AM (#42077239)
> At least the vDSO functions really don't need much in the way of stack space: generally there's nothing much there but clock_gettime() and gettimeofday(), which just read some values from the vvar area.

And yet that’s exactly one of the things Go fucked up in the past: https://marcan.st/2017/12/debugging-an-evil-go-runtime-bug/