Skip to content

Commit ef4a253

Browse files
committed
Update docs
1 parent 5903e97 commit ef4a253

File tree

1 file changed

+28
-4
lines changed

1 file changed

+28
-4
lines changed

clang/docs/PointerAuthentication.rst

Lines changed: 28 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -283,7 +283,7 @@ a number of different tests.
283283
__ptrauth Qualifier
284284
^^^^^^^^^^^^^^^^^^^
285285

286-
``__ptrauth(key, address, discriminator)`` is an extended type
286+
``__ptrauth(key, address, discriminator, options)`` is an extended type
287287
qualifier which causes so-qualified objects to hold pointers or pointer sized
288288
integers signed using the specified schema rather than the default schema for
289289
such types.
@@ -303,6 +303,9 @@ The qualifier's operands are as follows:
303303

304304
- ``discriminator`` - a constant discriminator; must be a constant expression
305305

306+
- ``options`` - a constant string expression containing a list of comma
307+
separated authentication options; see ``ptrauth_qualifier_options``_
308+
306309
See `Discriminators`_ for more information about discriminators.
307310
308311
Currently the operands must be constant-evaluable even within templates. In the
@@ -314,9 +317,9 @@ qualifiers on a parameter (after parameter type adjustment) are ignored when
314317
deriving the type of the function. The parameter will be passed using the
315318
default ABI for the unqualified pointer type.
316319

317-
If ``x`` is an object of type ``__ptrauth(key, address, discriminator) T``,
318-
then the signing schema of the value stored in ``x`` is a key of ``key`` and
319-
a discriminator determined as follows:
320+
If ``x`` is an object of type ``__ptrauth(key, address, discriminator, options) T``,
321+
then the signing schema of the value stored in ``x`` is a key of ``key`` and a
322+
discriminator determined as follows:
320323

321324
- if ``address`` is 0, then the discriminator is ``discriminator``;
322325

@@ -327,6 +330,27 @@ a discriminator determined as follows:
327330
is ``ptrauth_blend_discriminator(&x, discriminator)``; see
328331
`ptrauth_blend_discriminator`_.
329332

333+
``ptrauth_qualifier_options``
334+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
335+
336+
The options parameter to the ``__ptrauth`` qualifier is a string of comma
337+
separated modifiers to the normal authentication behavior. Currently supported
338+
options are
339+
340+
- Authentication mode: This is one of ``strip``, ``sign-and-strip``, and
341+
``sign-and-auth``. The ability to modify this behavior is intended to support
342+
staging ABI changes. The ``strip`` mode results in the PAC bits of a value
343+
being stripped from any value and disabled any other authentication
344+
operations. ``sign-and-strip`` strips an authenticated on read, but will
345+
ensure a correct signature is set on assignment. Finally ``sign-and-auth`` is
346+
the default mode, and provides full protection for the value.
347+
348+
- ``authenticates-null-values``: By default the __ptrauth qualifier does not
349+
sign the zero value. This permits fast implementation of null checks in the
350+
common case where a null value is safe. The ``authenticates-null-values``
351+
option overrides this behavior, and permits null values to be protected with
352+
pointer authentication.
353+
330354
``<ptrauth.h>``
331355
~~~~~~~~~~~~~~~
332356

0 commit comments

Comments
 (0)