xref: /xnu-10063.121.3/osfmk/man/host_security_create_task_token.html (revision 2c2f96dc2b9a4408a43d3150ae9c105355ca3daa)
1*2c2f96dcSApple OSS Distributions<h2>host_security_create_task_token</h2>
2*2c2f96dcSApple OSS Distributions<hr>
3*2c2f96dcSApple OSS Distributions<p>
4*2c2f96dcSApple OSS Distributions<strong>Function</strong> - Create a new task with an explicit security token.
5*2c2f96dcSApple OSS Distributions<h3>SYNOPSIS</h3>
6*2c2f96dcSApple OSS Distributions<pre>
7*2c2f96dcSApple OSS Distributions<strong>kern_return_t   host_security_create_task_token</strong>
8*2c2f96dcSApple OSS Distributions                <strong>(host_security_t</strong>                  <var>host_security</var>,
9*2c2f96dcSApple OSS Distributions                 <strong>task_t</strong>                             <var>parent_task</var>,
10*2c2f96dcSApple OSS Distributions                 <strong>security_token_t</strong>                <var>security_token</var>,
11*2c2f96dcSApple OSS Distributions                 <strong>audit_token_t</strong>                      <var>audit_token</var>,
12*2c2f96dcSApple OSS Distributions                 <strong>ledger_port_array_t</strong>                    <var>ledgers</var>,
13*2c2f96dcSApple OSS Distributions                 <strong>boolean_t</strong>                       <var>inherit_memory</var>,
14*2c2f96dcSApple OSS Distributions                 <strong>task_t</strong>                             <var>child_task</var><strong>);</strong>
15*2c2f96dcSApple OSS Distributions</pre>
16*2c2f96dcSApple OSS Distributions<h3>PARAMETERS</h3>
17*2c2f96dcSApple OSS Distributions<dl>
18*2c2f96dcSApple OSS Distributions<p>
19*2c2f96dcSApple OSS Distributions<dt><var>host_security</var>
20*2c2f96dcSApple OSS Distributions<dd>
21*2c2f96dcSApple OSS Distributions[in security send right] The host's security port.
22*2c2f96dcSApple OSS Distributions<p>
23*2c2f96dcSApple OSS Distributions<dt><var>parent_task</var>
24*2c2f96dcSApple OSS Distributions<dd>
25*2c2f96dcSApple OSS Distributions[in task send right] The port for the task from which to draw the child
26*2c2f96dcSApple OSS Distributionstask's port rights and address space.
27*2c2f96dcSApple OSS Distributions<p>
28*2c2f96dcSApple OSS Distributions<dt><var>security_token</var>
29*2c2f96dcSApple OSS Distributions<dd>
30*2c2f96dcSApple OSS Distributions[in scalar] The task's security token.
31*2c2f96dcSApple OSS Distributions<p>
32*2c2f96dcSApple OSS Distributions<dt><var>audit_token</var>
33*2c2f96dcSApple OSS Distributions<dd>
34*2c2f96dcSApple OSS Distributions[in scalar] The task's audit token.
35*2c2f96dcSApple OSS Distributions<p>
36*2c2f96dcSApple OSS Distributions<dt><var>ledgers</var>
37*2c2f96dcSApple OSS Distributions<dd>
38*2c2f96dcSApple OSS Distributions[pointer to in array of ledger send rights] The set of ledgers from which the
39*2c2f96dcSApple OSS Distributionstask will draw its resources.
40*2c2f96dcSApple OSS Distributions<p>
41*2c2f96dcSApple OSS Distributions<dt><var>inherit_memory</var>
42*2c2f96dcSApple OSS Distributions<dd>
43*2c2f96dcSApple OSS Distributions[in scalar] Address space inheritance indicator. If true, the child task in-
44*2c2f96dcSApple OSS Distributionsherits the address space of the parent task. If false, the kernel assigns
45*2c2f96dcSApple OSS Distributionsthe child task an empty address space.
46*2c2f96dcSApple OSS Distributions<p>
47*2c2f96dcSApple OSS Distributions<dt><var>child_task</var>
48*2c2f96dcSApple OSS Distributions<dd>
49*2c2f96dcSApple OSS Distributions[out task send right] The kernel-assigned port name for the new task.
50*2c2f96dcSApple OSS Distributions</dl>
51*2c2f96dcSApple OSS Distributions<h3>DESCRIPTION</h3>
52*2c2f96dcSApple OSS Distributions<p>
53*2c2f96dcSApple OSS DistributionsThe <strong><strong>host_security_create_task_token</strong> function creates a new task from
54*2c2f96dcSApple OSS Distributions<var>parent_task</var> with explicit security and audit token values, returning the name of the
55*2c2f96dcSApple OSS Distributionsnew task in the parameter specified by <var>child_task</var>. Other than the security and audit token values, the child task
56*2c2f96dcSApple OSS Distributionsis as if created by <strong>task_create</strong>.
57*2c2f96dcSApple OSS Distributions<h3>NOTES</h3>
58*2c2f96dcSApple OSS Distributions<p>
59*2c2f96dcSApple OSS DistributionsThe host security port is a privileged port given to the system
60*2c2f96dcSApple OSS Distributionsbootstrap task for the use of this call.
61*2c2f96dcSApple OSS Distributions<h3>RETURN VALUES</h3>
62*2c2f96dcSApple OSS Distributions<dl>
63*2c2f96dcSApple OSS Distributions<p>
64*2c2f96dcSApple OSS Distributions<dt> <strong>KERN_INVALID_SECURITY</strong>
65*2c2f96dcSApple OSS Distributions<dd>
66*2c2f96dcSApple OSS DistributionsThe value of <var>host_security</var> does not specify the security port for the host on which task lies.
67*2c2f96dcSApple OSS Distributions</dl>
68*2c2f96dcSApple OSS Distributions<h3>RELATED INFORMATION</h3>
69*2c2f96dcSApple OSS Distributions<p>
70*2c2f96dcSApple OSS DistributionsFunctions:
71*2c2f96dcSApple OSS Distributions<a href="task_create.html"><strong>task_create</strong></a>,
72*2c2f96dcSApple OSS Distributions<a href="host_security_set_task_token.html"><strong>host_security_set_task_token</strong></a>,
73*2c2f96dcSApple OSS Distributions<a href="mach_msg.html"><strong>mach_msg</strong></a>.
74