Post

Replies

Boosts

Views

Activity

Reply to macOS 27/APFS: Supported ACL Absence Verification When acl_get_fd_np Returns ENOENT
Hi Kevin, Thank you for the additional explanation and for pointing us to the relevant Libc and copyfile implementations. Your clarification resolves our remaining question about enumerating a valid ACL without knowing its entry count in advance. We understand that, when working with an unchanged acl_t successfully returned by acl_get_fd_np, the ACL_FIRST_ENTRY / ACL_NEXT_ENTRY sequence can enumerate the entries, with -1 and EINVAL marking the end of the valid sequence. We also understand your distinction between errors originating in Libc and those returned by the kernel, and that your comments about the exact Libc error paths were not intended as an exhaustive code audit. For our implementation, we will continue to handle genuine retrieval failures separately, preserve descriptor identity checks, and avoid treating invalid inputs or unexpected states as successful verification. Thank you again for the detailed technical guidance and for helping us resolve these questions using the supported macOS interfaces.
Topic: App & System Services SubTopic: Core OS Tags:
1w
Reply to macOS 27/APFS: Supported ACL Absence Verification When acl_get_fd_np Returns ENOENT
Thank you, Kevin. Your direct answers resolve the central ACL-absence interpretation questions for our implementation. We understand your guidance as follows: For a valid descriptor identifying the same existing object, acl_get_fd_np(fd, ACL_TYPE_EXTENDED) returning NULL with immediately captured errno == ENOENT may be interpreted as indicating no ACL entries. When fgetattrlist succeeds with a structurally valid response requesting ATTR_CMN_RETURNED_ATTRS | ATTR_CMN_EXTENDED_SECURITY, without FSOPT_PACK_INVAL_ATTRS, omission of the extended-security returned bit may likewise indicate no ACL entries. Absent and explicit zero-entry ACL records need not be distinguished for the ACL security behavior discussed. You expect these semantics to be consistent across macOS versions, although the historical version range has not been independently validated. This gives us a much clearer basis for interpreting successful ACL-absence observations while continuing to reject genuine API failures, malformed responses, invalid descriptors, and other unverified conditions. We will also retain separate checks for object identity, ownership, mode bits, and the relevant filesystem-operation boundaries. One final question, specifically about the scope of this guidance: Would you consider these interpretations supported macOS API semantics that developers may rely on for security-sensitive checks, or should they be treated as current implementation behavior pending formal documentation? We are not requesting an additional API or a distinction between absent and zero-entry ACL storage. We simply want to record the appropriate assurance level of your clarification. Thank you again for your time and detailed assistance.
Topic: App & System Services SubTopic: Core OS Tags:
2w
Reply to macOS 27/APFS: Supported ACL Absence Verification When acl_get_fd_np Returns ENOENT
Thank you for sharing your Monterey observations and consolidating the discussion here. Your descriptor-bound acl_get_fd_np result is relevant because it suggests that the NULL/ENOENT behavior is not limited to macOS 27. Kevin Elliott has since explained that he expects the underlying ACL semantics to have remained consistent across macOS versions, potentially dating back to Mac OS X 10.4, although he has not independently validated that full version range. Your Monterey observation is therefore useful supporting evidence, but it should remain distinct from a controlled cross-version verification. If you conduct additional tests, comparing acl_get_fd_np with a structurally validated fgetattrlist query on the same existing descriptor would be particularly useful. Thank you for contributing your findings.
Topic: App & System Services SubTopic: Core OS Tags:
2w
Reply to macOS 27/APFS: Supported ACL Absence Verification When acl_get_fd_np Returns ENOENT
Thank you, Pokpong, for the thoughtful response and for clarifying the limits of the documented API behavior. Your interpretation aligns with the fail-closed approach we are taking. We will continue treating both NULL/ENOENT from the ACL getters and omission of ATTR_CMN_EXTENDED_SECURITY as inconclusive, rather than interpreting either as proof of ACL absence. The key unresolved question is whether Apple provides a supported, descriptor-bound mechanism to distinguish an absent ACL from unavailable ACL evidence for an existing APFS object, particularly when explicit zero-entry ACLs can exhibit similar behavior. We will preserve the fixture results and descriptor-bound observations for a potential Feedback Assistant submission and seek clarification of the supported API contract rather than relying on undocumented behavior. For now, the affected security-sensitive operation will remain blocked wherever ACL absence cannot be established reliably. Thank you again for the guidance and the documentation reference. It is helpful in confirming the appropriate security boundary while the underlying API semantics remain unresolved.
Topic: App & System Services SubTopic: Core OS Tags:
Oct ’26
Reply to macOS/APFS: Is there a supported way to create a hard link from an open file descriptor without pathname substitution?
Thank you for taking the time to review my questions and share your technical insights. I sincerely appreciate your detailed explanations and guidance. Your input has been very helpful in clarifying the technical considerations and identifying the appropriate direction for our implementation. Thank you again for your time, expertise, and support. It is greatly appreciated.
Topic: App & System Services SubTopic: Core OS Tags:
Oct ’26
Reply to macOS/APFS: Is there a supported way to create a hard link from an open file descriptor without pathname substitution?
Hi Kevin, Thank you for the detailed response and the code example. This is very helpful. Your confirmation that macOS currently has no supported API for creating a hard link directly from an open file descriptor resolves our primary question. We also understand your suggested approach of using ATTR_CMN_FSID, ATTR_CMN_FILEID, and ATTR_FILE_LINKCOUNT to detect whether the resulting hard link references the intended object. However, our security requirement is specifically to prevent an unauthorized filesystem mutation, rather than detect one afterward. In our threat model, another process operating under the same user account may concurrently replace the source pathname. If linkat() creates a hard link to that substituted object, detecting the mismatch afterward would not satisfy our requirement because the unauthorized mutation has already occurred. I would appreciate clarification on two final points: Regarding your suggestion to validate a file privately and then publish it using renameat() with RENAME_EXCL or RENAME_SWAP: Is there a supported mechanism that guarantees the published object is the exact previously validated inode, even when another process under the same user account can concurrently modify the source directory? Our requirement also includes retaining the original directory entry, rather than moving or replacing it. If no such mechanism exists, would it be accurate to conclude that macOS currently provides no supported public API or filesystem mechanism that guarantees race-free, same-object hard-link publication under this specific same-user adversarial threat model? We want to ensure we are not overlooking a supported macOS capability before considering a different execution platform. Thank you again for your guidance.
Topic: App & System Services SubTopic: Core OS Tags:
Oct ’26
Reply to macOS 27/APFS: Supported ACL Absence Verification When acl_get_fd_np Returns ENOENT
Hi Kevin, Thank you for the additional explanation and for pointing us to the relevant Libc and copyfile implementations. Your clarification resolves our remaining question about enumerating a valid ACL without knowing its entry count in advance. We understand that, when working with an unchanged acl_t successfully returned by acl_get_fd_np, the ACL_FIRST_ENTRY / ACL_NEXT_ENTRY sequence can enumerate the entries, with -1 and EINVAL marking the end of the valid sequence. We also understand your distinction between errors originating in Libc and those returned by the kernel, and that your comments about the exact Libc error paths were not intended as an exhaustive code audit. For our implementation, we will continue to handle genuine retrieval failures separately, preserve descriptor identity checks, and avoid treating invalid inputs or unexpected states as successful verification. Thank you again for the detailed technical guidance and for helping us resolve these questions using the supported macOS interfaces.
Topic: App & System Services SubTopic: Core OS Tags:
Replies
Boosts
Views
Activity
1w
Reply to macOS 27/APFS: Supported ACL Absence Verification When acl_get_fd_np Returns ENOENT
Thank you, Kevin. Your direct answers resolve the central ACL-absence interpretation questions for our implementation. We understand your guidance as follows: For a valid descriptor identifying the same existing object, acl_get_fd_np(fd, ACL_TYPE_EXTENDED) returning NULL with immediately captured errno == ENOENT may be interpreted as indicating no ACL entries. When fgetattrlist succeeds with a structurally valid response requesting ATTR_CMN_RETURNED_ATTRS | ATTR_CMN_EXTENDED_SECURITY, without FSOPT_PACK_INVAL_ATTRS, omission of the extended-security returned bit may likewise indicate no ACL entries. Absent and explicit zero-entry ACL records need not be distinguished for the ACL security behavior discussed. You expect these semantics to be consistent across macOS versions, although the historical version range has not been independently validated. This gives us a much clearer basis for interpreting successful ACL-absence observations while continuing to reject genuine API failures, malformed responses, invalid descriptors, and other unverified conditions. We will also retain separate checks for object identity, ownership, mode bits, and the relevant filesystem-operation boundaries. One final question, specifically about the scope of this guidance: Would you consider these interpretations supported macOS API semantics that developers may rely on for security-sensitive checks, or should they be treated as current implementation behavior pending formal documentation? We are not requesting an additional API or a distinction between absent and zero-entry ACL storage. We simply want to record the appropriate assurance level of your clarification. Thank you again for your time and detailed assistance.
Topic: App & System Services SubTopic: Core OS Tags:
Replies
Boosts
Views
Activity
2w
Reply to macOS 27/APFS: Supported ACL Absence Verification When acl_get_fd_np Returns ENOENT
Thank you for sharing your Monterey observations and consolidating the discussion here. Your descriptor-bound acl_get_fd_np result is relevant because it suggests that the NULL/ENOENT behavior is not limited to macOS 27. Kevin Elliott has since explained that he expects the underlying ACL semantics to have remained consistent across macOS versions, potentially dating back to Mac OS X 10.4, although he has not independently validated that full version range. Your Monterey observation is therefore useful supporting evidence, but it should remain distinct from a controlled cross-version verification. If you conduct additional tests, comparing acl_get_fd_np with a structurally validated fgetattrlist query on the same existing descriptor would be particularly useful. Thank you for contributing your findings.
Topic: App & System Services SubTopic: Core OS Tags:
Replies
Boosts
Views
Activity
2w
Reply to macOS 27/APFS: Supported ACL Absence Verification When acl_get_fd_np Returns ENOENT
Thank you, Pokpong, for the thoughtful response and for clarifying the limits of the documented API behavior. Your interpretation aligns with the fail-closed approach we are taking. We will continue treating both NULL/ENOENT from the ACL getters and omission of ATTR_CMN_EXTENDED_SECURITY as inconclusive, rather than interpreting either as proof of ACL absence. The key unresolved question is whether Apple provides a supported, descriptor-bound mechanism to distinguish an absent ACL from unavailable ACL evidence for an existing APFS object, particularly when explicit zero-entry ACLs can exhibit similar behavior. We will preserve the fixture results and descriptor-bound observations for a potential Feedback Assistant submission and seek clarification of the supported API contract rather than relying on undocumented behavior. For now, the affected security-sensitive operation will remain blocked wherever ACL absence cannot be established reliably. Thank you again for the guidance and the documentation reference. It is helpful in confirming the appropriate security boundary while the underlying API semantics remain unresolved.
Topic: App & System Services SubTopic: Core OS Tags:
Replies
Boosts
Views
Activity
Oct ’26
Reply to macOS/APFS: Is there a supported way to create a hard link from an open file descriptor without pathname substitution?
Thank you for taking the time to review my questions and share your technical insights. I sincerely appreciate your detailed explanations and guidance. Your input has been very helpful in clarifying the technical considerations and identifying the appropriate direction for our implementation. Thank you again for your time, expertise, and support. It is greatly appreciated.
Topic: App & System Services SubTopic: Core OS Tags:
Replies
Boosts
Views
Activity
Oct ’26
Reply to macOS/APFS: Is there a supported way to create a hard link from an open file descriptor without pathname substitution?
Hi Kevin, Thank you for the detailed response and the code example. This is very helpful. Your confirmation that macOS currently has no supported API for creating a hard link directly from an open file descriptor resolves our primary question. We also understand your suggested approach of using ATTR_CMN_FSID, ATTR_CMN_FILEID, and ATTR_FILE_LINKCOUNT to detect whether the resulting hard link references the intended object. However, our security requirement is specifically to prevent an unauthorized filesystem mutation, rather than detect one afterward. In our threat model, another process operating under the same user account may concurrently replace the source pathname. If linkat() creates a hard link to that substituted object, detecting the mismatch afterward would not satisfy our requirement because the unauthorized mutation has already occurred. I would appreciate clarification on two final points: Regarding your suggestion to validate a file privately and then publish it using renameat() with RENAME_EXCL or RENAME_SWAP: Is there a supported mechanism that guarantees the published object is the exact previously validated inode, even when another process under the same user account can concurrently modify the source directory? Our requirement also includes retaining the original directory entry, rather than moving or replacing it. If no such mechanism exists, would it be accurate to conclude that macOS currently provides no supported public API or filesystem mechanism that guarantees race-free, same-object hard-link publication under this specific same-user adversarial threat model? We want to ensure we are not overlooking a supported macOS capability before considering a different execution platform. Thank you again for your guidance.
Topic: App & System Services SubTopic: Core OS Tags:
Replies
Boosts
Views
Activity
Oct ’26