Goodbye pledge "tmppath", hello unveil("/tmp", "rwc")! 

Some observant #OpenBSD users may have noticed developers removing the pledge(2) "tmppath" promise from all base utilities that were using it along with a handful of ports, because this promise, well.. it kinda sucks, and it predates a much better solution: unveil(2).

More info & some backstory in Theo de Raadt's commit.

deraadt@ modified src/{sys,lib}/*: pledge "tmppath" goes away because it sucks. The history is kind of
sad: unveil(2) was invented by Bob Beck and myself because a couple of us struggled and couldn't expand the "tmppath" mechanism to general use.
unveil(2) ended up being kind of "upside down" different, and so we never deleted "tmppath" because the refactorings seemed complicated.
However over the last two weeks, we're removed all the "tmppath" in base pretty easily, and the 18 ports using it have also been fixed.
The majority of situations now use unveil "/tmp" "rwc", unveil "/" "r" or similar, and then pledge "rpath wpath cpath", and this is generally needed to satisfy the mkstemp(3) family of functions in libc.
Use of "tmppath" will now cause pledge(2) to return EINVAL. There is no backwards compatible way of mimic the behaviour correctly using kernel-internal unveil hackery.
Prompted by a report from David Leadbeater; and extensive conversations with beck and semarie.

'CVS: cvs.openbsd.org: src' - MARC

@brynet Thanks for you ongoing efforts!

Heads up: The recent pledge(2) "tmppath" removal has been backported to #OpenBSD 7.7/7.8, and includes updated base system utilities as well as new -stable packages for software using pledge(2), such as web browsers.

https://www.openbsd.org/errata78.html#p015_tmppath

https://www.openbsd.org/errata78.html#p016_pledge_sysctl

https://www.openbsd.org/errata78.html#p017_tmppath

https://www.openbsd.org/errata78.html#p018_pledgepaths

Don't forget to run pkg_add -u before applying the kernel syspatch/errata to avoid errors with old binaries on the new kernel.

OpenBSD 7.8 Errata

the OpenBSD errata page

@brynet do you know why this necessitated patching all the current releases? Not that it's a lot of work but it's definitely mid-release-cycle churn where there usually isn't much.

It would have felt better to just handle these during the 7.9 upgrade in a few months?

@williewillus The errata notes briefly describes the issue, I don't know the full rationale behind the decision to remove tmppath, except it culminated from a report by David Leadbeater, and was deemed worthy of an errata.

I suspect more details will appear soon, so stay tuned.

@brynet syspatch runned, thank you openbsd ’s dev

@jeanmimi The kernel syspatch is still pending, which removes "tmppath" from the kernel.

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

this is errata/7.8/018_pledgepaths.patch.sig

'CVS: cvs.openbsd.org: src' - MARC

@brynet oh that was an other patch then