On Thu, 12 Nov 2026 10:06:15 +0100, Alexander Schreiber wrote:
> Lawrence D’Oliveiro <l…@nz.invalid> wrote:
>> >> On Wed, 11 Nov 2026 19:56:07 -0800, Andy Valencia wrote: >>
>>> The guarded FD's.
>> >> What exactly was a “guarded” FD?
> > Those seem to be fd's that can only be accessed in combination with a > specific guard token, otherwise access fails. A short mention is here: > https://hacktricks.wiki/en/macos-hardening/macos-security-and-privilege-escalation/macos-security-protections/macos-fs-tricks/index.html#macos-guarded-descriptors > and the header is here: > https://github.com/apple/darwin-xnu/blob/main/bsd/sys/guarded.h
So I had a look at that header file, and I still don’t quite understand what it’s about. You can forbid writing and closing, but not reading. So what do those guarded_close and guarded_write calls do? Are they forbidden as well? Or does the prohibition only apply to *unguarded* closes and writes? Seems you cannot forbid changing of the guard anyway.