5.1 File Security
<peios/file.h> is the file surface of KACS. Where ordinary POSIX open()
gives you a file descriptor governed by mode bits, peios_file_open performs
a native KACS open — an NtCreateFile-shaped call carrying a desired
access mask, a create disposition, create options, the sharing it allows
other opens, and an optional creator security descriptor — and hands back
an ordinary Linux file fd whose granted access mask is fixed for the fd's
lifetime. Because the grant is baked into
the fd, it can be delegated safely by dup, SCM_RIGHTS, or across exec:
whoever holds the fd holds exactly the access it was opened with, no more.
Alongside the open, this module:
- reads back what an open was granted, sets its file's delete disposition and renames the link it names (Working through a handle);
- takes NT byte-range locks and leases through it (Locks and leases);
- reads and sets a file's read-only flag and Created At (Special attributes);
- reads and writes a file's security descriptor, by path or by fd; and
- governs how a superblock without native SD storage is treated.
The wire constants and argument structs (KACS_DISPOSITION_*,
KACS_CREATE_OPT_*, KACS_FILE_*, KACS_OPEN_*, KACS_RENAME_*,
KACS_LOCK_*, KACS_LEASE_*, KACS_SATTR_*, KACS_SECINFO_*,
KACS_MOUNT_POLICY_*, KACS_STATUS_*, struct kacs_open_info,
struct kacs_lease_break, struct kacs_sattr) come from <pkm/file.h> and
<pkm/sd.h>. The security descriptors these calls exchange
are built and parsed with
<peios/security.h>.
5.1.1 See also #
<peios/security.h>— building the creator SDs and parsing the SDs these calls return.<peios/access.h>— evaluating a file SD withpeios_file_generic_mapping.- File access and Mount policies — the operator-side model of native file security.
- Sharing and Deletion — the kernel's rules for share modes, delete-pending files and pinning.