Access mask bits

The 32-bit access mask has the same shape for every object type. Bits 0–15 are object-specific, 16–20 are standard rights, 24–25 are special, 28–31 are generic. The standard, special and generic regions are uniform; the object-specific bits carry different meanings for different object types.

This page is the catalogue of right values. What the mask means — how it is evaluated, how generic bits expand — is PCDS §5.3, which is normative. The bit layout of the mask within a descriptor is PCDS §5.1.

Bit rangeRegionExamples
0–15Object-specificFILE_READ_DATA, PROCESS_TERMINATE, TOKEN_QUERY
16–20Standard rightsDELETE, READ_CONTROL, WRITE_DAC, WRITE_OWNER, SYNCHRONIZE
21–23ReservedRejected at parse. PCDS §5.3.
24–25SpecialACCESS_SYSTEM_SECURITY, MAXIMUM_ALLOWED
26–27ReservedRejected at parse.
28–31GenericGENERIC_ALL, GENERIC_EXECUTE, GENERIC_WRITE, GENERIC_READ

File access rights #

RightValueFor filesFor directories (alias)
FILE_READ_DATA0x0001Read file contentFILE_LIST_DIRECTORY — list entries
FILE_WRITE_DATA0x0002Write file contentFILE_ADD_FILE — create files
FILE_APPEND_DATA0x0004Append-only writeFILE_ADD_SUBDIRECTORY — create subdirectory
FILE_READ_EA0x0008Read extended attributesSame
FILE_WRITE_EA0x0010Write extended attributesSame
FILE_EXECUTE0x0020Execute fileFILE_TRAVERSE — traverse through
FILE_DELETE_CHILD0x0040(not applicable)Delete children regardless of their permissions
FILE_READ_ATTRIBUTES0x0080Read attributesSame
FILE_WRITE_ATTRIBUTES0x0100Write attributesSame

The directory names are aliases: identical bit values, different naming convention depending on whether the object is a file or a directory.

File GenericMapping #

Generic rightMaps to
GENERIC_READFILE_READ_DATA | FILE_READ_ATTRIBUTES | FILE_READ_EA | READ_CONTROL | SYNCHRONIZE
GENERIC_WRITEFILE_WRITE_DATA | FILE_APPEND_DATA | FILE_WRITE_ATTRIBUTES | FILE_WRITE_EA | READ_CONTROL | SYNCHRONIZE
GENERIC_EXECUTEFILE_EXECUTE | FILE_READ_ATTRIBUTES | READ_CONTROL | SYNCHRONIZE
GENERIC_ALLEvery file-specific bit, plus DELETE, READ_CONTROL, WRITE_DAC, WRITE_OWNER, SYNCHRONIZE

FILE_ALL_ACCESS = STANDARD_RIGHTS_REQUIRED | SYNCHRONIZE | 0x1FF = 0x001F01FF.

Process access rights #

