Makefile: Add security compiling option (RELRO, SC, and FORTIFY)
[platform/upstream/cryptsetup.git] / man / veritysetup.8
1 .TH VERITYSETUP "8" "December 2013" "veritysetup" "Maintenance Commands"
2 .SH NAME
3 veritysetup - manage dm-verity (block level verification) volumes
4 .SH SYNOPSIS
5 .B veritysetup <options> <action> <action args>
6 .SH DESCRIPTION
7 .PP
8 Veritysetup is used to configure dm-verity managed device-mapper mappings.
9
10 Device-mapper verity target provides read-only transparent integrity
11 checking of block devices using kernel crypto API.
12
13 The dm-verity devices are always read-only.
14
15 Veritysetup supports these operations:
16 .PP
17 \fIformat\fR <data_device> <hash_device>
18 .IP
19 Calculates and permanently stores hash verification data for data_device.
20 Hash area can be located on the same device after data if specified
21 by \-\-hash\-offset option.
22
23 Note you need to provide root hash string for device verification
24 or activation. Root hash must be trusted.
25
26 The data or hash device argument can be block device or file image.
27 If hash device path doesn't exist, it will be created as file.
28
29 \fB<options>\fR can be [\-\-hash, \-\-no-superblock, \-\-format,
30 \-\-data-block-size, \-\-hash-block-size, \-\-data-blocks, \-\-hash-offset,
31 \-\-salt, \-\-uuid]
32 .PP
33 \fIcreate\fR <name> <data_device> <hash_device> <root_hash>
34 .IP
35 Creates a mapping with <name> backed by device <data_device> and using
36 <hash_device> for in-kernel verification.
37
38 The <root_hash> is a hexadecimal string.
39
40 \fB<options>\fR can be [\-\-hash-offset, \-\-no-superblock]
41
42 If option \-\-no-superblock is used, you have to use as the same options
43 as in initial format operation.
44 .PP
45 \fIverify\fR <data_device> <hash_device> <root_hash>
46 .IP
47 Verifies data on data_device with use of hash blocks stored on hash_device.
48
49 This command performs userspace verification, no kernel device is created.
50
51 The <root_hash> is a hexadecimal string.
52
53 \fB<options>\fR can be [\-\-hash-offset, \-\-no-superblock]
54
55 If option \-\-no-superblock is used, you have to use as the same options
56 as in initial format operation.
57 .PP
58 \fIremove\fR <name>
59 .IP
60 Removes existing mapping <name>.
61 .PP
62 \fIstatus\fR <name>
63 .IP
64 Reports status for the active verity mapping <name>.
65 .PP
66 \fIdump\fR <hash_device>
67 .IP
68 Reports parameters of verity device from on-disk stored superblock.
69
70 \fB<options>\fR can be [\-\-no-superblock]
71 .SH OPTIONS
72 .TP
73 .B "\-\-verbose, \-v"
74 Print more information on command execution.
75 .TP
76 .B "\-\-debug"
77 Run in debug mode with full diagnostic logs. Debug output
78 lines are always prefixed by '#'.
79 .TP
80 .B "\-\-no-superblock"
81 Create or use dm-verity without permanent on-disk superblock.
82 .TP
83 .B "\-\-format=number"
84 Specifies the hash version type.
85 Format type 0 is original Chrome OS verion. Format type 1 is current version.
86 .TP
87 .B "\-\-data-block-size=bytes"
88 Used block size for the data device.
89 (Note kernel supports only page-size as maximum here.)
90 .TP
91 .B "\-\-hash-block-size=bytes"
92 Used block size for the hash device.
93 (Note kernel supports only page-size as maximum here.)
94 .TP
95 .B "\-\-data-blocks=blocks"
96 Size of data device used in verification.
97 If not specified, the whole device is used.
98 .TP
99 .B "\-\-hash-offset=bytes"
100 Offset of hash area/superblock on hash_device.
101 Value must be aligned to disk sector offset.
102 .TP
103 .B "\-\-salt=hex string"
104 Salt used for format or verification.
105 Format is a hexadecimal string.
106 .TP
107 .B "\-\-uuid=UUID"
108 Use the provided UUID for format command instead of generating new one.
109
110 The UUID must be provided in standard UUID format,
111 e.g. 12345678-1234-1234-1234-123456789abc.
112 .TP
113 .B "\-\-version"
114 Show the program version.
115 .SH RETURN CODES
116 Veritysetup returns 0 on success and a non-zero value on error.
117
118 Error codes are: 1 wrong parameters, 2 no permission,
119 3 out of memory, 4 wrong device specified, 5 device already exists
120 or device is busy.
121 .SH REPORTING BUGS
122 Report bugs, including ones in the documentation, on
123 the cryptsetup mailing list at <dm-crypt@saout.de>
124 or in the 'Issues' section on LUKS website.
125 Please attach the output of the failed command with the
126 \-\-debug option added.
127 .SH AUTHORS
128 The first implementation of veritysetup was written by Chrome OS authors.
129
130 This version is based on verification code written by Mikulas Patocka <mpatocka@redhat.com>
131 and rewritten for libcryptsetup by Milan Broz <gmazyland@gmail.com>.
132 .SH COPYRIGHT
133 Copyright \(co 2012-2013 Red Hat, Inc.
134 .br
135 Copyright \(co 2012-2014 Milan Broz
136
137 This is free software; see the source for copying conditions.  There is NO
138 warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
139 .SH SEE ALSO
140 The project website at \fBhttps://gitlab.com/cryptsetup/cryptsetup\fR
141
142 The verity on-disk format specification available at
143 \fBhttps://gitlab.com/cryptsetup/cryptsetup/wikis/DMVerity\fR