Lurker News

Comments (128) 39 threads

Earlier comments
asveikau4 replies#
I think there have to be more than 7000 OpenBSD users. The link to that claim was not responding when I clicked it.
efortis1 reply#
Yes, that statistic is from 20 years ago (11/02)
asveikau#
I was an OpenBSD user then. What are the odds I was 1 out of 7000?
volkadav1 reply#
It's a joking reference to an ancient copypasta troll/meme alleging that bsd is dying, cf the phrase "netcraft confirms it" and troll comments on slashdot 20+ years ago. :)
asveikau#
Of course, now I remember, those comments would cite fake sources estimating usage numbers, and probably some of them claimed to have data from de Raadt.
octetta#
...maybe that means there are only 6,999 users now... I KEED...
shp0ngle#
It seems to be some copypasta meme from 2003
the8472#
> Pledging causes most system calls to become unavailable. Your system call policy is enforced by the kernel, which means it can propagate across execve() if permitted.

My understanding is that promises aren't inherited across execve. So that's an incompatibility with openbsd's pledge. And a pretty important one imo because it makes it more difficult to factor out privileged subprocesses (e.g. one doing network things, the other accessing filesystems).
> File system access is a blind spot. OpenBSD solves this with another famous system call called unveil()
That could probably be approximated with user + mount namespaces, a tmpfs and bind mounts. Basically what containers do. But that might suffer from the same process inheritance problems if unveil is BSD-specific, the manpage is unclear about unveil's exec behavior.

bowsamic1 reply#
I was introduced to pledge via SerenityOS and it really is amazing
sph1 reply#
And here's Andreas porting Justine's pledge utility to SerenityOS after having seen this very post: https://youtu.be/T6YkQF6ohoA
bowsamic#
Wow nice! The system call has been in Serenity for a long time I think
jacobmischka2 replies#
Very neat! Unfortunately can't get the `curl` example to work no matter what I do (on Arch Linux).

    $ pledge.com -p 'stdio rpath wpath cpath dpath flock tty recvfd fattr inet unix dns proc thread id exec' curl http://justine.lol/hello.txt
    curl: (6) getaddrinfo() thread failed to start
I tried following the Troubleshooting section and looking through strace output, but unfortunately I'm not sure what I'm looking for, I see a few EPERMs for calls that I don't know what they do: rseq, set_robust_list, and sysinfo to name a few.
jart#
It works fine for me if Curl is built with Musl Libc. I can see you're using a very cutting edge glibc. I tried reproducing this on Debian 10. The only calls that got EPERM'd were set_robust_list() and prlimit64(). I recompiled pledge.com by adding those, and Curl is still failing for reasons that aren't obvious. I've encountered issues like this in the past. Me personally I've always solved this by keeping a healthy distance from Glibc by using things like Musl and Cosmo. However I want to see Glibc users benefitting from our work too! So I'd welcome contributions from anyone who can help us do that.
fweimer#
That could mean that the clone3 system call fails with EPERM instead of ENOSYS. Suppressing system call implementations with ENOSYS is generally safer because it just looks like an older kernel, while EPERM is an regular error code for some system calls.

Put differently, ENOSYS tells userspace that the system call isn't implemented and you need use some fallback code. EPERM means that the operation was denied by policy. But in that case, it might not be a good idea to approximate it by using different system calls because it might circumvent the intended security policy.

Load more comments