HNHacker News
TopNewBestAskShowJobs

notaplumber

1,632 karma · joined March 25, 2016

submissionscomments
notaplumber··on Syscall Call-From Verification
> I'm not very familiar with low level work and exploits, but aren't syscalls the API for the kernel itself?

No. The kernel doesn't call syscalls itself. It provides them for applications.

Just to clarify a potential misunderstanding. The kernel and userspace run at different "hardware" privilege levels (ring0<=>ring3). Userspace applications cannot simply call the kernel API directly, they must "trap" into the kernel to perform some pre-defined service request, aka. System calls.

There are usually a few hundred or more of these, like e.g. read(2)/write(2). They are also generally exposed via libc wrappers (but not always) or via the indirect syscall(3) function. But it is also technically possible to directly encode the trap instruction, for example on x86 "int $0x80" or amd64 "syscall" with the desired syscall index. This is the part OpenBSD is proposing to lock down. The low-level syscall ABI has always been unstable, meaning it can be changed incompatibility, and libc is the more-stable interface applications should be using.

With that out of the way..

> Is it possible to authorize arbitrary code, or is access to msyscall (via libc or otherwise) restricted outside of boot?

msyscall(2) can only be called /once/ per-process, e.g. by the ld.so dynamic linker. This is used to indicate where libc is mapped (libraries are mapped randomly) to the kernel so it can permit that area to make syscalls.

notaplumber··on Syscall Call-From Verification
Indeed. This appears to be the case for stuff encountered thus far.
notaplumber··on Syscall Call-From Verification
OpenBSD already prevents syscalls from writable pages. It did not break JITs, in fact, to quote Theo de Raadt, it brings over an aspect of W^X to JITs that haven't been adapted to work with mandatory W^X.

https://marc.info/?l=openbsd-cvs&m=155942895309114&w=2

This means it's forced to use the libc stubs for syscalls. Any direct syscall from a JIT is suspect.

notaplumber··on Syscall Call-From Verification
From my dupe submission: https://news.ycombinator.com/item?id=21653796

This new proposed mitigation builds upon other work, such as libc/ld.so random re-linking at boot, and opportunistic enforcement of syscalls from only un-writable pages by default.

https://www.openbsd.org/innovations.html

notaplumber··on Syscall Call-From Verification [OpenBSD]
This new proposed mitigation builds upon other work, such as libc/ld.so random re-linking at boot, and opportunistic enforcement of syscalls from only un-writable pages by default.

https://www.openbsd.org/innovations.html

notaplumber··on Infectious Executable Stacks
Probably the same (or worse) as Linux. IIRC FreeBSD still had executable stacks by default until at least 2016?

Edit: I give FreeBSD too much credit.

The kern.elf64.nxstack / kern.elf32.nxstack sysctls were introduced in FreeBSD 9.0, which is 0 by default. 1 enables PT_GNU_STACK behaviour. Apparently not implemented for all platforms. So you get to choose from executable stacks by default and the same nasty behaviour Linux has.

notaplumber··on Update: UniFi Phone Home/Performance Data Collection
For engineers reading this who work at a tech company, or well, any company. Watch this keynote talk by Patricia Aas.

It's called Embedded Ethics. And it is crystal clear many of you need to watch it.

https://www.youtube.com/watch?v=HfNIiitVFtcalk

