My custom filesystem kernel extension stores ACLs as an extended attribute, com.apple.system.Security.
Sanboxed apps such as TextEdit, Pages, etc., running as a non-privileged process, fail to save modified contents when permissive ACLs are in use.
Running them as a privileged process, does allow for file changes to be saved though.
Non-sandboxed apps, such as VSCode, and command line programs are not susceptible to this behaviour.
APFS, on the other hand, seems to handle ACLs as an ATTR_CMN_EXTENDED_SECURITY filesystem attribute, rather than as an EA. In this case, sandboxed apps have no trouble accessing the ACL data.
I implemented a minimal PoC within my custom kext to verify this. I construct an ACL in memory allowing a given user to write,append,delete file contents, and return it that via vnop_getattr. This allows the file contents to be modified and saved by sandboxed apps.
Can you please confirm if my findings are accurate and sandboxed apps fail to read the com.apple.system.Security EA by design?
Also, Is it an accurate assumption, that ACLs should be handled either as an EA, or an ATTR_CMN_EXTENDED_SECURITY, but not both?
Thanks.