RightValueMeaning
PROCESS_TERMINATE0x0001Send terminating signals.
PROCESS_SIGNAL0x0002Send non-terminating informational signals — SIGCHLD, SIGURG, SIGWINCH.
PROCESS_VM_READ0x0010Read process memory — ptrace(PTRACE_PEEK*), process_vm_readv, /proc/<pid>/mem reads.
PROCESS_VM_WRITE0x0020Write process memory — ptrace(PTRACE_POKE*, ATTACH), process_vm_writev.
PROCESS_DUP_HANDLE0x0040Duplicate file descriptors out via pidfd_getfd.
PROCESS_SET_INFORMATION0x0200Change process attributes — priority, affinity, rlimits, /proc/<pid>/* writes.
PROCESS_QUERY_INFORMATION0x0400Detailed process info — token, full /proc/<pid>/* reads.
PROCESS_SUSPEND_RESUME0x0800Send stop and continue signals.
PROCESS_QUERY_LIMITED0x1000Basic info — PID, image name, state. Required by pidfd_open.

Bits 0x0004, 0x0008, 0x0080 and 0x0100 are unused.

Process GenericMapping #

Generic rightMaps to
GENERIC_READPROCESS_QUERY_INFORMATION | PROCESS_VM_READ | READ_CONTROL
GENERIC_WRITEPROCESS_SET_INFORMATION | PROCESS_VM_WRITE | WRITE_DAC
GENERIC_EXECUTEPROCESS_TERMINATE | PROCESS_SUSPEND_RESUME | PROCESS_QUERY_LIMITED
GENERIC_ALLAll process-specific bits, plus STANDARD_RIGHTS_REQUIRED | SYNCHRONIZE

PROCESS_ALL_ACCESS = STANDARD_RIGHTS_REQUIRED | SYNCHRONIZE | 0x1FFF = 0x001F1FFF.

Token access rights #

RightValueMeaning
TOKEN_ASSIGN_PRIMARY0x0001Install as a process's primary token.
TOKEN_DUPLICATE0x0002Create a copy.
TOKEN_IMPERSONATE0x0004Install as a thread's impersonation token.
TOKEN_QUERY0x0008Read token information.
TOKEN_QUERY_SOURCE0x0010Subsumed by TOKEN_QUERY. Reserved for format compatibility.
TOKEN_ADJUST_PRIVILEGES0x0020Enable, disable or remove privileges.
TOKEN_ADJUST_GROUPS0x0040Enable or disable groups.
TOKEN_ADJUST_DEFAULT0x0080Change default DACL, owner index, primary group index.
TOKEN_ADJUST_SESSIONID0x0100Change interactive_session_id. Additionally requires SeTcbPrivilege.

TOKEN_QUERY_SOURCE is a documented bit position rather than an enforced right: a token fd granting TOKEN_QUERY suffices for everything, and TOKEN_QUERY_SOURCE is not separately checked.

Token GenericMapping #

Generic rightMaps to
GENERIC_READTOKEN_QUERY | READ_CONTROL
GENERIC_WRITETOKEN_ADJUST_PRIVILEGES | TOKEN_ADJUST_GROUPS | TOKEN_ADJUST_DEFAULT | WRITE_DAC
GENERIC_EXECUTETOKEN_IMPERSONATE
GENERIC_ALLTOKEN_ALL_ACCESS

TOKEN_ALL_ACCESS = STANDARD_RIGHTS_REQUIRED | 0x01FF = 0x000F01FF. Note the absence of SYNCHRONIZE, unlike the file and process aggregates.

Registry-key access rights #

RightValueMeaning
KEY_QUERY_VALUE0x0001Read a value.
KEY_SET_VALUE0x0002Write a value.
KEY_CREATE_SUB_KEY0x0004Create a subkey.
KEY_ENUMERATE_SUB_KEYS0x0008Enumerate subkeys.
KEY_NOTIFY0x0010Watch for changes.
KEY_CREATE_LINK0x0020Create a symbolic link to another key.

Bits from 0x0040 upward are reserved.

Registry GenericMapping #

Generic rightMaps to
GENERIC_READKEY_QUERY_VALUE | KEY_ENUMERATE_SUB_KEYS | KEY_NOTIFY | READ_CONTROL
GENERIC_WRITEKEY_SET_VALUE | KEY_CREATE_SUB_KEY | READ_CONTROL
GENERIC_EXECUTEREAD_CONTROL
GENERIC_ALLAll key-specific bits, plus STANDARD_RIGHTS_REQUIRED | SYNCHRONIZE

Service access rights #

RightValueMeaning
SERVICE_QUERY_CONFIG0x0001Read configuration.
SERVICE_CHANGE_CONFIG0x0002Modify configuration.
SERVICE_QUERY_STATUS0x0004Read runtime status.
SERVICE_ENUMERATE_DEPENDENTS0x0008List dependent services.
SERVICE_START0x0010Start the service.
SERVICE_STOP0x0020Stop the service.
SERVICE_PAUSE_CONTINUE0x0040Pause and resume.
SERVICE_INTERROGATE0x0080Request a status update.
SERVICE_USER_DEFINED_CONTROL0x0100Send service-specific control codes.

Standard, special and generic rights #

RightValue
DELETE0x00010000
READ_CONTROL0x00020000
WRITE_DAC0x00040000
WRITE_OWNER0x00080000
SYNCHRONIZE0x00100000
ACCESS_SYSTEM_SECURITY0x01000000
MAXIMUM_ALLOWED0x02000000
GENERIC_ALL0x10000000
GENERIC_EXECUTE0x20000000
GENERIC_WRITE0x40000000
GENERIC_READ0x80000000

The STANDARD_RIGHTS aggregates #

ConstantValueComposition
STANDARD_RIGHTS_REQUIRED0x000F0000DELETE | READ_CONTROL | WRITE_DAC | WRITE_OWNER
STANDARD_RIGHTS_READ0x00020000Alias of READ_CONTROL
STANDARD_RIGHTS_WRITE0x00020000Alias of READ_CONTROL
STANDARD_RIGHTS_EXECUTE0x00020000Alias of READ_CONTROL
STANDARD_RIGHTS_ALL0x001F0000All five standard rights

Three of these are the same value. STANDARD_RIGHTS_READ, _WRITE and _EXECUTE are all aliases of READ_CONTROL, which surprises people reading a mask and expecting them to differ. Only STANDARD_RIGHTS_REQUIRED and STANDARD_RIGHTS_ALL name distinct values.

STANDARD_RIGHTS_REQUIRED is the conventional minimum included in every *_ALL_ACCESS aggregate.

Edit this page