mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2026-05-25 03:37:45 +03:00
OpenZFS 4185 - add new cryptographic checksums to ZFS: SHA-512, Skein, Edon-R
Reviewed by: George Wilson <george.wilson@delphix.com> Reviewed by: Prakash Surya <prakash.surya@delphix.com> Reviewed by: Saso Kiselkov <saso.kiselkov@nexenta.com> Reviewed by: Richard Lowe <richlowe@richlowe.net> Approved by: Garrett D'Amore <garrett@damore.org> Ported by: Tony Hutter <hutter2@llnl.gov> OpenZFS-issue: https://www.illumos.org/issues/4185 OpenZFS-commit: https://github.com/openzfs/openzfs/commit/45818ee Porting Notes: This code is ported on top of the Illumos Crypto Framework code: https://github.com/zfsonlinux/zfs/pull/4329/commits/b5e030c8dbb9cd393d313571dee4756fbba8c22d The list of porting changes includes: - Copied module/icp/include/sha2/sha2.h directly from illumos - Removed from module/icp/algs/sha2/sha2.c: #pragma inline(SHA256Init, SHA384Init, SHA512Init) - Added 'ctx' to lib/libzfs/libzfs_sendrecv.c:zio_checksum_SHA256() since it now takes in an extra parameter. - Added CTASSERT() to assert.h from for module/zfs/edonr_zfs.c - Added skein & edonr to libicp/Makefile.am - Added sha512.S. It was generated from sha512-x86_64.pl in Illumos. - Updated ztest.c with new fletcher_4_*() args; used NULL for new CTX argument. - In icp/algs/edonr/edonr_byteorder.h, Removed the #if defined(__linux) section to not #include the non-existant endian.h. - In skein_test.c, renane NULL to 0 in "no test vector" array entries to get around a compiler warning. - Fixup test files: - Rename <sys/varargs.h> -> <varargs.h>, <strings.h> -> <string.h>, - Remove <note.h> and define NOTE() as NOP. - Define u_longlong_t - Rename "#!/usr/bin/ksh" -> "#!/bin/ksh -p" - Rename NULL to 0 in "no test vector" array entries to get around a compiler warning. - Remove "for isa in $($ISAINFO); do" stuff - Add/update Makefiles - Add some userspace headers like stdio.h/stdlib.h in places of sys/types.h. - EXPORT_SYMBOL *_Init/*_Update/*_Final... routines in ICP modules. - Update scripts/zfs2zol-patch.sed - include <sys/sha2.h> in sha2_impl.h - Add sha2.h to include/sys/Makefile.am - Add skein and edonr dirs to icp Makefile - Add new checksums to zpool_get.cfg - Move checksum switch block from zfs_secpolicy_setprop() to zfs_check_settable() - Fix -Wuninitialized error in edonr_byteorder.h on PPC - Fix stack frame size errors on ARM32 - Don't unroll loops in Skein on 32-bit to save stack space - Add memory barriers in sha2.c on 32-bit to save stack space - Add filetest_001_pos.ksh checksum sanity test - Add option to write psudorandom data in file_write utility
This commit is contained in:
+107
-1
@@ -1,5 +1,5 @@
|
||||
'\" te
|
||||
.\" Copyright (c) 2013 by Delphix. All rights reserved.
|
||||
.\" Copyright (c) 2012, 2015 by Delphix. All rights reserved.
|
||||
.\" Copyright (c) 2013 by Saso Kiselkov. All rights reserved.
|
||||
.\" Copyright (c) 2014, Joyent, Inc. All rights reserved.
|
||||
.\" The contents of this file are subject to the terms of the Common Development
|
||||
@@ -457,5 +457,111 @@ allow more data to be stored in the bonus buffer, thus potentially
|
||||
improving performance by avoiding the use of spill blocks.
|
||||
.RE
|
||||
|
||||
\fB\fBsha512\fR\fR
|
||||
.ad
|
||||
.RS 4n
|
||||
.TS
|
||||
l l .
|
||||
GUID org.illumos:sha512
|
||||
READ\-ONLY COMPATIBLE no
|
||||
DEPENDENCIES none
|
||||
.TE
|
||||
|
||||
This feature enables the use of the SHA-512/256 truncated hash algorithm
|
||||
(FIPS 180-4) for checksum and dedup. The native 64-bit arithmetic of
|
||||
SHA-512 provides an approximate 50% performance boost over SHA-256 on
|
||||
64-bit hardware and is thus a good minimum-change replacement candidate
|
||||
for systems where hash performance is important, but these systems
|
||||
cannot for whatever reason utilize the faster \fBskein\fR and
|
||||
\fBedonr\fR algorithms.
|
||||
|
||||
When the \fBsha512\fR feature is set to \fBenabled\fR, the administrator
|
||||
can turn on the \fBsha512\fR checksum on any dataset using the
|
||||
\fBzfs set checksum=sha512\fR(1M) command. This feature becomes
|
||||
\fBactive\fR once a \fBchecksum\fR property has been set to \fBsha512\fR,
|
||||
and will return to being \fBenabled\fR once all filesystems that have
|
||||
ever had their checksum set to \fBsha512\fR are destroyed.
|
||||
|
||||
Booting off of pools utilizing SHA-512/256 is supported (provided that
|
||||
the updated GRUB stage2 module is installed).
|
||||
|
||||
.RE
|
||||
|
||||
.sp
|
||||
.ne 2
|
||||
.na
|
||||
\fB\fBskein\fR\fR
|
||||
.ad
|
||||
.RS 4n
|
||||
.TS
|
||||
l l .
|
||||
GUID org.illumos:skein
|
||||
READ\-ONLY COMPATIBLE no
|
||||
DEPENDENCIES none
|
||||
.TE
|
||||
|
||||
This feature enables the use of the Skein hash algorithm for checksum
|
||||
and dedup. Skein is a high-performance secure hash algorithm that was a
|
||||
finalist in the NIST SHA-3 competition. It provides a very high security
|
||||
margin and high performance on 64-bit hardware (80% faster than
|
||||
SHA-256). This implementation also utilizes the new salted checksumming
|
||||
functionality in ZFS, which means that the checksum is pre-seeded with a
|
||||
secret 256-bit random key (stored on the pool) before being fed the data
|
||||
block to be checksummed. Thus the produced checksums are unique to a
|
||||
given pool, preventing hash collision attacks on systems with dedup.
|
||||
|
||||
When the \fBskein\fR feature is set to \fBenabled\fR, the administrator
|
||||
can turn on the \fBskein\fR checksum on any dataset using the
|
||||
\fBzfs set checksum=skein\fR(1M) command. This feature becomes
|
||||
\fBactive\fR once a \fBchecksum\fR property has been set to \fBskein\fR,
|
||||
and will return to being \fBenabled\fR once all filesystems that have
|
||||
ever had their checksum set to \fBskein\fR are destroyed.
|
||||
|
||||
Booting off of pools using \fBskein\fR is \fBNOT\fR supported
|
||||
-- any attempt to enable \fBskein\fR on a root pool will fail with an
|
||||
error.
|
||||
|
||||
.RE
|
||||
|
||||
.sp
|
||||
.ne 2
|
||||
.na
|
||||
\fB\fBedonr\fR\fR
|
||||
.ad
|
||||
.RS 4n
|
||||
.TS
|
||||
l l .
|
||||
GUID org.illumos:edonr
|
||||
READ\-ONLY COMPATIBLE no
|
||||
DEPENDENCIES none
|
||||
.TE
|
||||
|
||||
This feature enables the use of the Edon-R hash algorithm for checksum,
|
||||
including for nopwrite (if compression is also enabled, an overwrite of
|
||||
a block whose checksum matches the data being written will be ignored).
|
||||
In an abundance of caution, Edon-R can not be used with dedup
|
||||
(without verification).
|
||||
|
||||
Edon-R is a very high-performance hash algorithm that was part
|
||||
of the NIST SHA-3 competition. It provides extremely high hash
|
||||
performance (over 350% faster than SHA-256), but was not selected
|
||||
because of its unsuitability as a general purpose secure hash algorithm.
|
||||
This implementation utilizes the new salted checksumming functionality
|
||||
in ZFS, which means that the checksum is pre-seeded with a secret
|
||||
256-bit random key (stored on the pool) before being fed the data block
|
||||
to be checksummed. Thus the produced checksums are unique to a given
|
||||
pool.
|
||||
|
||||
When the \fBedonr\fR feature is set to \fBenabled\fR, the administrator
|
||||
can turn on the \fBedonr\fR checksum on any dataset using the
|
||||
\fBzfs set checksum=edonr\fR(1M) command. This feature becomes
|
||||
\fBactive\fR once a \fBchecksum\fR property has been set to \fBedonr\fR,
|
||||
and will return to being \fBenabled\fR once all filesystems that have
|
||||
ever had their checksum set to \fBedonr\fR are destroyed.
|
||||
|
||||
Booting off of pools using \fBedonr\fR is \fBNOT\fR supported
|
||||
-- any attempt to enable \fBedonr\fR on a root pool will fail with an
|
||||
error.
|
||||
|
||||
.SH "SEE ALSO"
|
||||
\fBzpool\fR(8)
|
||||
|
||||
Reference in New Issue
Block a user