Hi,

Theo de Raadt wrote on Wed, Jul 31, 2019 at 09:48:57AM -0600:
> Ricardo Mestre <[email protected]> wrote:

>> By now we are already confident that pledge(2) "just works(tm)"
>> and that it can be used to effectively remove filesystem access.
>> 
>> That being said, in spamd(8) when I pledge(2)d it the main priv process got
>> "stdio inet" which means there's no fs access at all so calling
>> chroot(2)/chdir(2) here doesn't make sense anymore. Just remove them.

> I'm fine with removing chroot+chdir where unveil or pledge provide the
> same (or better) isolation.
> 
> But let's do it program by program, carefully considering the case.
> 
> I need to mention this change makes such programs unsafe to operate
> in portable environments which lack pledge/unveil.  An extra safety
> belt is being removed we don't need, but other people need that
> safety belt a lot.  That doesn't change my view we should make
> the programs simpler without chroot; the impact is for downstreams
> to handle.

Maybe put a comment above the pledge() call?
Something like:

        /*
         * When porting this program to a platform lacking pledge(2),
         * don't forget to at least properly chroot(2) the child instead.
         */

The spamd(8) utility does look like a plausible candidate for porting,
but i'm not sure how familiar the porters are with OpenBSD ways,
so the removal of chroot(2) might easily cause misunderstandings.
Consider e.g. projects like

  http://greyd.org/
  https://aur.tuna.tsinghua.edu.cn/packages/greyd/

which appear to have very little connection to OpenBSD.

Yours,
   Ingo

Reply via email to