notaplumber··on OpenBSD 6.6
They made professional quality release songs (and sold CD's) up until 6.0. A few extras showed up for 6.1-6.3 also.

https://www.openbsd.org/lyrics.html

notaplumber··on Proof of code with pointers now possible in SPARK using pledges
Unrelated to OpenBSD's pledge(2).
notaplumber··on Westworld (1973): the first film with CGI, and its source code (2017) [video]
That's interesting! But by golly, was 1973's Westworld a chore to sit through. The remake has the technology and a compelling story.
notaplumber··on Developer of Checkm8 explains why iDevice jailbreak exploit is a game changer
This is already possible. SSH can be enabled on the AirPort. Indeed, they run a build of NetBSD 6.0.

https://jcs.org/2018/06/12/airport_ssh

notaplumber··on Got: An alternative Git-compatible version control system
Here's the project website: https://gameoftrees.org/
notaplumber··on Package Management in OpenBSD
Distributing binary packages outside of OpenBSD's official repository is generally discouraged, as you'll need users to install your public key (packages must be signed, unsigned packages are rejected by pkg_add), and set a custom installurl. This is unsafe as you could be providing other packages overriding the official repo.

In general, ports should be submitted to the ports@ mailing list, in which case packages are built and signed by the OpenBSD project instead. This way they can be built on multiple architectures, and be available for release and -current users.

If you do intend to distribute packages, you still need to use the ports infrastructure for it, ports exist to build packages. They should not be manually constructed.

notaplumber··on The OpenBSD Ada Library
OpenBSD pledge(2) and unveil(2) are relatively easy to create high level language bindings for, and users have already contributed several in the community, like this latest one for Ada. In base, OpenBSD only supports C/C++, however a Perl interface is also included.

https://man.openbsd.org/man3p/OpenBSD::Pledge.3p

https://man.openbsd.org/man3p/OpenBSD::Unveil.3p

A few bindings are also maintained in ports, for example GHC/Haskell (unix package) & Node.js (node-pledge) include them out of the box.

For an unofficial list of highlevel language bindings: https://gist.github.com/ligurio/f6114bd1df371047dd80ea9b8a55...

notaplumber··on OpenSSH taking minutes to become available, booting takes half an hour (2018)
It's not just their cloud images, as far as I know Debian excludes all virtio drivers (net/disk/rnd) from all install media.

It is very frustrating.

notaplumber··on OpenSSH taking minutes to become available, booting takes half an hour (2018)
> The OpenBSD folks also appear to trust RDRANG, which would help not blocking. But I disagree with that trust decision.

It feeds the entropy pool, mixed in with many sources. OpenBSD also feeds in data from the AMD CCP as well. The point is it doesn't matter.

https://man.openbsd.org/ccp

And anyone running "echo badapples > /dev/random" in a loop, it still doesn't matter.

https://man.openbsd.org/random.4

https://man.openbsd.org/arc4random.9

> How does OpenBSD guarantee that this file exists, though?

If you keep reading, OpenBSD's random subsystem always mixes old with new data from many sources. If the random.seed file is not available (for example, boot media), it is not fatal. There is a warning displayed. But the system rc(8) scripts handle creating the seed file at both boot and shutdown.

https://www.openbsd.org/papers/hackfest2014-arc4random/mgp00...

notaplumber··on OpenSSH taking minutes to become available, booting takes half an hour (2018)
It doesn't on OpenBSD. arc4random(3) simply can not fail, and getentropy(2) does not block. Linux screwed up getrandom. High quality random numbers are available very early in the OpenBSD kernel, and there is no early boot problem for userland.

Linux has an opportunity to learn from OpenBSD.

https://www.openbsd.org/papers/hackfest2014-arc4random/index...

notaplumber··on PCI Express on the Raspberry Pi 4
OpenBSD has radeondrm enabled on mips64, powerpc and arm64. It can initialize the board just fine without emulating x86, since KMS. Working 3D acceleration is another story.

OpenBSD even has (or had, build breaks often) packages for chromium browser on arm64 that were tested on this.

notaplumber··on Capsicum: Practical Capabilities for Unix
pledge(2), and the traditional OpenBSD privilege dropping model by which pledge(2) expands upon, is demonstrably the superior model by which developers can easily understand and use to design secure programs. Simple interfaces always beat more complicated ones.
notaplumber··on Capsicum: Practical Capabilities for Unix
Capsicum is dead outside of FreeBSD, the Linux port went nowhere, and in the handful of places where it is used in FreeBSD base, it's not even utilizing capabilities to its full potential. It wasn't even enabled by default for many years, until 11 or 12?

Meanwhile pledge(2) is protecting a large percentage of the OpenBSD base system, something like 85/90% of all programs. And unlike Capsicum, it is "practical" for developers. And important ports like archivers, and web browsers. The Capsicum project never shipped the much touted Capsicum-ized chrome, but OpenBSD has pledge/unveil chrome packages by default.

notaplumber··on Capsicum: Practical Capabilities for Unix
And here's the OpenBSD pledge(2) patch for bzip2, for comparison. But similarly it already prevents a compromised bzip2 process from accessing the network, executing arbitrary commands, etc. And when used in a pipeline, accessing the filesystem. This port might actually be a great candidate for unveil(2), if anyone wants to help send a patch. :-)

https://cvsweb.openbsd.org/cgi-bin/cvsweb/~checkout~/ports/a...

And as is typical for FreeBSD, ~7/8 years later these "practical" Capsicum changes were never merged into FreeBSD. :-(

https://github.com/freebsd/freebsd/tree/master/contrib/bzip2

notaplumber··on Building an accessible OpenBSD laptop (BSDCan 2019)
"This talk presents the results of a use case study I performed together with my friend Maurice throughout the first quarter of 2019.

Maurice is an actor who survived a brain hemorrhage in 1996 and has since lived with severe physical and cognitive disabilities. His ability to use computers is restricted in many ways. For example, while Maurice can read text just fine, he is unable to fluently spell words and he can only use the fingers on one of his hands."

https://www.bsdcan.org/2019/schedule/events/1047.en.html

PDF slides: https://www.openbsd.org/papers/bsdcan2019-accessible-openbsd...

notaplumber··on OpenMandriva, the first Clang-built Linux distribution
A bit off-topic, sorry, but I'm curious about what you mean by interfacing with Monitors/TVs wirelessly, how does that work?
notaplumber··on OpenMandriva, the first Clang-built Linux distribution
If you're looking for a system that does, OpenBSD adopted libc++ and libc++abi by default.
notaplumber··on OpenMandriva, the first Clang-built Linux distribution
Several *BSD projects have been using the Clang toolchain by default for many years, and have been a massive driving force in getting these fixes upstreamed so that other systems, incl. Linux distributions can benefit from greater choice of compilers.

FreeBSD since 10.x on i386/amd64, not sure about the status on other platforms.

OpenBSD since 6.1 for arm64, 6.2 for i386/amd64. This is both default for the base system, meaning kernel and userland. And also the ports tree, for compiling 3rd party packages, very few ports still depend on gcc.

And also, while not the default system compiler yet, LLVM/clang is compiled and installed on macppc/sparc64 and mips64 systems.

notaplumber··on OpenBSD Recent Security Innovations
Survey says, in the past ~20 years..

https://github.com/freebsd/freebsd/search?q=MAP_NOCORE&unsco...

Pretty much bupkis. But still more than Capsicum!

notaplumber··on A further W^X refinement (OpenBSD)
https://en.wikipedia.org/wiki/W%5EX
notaplumber··on Huawei reviewing FedEx relationship, says packages 'diverted'
Wow, I'm surprised Huawei went to the press with this-- but it's certainly bizarre.
notaplumber··on Unwind: A privilege-separated DNS recursive nameserver for every laptop [pdf]
BSDCan 2019, in Ottawa happening this week!

https://www.bsdcan.org/2019/schedule/events/1055.en.html

Recordings tends to show up YouTube.. later. This talk was also live-streamed earlier today.

Video from previous years: https://www.youtube.com/channel/UCuQhwHMJ0yK2zlfyRr1XZ_Q/vid...

I'm always surprised this conference isn't larger, it always has a wide breadth of low-level technical C/systems talks, with a mix of Unix/networking sysadmin content.

notaplumber··on OpenBSD vmm/vmd update – bhyvecon Tokyo 2019 Mike Larkin
Manuals:

• vmd(8) - https://man.openbsd.org/vmd

• vmctl(8) - https://man.openbsd.org/vmctl

• vm.conf(5) - https://man.openbsd.org/vm.conf

Slides: https://www.openbsd.org/papers/asiabsdcon2019-vmm-slides.pdf

← PreviousPage 4 of 9Next →