Debian Codegraph @

man/veritytab.xml

raw
1 <?xml version="1.0"?>
2 <!--*-nxml-*-->
3 <!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
4 "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd">
5 <!--
6 SPDX-License-Identifier: LGPL-2.1-or-later
7
8 This is based on crypttab(5).
9
10 -->
11 <refentry id="veritytab" conditional='HAVE_LIBCRYPTSETUP' xmlns:xi="http://www.w3.org/2001/XInclude">
12
13 <refentryinfo>
14 <title>veritytab</title>
15 <productname>systemd</productname>
16 </refentryinfo>
17
18 <refmeta>
19 <refentrytitle>veritytab</refentrytitle>
20 <manvolnum>5</manvolnum>
21 </refmeta>
22
23 <refnamediv>
24 <refname>veritytab</refname>
25 <refpurpose>Configuration for verity block devices</refpurpose>
26 </refnamediv>
27
28 <refsynopsisdiv>
29 <para><filename>/etc/veritytab</filename></para>
30 </refsynopsisdiv>
31
32 <refsect1>
33 <title>Description</title>
34
35 <para>The <filename>/etc/veritytab</filename> file describes
36 verity protected block devices that are set up during
37 system boot.</para>
38
39 <para>Empty lines and lines starting with the <literal>#</literal>
40 character are ignored. Each of the remaining lines describes one
41 verity protected block device. Fields are delimited by
42 white space.</para>
43
44 <para>Each line is in the form<programlisting><replaceable>volume-name</replaceable> <replaceable>data-device</replaceable> <replaceable>hash-device</replaceable> <replaceable>roothash</replaceable> <optional><replaceable>options</replaceable></optional></programlisting>
45 The first four fields are mandatory, the remaining one is optional.</para>
46
47 <para>The first field contains the name of the resulting verity volume; its block device is set up
48 below <filename>/dev/mapper/</filename>.</para>
49
50 <para>The second field contains a path to the underlying block data device, or a specification of a block device via
51 <varname>UUID=</varname> followed by the <replaceable>UUID</replaceable>.</para>
52
53 <para>The third field contains a path to the underlying block hash device, or a specification of a block device via
54 <varname>UUID=</varname> followed by the <replaceable>UUID</replaceable>.</para>
55
56 <para>The fourth field is the <replaceable>roothash</replaceable> in hexadecimal. If this field is
57 specified as dash, it is attempted to read the root hash from the udev property
58 <literal>ID_DISSECT_PART_ROOTHASH=</literal> (encoded in hexadecimal) of the data device.</para>
59
60 <para>The fifth field, if present, is a comma-delimited list of options. The following options are
61 recognized:</para>
62
63 <variablelist class='fstab-options'>
64
65 <varlistentry>
66 <term><option>superblock=<replaceable>BOOL</replaceable></option></term>
67
68 <listitem><para>Use dm-verity with or without permanent on-disk superblock.</para>
69
70 <xi:include href="version-info.xml" xpointer="v254"/></listitem>
71 </varlistentry>
72
73 <varlistentry>
74 <term><option>format=<replaceable>NUMBER</replaceable></option></term>
75
76 <listitem><para>Specifies the hash version type. Format type <literal>0</literal> is original Chrome OS version. Format type <literal>1</literal> is
77 modern version.</para>
78
79 <xi:include href="version-info.xml" xpointer="v254"/></listitem>
80 </varlistentry>
81
82 <varlistentry>
83 <term><option>data-block-size=<replaceable>BYTES</replaceable></option></term>
84
85 <listitem><para>Used block size for the data device. (Note kernel supports only page-size as maximum
86 here; Multiples of 512 bytes.) </para>
87
88 <xi:include href="version-info.xml" xpointer="v254"/></listitem>
89 </varlistentry>
90
91 <varlistentry>
92 <term><option>hash-block-size=<replaceable>BYTES</replaceable></option></term>
93
94 <listitem><para>Used block size for the hash device. (Note kernel supports only page-size as maximum
95 here; Multiples of 512 bytes.)</para>
96
97 <xi:include href="version-info.xml" xpointer="v254"/></listitem>
98 </varlistentry>
99
100 <varlistentry>
101 <term><option>data-blocks=<replaceable>BLOCKS</replaceable></option></term>
102
103 <listitem><para>Number of blocks of data device used in verification. If not specified, the whole device is
104 used.</para>
105
106 <xi:include href="version-info.xml" xpointer="v254"/></listitem>
107 </varlistentry>
108
109 <varlistentry>
110 <term><option>hash-offset=<replaceable>BYTES</replaceable></option></term>
111
112 <listitem><para>Offset of hash area/superblock on <literal>hash-device</literal>. (Multiples of 512 bytes.)
113 </para>
114
115 <xi:include href="version-info.xml" xpointer="v254"/></listitem>
116 </varlistentry>
117
118 <varlistentry>
119 <term><option>salt=<replaceable>HEX</replaceable></option></term>
120
121 <listitem><para>Salt used for format or verification. Format is a hexadecimal string; 256 bytes long maximum;
122 <literal>-</literal> is the special value for empty.</para>
123
124 <xi:include href="version-info.xml" xpointer="v254"/></listitem>
125 </varlistentry>
126
127 <varlistentry>
128 <term><option>uuid=<replaceable>UUID</replaceable></option></term>
129
130 <listitem><para>Use the provided <replaceable>UUID</replaceable> instead of generating new one. The <replaceable>UUID</replaceable> must be
131 provided in standard <acronym>UUID</acronym> format, e.g. <literal>12345678-1234-1234-1234-123456789abc</literal>.</para>
132
133 <xi:include href="version-info.xml" xpointer="v254"/></listitem>
134 </varlistentry>
135
136 <varlistentry>
137 <term><option>ignore-corruption</option></term>
138 <term><option>restart-on-corruption</option></term>
139 <term><option>panic-on-corruption</option></term>
140
141 <listitem><para>Defines what to do if a data verity problem is detected (data corruption). Without these
142 options kernel fails the <acronym>IO</acronym> operation with <acronym>I/O</acronym> error. With <option>--ignore-corruption</option> option the
143 corruption is only logged. With <option>--restart-on-corruption</option> or
144 <option>--panic-on-corruption</option> the kernel is restarted (panicked) immediately.
145
146 (You have to provide way how to avoid restart loops.)</para>
147
148 <xi:include href="version-info.xml" xpointer="v248"/></listitem>
149 </varlistentry>
150
151 <varlistentry>
152 <term><option>ignore-zero-blocks</option></term>
153
154 <listitem><para>Instruct kernel to not verify blocks that are expected to contain zeroes and always directly
155 return zeroes instead.</para>
156
157 <warning>
158 <para>Use this option only in very specific cases. This option is available since Linux kernel version 4.5.</para>
159 </warning>
160
161 <xi:include href="version-info.xml" xpointer="v248"/></listitem>
162 </varlistentry>
163
164 <varlistentry>
165 <term><option>check-at-most-once</option></term>
166
167 <listitem><para>Instruct kernel to verify blocks only the first time they are read from the data device, rather
168 than every time.</para>
169
170 <warning>
171 <para>It provides a reduced level of security because only offline tampering of the data device's content
172 will be detected, not online tampering. This option is available since Linux kernel version 4.17.</para>
173 </warning>
174
175 <xi:include href="version-info.xml" xpointer="v248"/></listitem>
176 </varlistentry>
177
178 <varlistentry>
179 <term><option>hash=<replaceable>HASH</replaceable></option></term>
180
181 <listitem><para>Hash algorithm for dm-verity. This should be the name of the algorithm, like "sha1". For default
182 see <command>veritysetup --help</command>.</para>
183
184 <xi:include href="version-info.xml" xpointer="v254"/></listitem>
185 </varlistentry>
186
187 <varlistentry>
188 <term><option>fec-device=<replaceable>PATH</replaceable></option></term>
189
190 <listitem><para>Use forward error correction (<acronym>FEC</acronym>) to recover from corruption if hash verification fails. Use
191 encoding data from the specified device. The fec device argument can be block device or file image.
192 If fec device path does not exist, it will be created as file. Note: block sizes for data and hash devices must
193 match. Also, if the verity data_device is encrypted the fec_device should be too.</para>
194
195 <xi:include href="version-info.xml" xpointer="v254"/></listitem>
196 </varlistentry>
197
198 <varlistentry>
199 <term><option>fec-offset=<replaceable>BYTES</replaceable></option></term>
200
201 <listitem><para>This is the offset, in bytes, from the start of the <acronym>FEC</acronym> device to the beginning of the encoding
202 data. (Aligned on 512 bytes.)</para>
203
204 <xi:include href="version-info.xml" xpointer="v254"/></listitem>
205 </varlistentry>
206
207 <varlistentry>
208 <term><option>fec-roots=<replaceable>NUM</replaceable></option></term>
209
210 <listitem><para>Number of generator roots. This equals to the number of parity bytes in the encoding data. In
211 RS(M, N) encoding, the number of roots is M-N. M is 255 and M-N is between 2 and 24 (including).</para>
212
213 <xi:include href="version-info.xml" xpointer="v254"/>
214 </listitem>
215 </varlistentry>
216
217 <varlistentry>
218 <term><option>root-hash-signature=<replaceable>PATH</replaceable>|base64:<replaceable>BASE64</replaceable>|auto</option></term>
219
220 <listitem><para>A Base64 string encoding the root hash signature prefixed by
221 <literal>base64:</literal>, or an absolute path to a root hash signature file used to verify the root
222 hash (in kernel). If the special string <literal>auto</literal> is specified, the root hash signature
223 is attempted to be read from the udev property <literal>ID_DISSECT_PART_ROOTHASH_SIG=</literal> (in
224 Base64 format) of the data device. This feature requires Linux kernel version 5.4 or more
225 recent.</para>
226
227 <xi:include href="version-info.xml" xpointer="v248"/></listitem>
228 </varlistentry>
229
230 <varlistentry>
231 <term><option>_netdev</option></term>
232
233 <listitem><para>Marks this veritysetup device as requiring network. It will be
234 started after the network is available, similarly to
235 <citerefentry><refentrytitle>systemd.mount</refentrytitle><manvolnum>5</manvolnum></citerefentry>
236 units marked with <option>_netdev</option>. The service unit to set up this device
237 will be ordered between <filename>remote-fs-pre.target</filename> and
238 <filename>remote-veritysetup.target</filename>, instead of
239 <filename>veritysetup-pre.target</filename> and
240 <filename>veritysetup.target</filename>.</para>
241
242 <para>Hint: if this device is used for a mount point that is specified in
243 <citerefentry project='man-pages'><refentrytitle>fstab</refentrytitle><manvolnum>5</manvolnum></citerefentry>,
244 the <option>_netdev</option> option should also be used for the mount
245 point. Otherwise, a dependency loop might be created where the mount point
246 will be pulled in by <filename>local-fs.target</filename>, while the
247 service to configure the network is usually only started <emphasis>after</emphasis>
248 the local file system has been mounted.</para>
249
250 <xi:include href="version-info.xml" xpointer="v248"/>
251 </listitem>
252 </varlistentry>
253
254 <varlistentry>
255 <term><option>noauto</option></term>
256
257 <listitem><para>This device will not be added to <filename>veritysetup.target</filename>.
258 This means that it will not be automatically enabled on boot, unless something else pulls
259 it in. In particular, if the device is used for a mount point, it'll be enabled
260 automatically during boot, unless the mount point itself is also disabled with
261 <option>noauto</option>.</para>
262
263 <xi:include href="version-info.xml" xpointer="v248"/></listitem>
264 </varlistentry>
265
266 <varlistentry>
267 <term><option>nofail</option></term>
268
269 <listitem><para>This device will not be a hard dependency of
270 <filename>veritysetup.target</filename>. It'll still be pulled in and started, but the system
271 will not wait for the device to show up and be enabled, and boot will not fail if this is
272 unsuccessful. Note that other units that depend on the enabled device may still fail. In
273 particular, if the device is used for a mount point, the mount point itself also needs to
274 have the <option>nofail</option> option, or the boot will fail if the device is not enabled
275 successfully.</para>
276
277 <xi:include href="version-info.xml" xpointer="v248"/></listitem>
278 </varlistentry>
279
280 <varlistentry>
281 <term><option>x-initrd.attach</option></term>
282
283 <listitem><para>Setup this verity protected block device in the initrd, similarly to
284 <citerefentry><refentrytitle>systemd.mount</refentrytitle><manvolnum>5</manvolnum></citerefentry>
285 units marked with <option>x-initrd.mount</option>.</para>
286
287 <para>Although it is not necessary to mark the mount entry for the root file system with
288 <option>x-initrd.mount</option>, <option>x-initrd.attach</option> is still recommended with
289 the verity protected block device containing the root file system as otherwise systemd
290 will attempt to detach the device during the regular system shutdown while it is still in
291 use. With this option the device will still be detached but later after the root file
292 system is unmounted.</para>
293
294 <para>All other verity protected block devices that contain file systems mounted in the initrd should
295 use this option.</para>
296
297 <xi:include href="version-info.xml" xpointer="v248"/>
298 </listitem>
299 </varlistentry>
300
301 <varlistentry>
302 <term><option>tpm2-measure-nvpcr=</option></term>
303
304 <listitem><para>Takes a boolean argument, or an NvPCR name as argument. May be used to enable
305 automatic measurement of the volume name and Verity root hash, as well as the serials and issuers of
306 the certificates used to generate the provided signatures (if any) will be measured. Passing false
307 disables the mechanism. Passing true enables measurement into the <literal>verity</literal> NvPCR. If
308 any other string is specified this selects the NvPCR to measure into by name.</para>
309
310 <xi:include href="version-info.xml" xpointer="v260"/></listitem>
311 </varlistentry>
312
313 </variablelist>
314
315 <para>At early boot and when the system manager configuration is
316 reloaded, this file is translated into native systemd units by
317 <citerefentry><refentrytitle>systemd-veritysetup-generator</refentrytitle><manvolnum>8</manvolnum></citerefentry>.</para>
318 </refsect1>
319
320 <refsect1>
321 <title>Examples</title>
322 <example>
323 <title>/etc/veritytab example</title>
324 <para>Set up two verity protected block devices. One using device blocks, another using files.</para>
325
326 <programlisting>usr PARTUUID=783e45ae-7aa3-484a-beef-a80ff9c19cbb PARTUUID=21dc1dfe-4c33-8b48-98a9-918a22eb3e37 36e3f740ad502e2c25e2a23d9c7c17bf0fdad2300b7580842d4b7ec1fb0fa263 auto
327 data /etc/data /etc/hash a5ee4b42f70ae1f46a08a7c92c2e0a20672ad2f514792730f5d49d7606ab8fdf auto
328 </programlisting>
329 </example>
330 </refsect1>
331
332 <refsect1>
333 <title>See Also</title>
334 <para><simplelist type="inline">
335 <member><citerefentry><refentrytitle>systemd</refentrytitle><manvolnum>1</manvolnum></citerefentry></member>
336 <member><citerefentry><refentrytitle>[email protected]</refentrytitle><manvolnum>8</manvolnum></citerefentry></member>
337 <member><citerefentry><refentrytitle>systemd-veritysetup-generator</refentrytitle><manvolnum>8</manvolnum></citerefentry></member>
338 <member><citerefentry project='man-pages'><refentrytitle>fstab</refentrytitle><manvolnum>5</manvolnum></citerefentry></member>
339 <member><citerefentry project='man-pages'><refentrytitle>veritysetup</refentrytitle><manvolnum>8</manvolnum></citerefentry></member>
340 </simplelist></para>
341 </refsect1>
342
343 </refentry>