News for hackers. Stuff that matters.
Re:Pledge and Unveil in OpenBSD [pdf] by Panino on Sunday June 10, 2018 @11:59AM (#17278698)
Awesome!

Given the Chrome example starting on page 6, here's my guess as to how pledge and unveil will contain Chrome to e.g. protect SSH keys. First, 3 of the 5 Chrome processes are already pledged to disallow filesystem reads. The two remaining ones (RenderProcess and UtilityProcess) can be unveiled to allow directories like

  * ~/.config/chromium
  * ~/.cache/chromium
  * ~/Downloads
  * /tmp
  * and anything important I don't know of
Additionally, if unveil works like pledge and can be further restricted after e.g. reading files into memory, unveils can then be undone. Anyone know if the following would work to first allow access to /tmp and then revoke that access?

  unveil("/tmp", "rw");
  /* do some work */
  unveil("/tmp", "");
Re:Pledge and Unveil in OpenBSD [pdf] by notaplumber on Sunday June 10, 2018 @12:09PM (#17278747)
Indeed! The full unveil semantics aren't known yet, may be worth proposing! But for the specific case of /tmp, there is already a tmppath promise.
Re:Pledge and Unveil in OpenBSD [pdf] by aaron_m04 on Monday June 11, 2018 @12:55AM (#17281917)
I wouldn't expect your /tmp example to work, because if unveil is anything like pledge, additional calls can only add restrictions, not take them away.
Re:Pledge and Unveil in OpenBSD [pdf] by toxik on Sunday June 10, 2018 @12:35PM (#17278853)
Shouldn't it be veil()?
Re:Pledge and Unveil in OpenBSD [pdf] by badsectoracula on Sunday June 10, 2018 @12:49PM (#17278921)
The idea is that everything is "veiled" and you "unveil" the stuff you need access to.
Re:Pledge and Unveil in OpenBSD [pdf] by gpvos on Sunday June 10, 2018 @04:07PM (#17279916)
Yes, but the weird thing is that before you call unveil, everything is already unveiled, which is not in sync with the dictionary definition of unveiling. I hope a better name is found.
Re:Pledge and Unveil in OpenBSD [pdf] by notaplumber on Sunday June 10, 2018 @07:01PM (#17280631)
It's unveiling in the context of pledge, as you explicitly declare the things to be unveiled.
Re:Pledge and Unveil in OpenBSD [pdf] by gpvos on Monday June 11, 2018 @04:07AM (#17282616)
Your comment made me try to look up the exact semantics of unveil(2). It was a bit hard to find (I could only find something on its predecessor pledgepath), but apparently, unveil doesn't take effect immediately, but only at an invocation of pledge(2) (which usually follows immediately after it). That was not at all clear from TFA.
Re:Pledge and Unveil in OpenBSD [pdf] by zrth on Sunday June 10, 2018 @05:18PM (#17280186)
Honest question, why is this downvoted?