Permalink
Please sign in to comment.
Browse files
Illumos Crypto Port module added to enable native encryption in zfs
A port of the Illumos Crypto Framework to a Linux kernel module (found in module/icp). This is needed to do the actual encryption work. We cannot use the Linux kernel's built in crypto api because it is only exported to GPL-licensed modules. Having the ICP also means the crypto code can run on any of the other kernels under OpenZFS. I ended up porting over most of the internals of the framework, which means that porting over other API calls (if we need them) should be fairly easy. Specifically, I have ported over the API functions related to encryption, digests, macs, and crypto templates. The ICP is able to use assembly-accelerated encryption on amd64 machines and AES-NI instructions on Intel chips that support it. There are place-holder directories for similar assembly optimizations for other architectures (although they have not been written). Signed-off-by: Tom Caputi <tcaputi@datto.com> Signed-off-by: Tony Hutter <hutter2@llnl.gov> Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov> Issue #4329
- Loading branch information...
Showing
with
35,834 additions
and 80 deletions.
- +1 −0 .gitignore
- +22 −0 config/always-arch.m4
- +0 −19 config/user-arch.m4
- +0 −1 config/user.m4
- +1 −3 config/zfs-build.m4
- +4 −1 configure.ac
- +0 −19 copy-builtin
- +1 −1 include/sys/Makefile.am
- +20 −0 include/sys/crypto/Makefile.am
- +425 −0 include/sys/crypto/api.h
- +583 −0 include/sys/crypto/common.h
- +41 −0 include/sys/crypto/icp.h
- +27 −1 include/sys/zfs_context.h
- +3 −3 lib/Makefile.am
- +78 −0 lib/libicp/Makefile.am
- +22 −0 lib/libspl/include/sys/byteorder.h
- +1 −1 lib/libspl/include/sys/file.h
- +1 −0 lib/libspl/include/sys/types.h
- +2 −1 lib/libzpool/Makefile.am
- +93 −7 lib/libzpool/kernel.c
- +0 −20 lib/libzpool/taskq.c
- +8 −2 module/Makefile.in
- +82 −0 module/icp/Makefile.in
- +1,618 −0 module/icp/algs/aes/aes_impl.c
- +135 −0 module/icp/algs/aes/aes_modes.c
- +305 −0 module/icp/algs/modes/cbc.c
- +920 −0 module/icp/algs/modes/ccm.c
- +238 −0 module/icp/algs/modes/ctr.c
- +143 −0 module/icp/algs/modes/ecb.c
- +748 −0 module/icp/algs/modes/gcm.c
- +159 −0 module/icp/algs/modes/modes.c
- +663 −0 module/icp/algs/sha1/sha1.c
- +495 −0 module/icp/algs/sha2/sha2.c
- +935 −0 module/icp/api/kcf_cipher.c
- +151 −0 module/icp/api/kcf_ctxops.c
- +494 −0 module/icp/api/kcf_digest.c
- +648 −0 module/icp/api/kcf_mac.c
- +127 −0 module/icp/api/kcf_miscapi.c
- +23 −0 module/icp/asm-x86_64/aes/THIRDPARTYLICENSE.gladman
- +1 −0 module/icp/asm-x86_64/aes/THIRDPARTYLICENSE.gladman.descrip
- +127 −0 module/icp/asm-x86_64/aes/THIRDPARTYLICENSE.openssl
- +1 −0 module/icp/asm-x86_64/aes/THIRDPARTYLICENSE.openssl.descrip
- +900 −0 module/icp/asm-x86_64/aes/aes_amd64.S
- +851 −0 module/icp/asm-x86_64/aes/aes_intel.S
- +580 −0 module/icp/asm-x86_64/aes/aeskey.c
- +770 −0 module/icp/asm-x86_64/aes/aesopt.h
- +165 −0 module/icp/asm-x86_64/aes/aestab.h
- +594 −0 module/icp/asm-x86_64/aes/aestab2.h
- +334 −0 module/icp/asm-x86_64/modes/gcm_intel.S
- +1,346 −0 module/icp/asm-x86_64/sha1/sha1-x86_64.S
- +2,060 −0 module/icp/asm-x86_64/sha2/sha256_impl.S
- +1,567 −0 module/icp/core/kcf_callprov.c
- +775 −0 module/icp/core/kcf_mech_tabs.c
- +229 −0 module/icp/core/kcf_prov_lib.c
- +638 −0 module/icp/core/kcf_prov_tabs.c
- +1,763 −0 module/icp/core/kcf_sched.c
- +152 −0 module/icp/illumos-crypto.c
- +170 −0 module/icp/include/aes/aes_impl.h
- +385 −0 module/icp/include/modes/modes.h
- +61 −0 module/icp/include/sha1/sha1.h
- +65 −0 module/icp/include/sha1/sha1_consts.h
- +73 −0 module/icp/include/sha1/sha1_impl.h
- +116 −0 module/icp/include/sha2/sha2.h
- +219 −0 module/icp/include/sha2/sha2_consts.h
- +62 −0 module/icp/include/sha2/sha2_impl.h
- +36 −0 module/icp/include/sys/asm_linkage.h
- +183 −0 module/icp/include/sys/bitmap.h
- +137 −0 module/icp/include/sys/crypto/elfsign.h
- +1,370 −0 module/icp/include/sys/crypto/impl.h
- +1,483 −0 module/icp/include/sys/crypto/ioctl.h
- +136 −0 module/icp/include/sys/crypto/ioctladmin.h
- +630 −0 module/icp/include/sys/crypto/ops_impl.h
- +531 −0 module/icp/include/sys/crypto/sched_impl.h
- +721 −0 module/icp/include/sys/crypto/spi.h
- +307 −0 module/icp/include/sys/ia32/asm_linkage.h
- +160 −0 module/icp/include/sys/ia32/stack.h
- +107 −0 module/icp/include/sys/ia32/trap.h
- +477 −0 module/icp/include/sys/modctl.h
- +147 −0 module/icp/include/sys/modhash.h
- +108 −0 module/icp/include/sys/modhash_impl.h
- +36 −0 module/icp/include/sys/stack.h
- +36 −0 module/icp/include/sys/trap.h
- +1,437 −0 module/icp/io/aes.c
- +1,239 −0 module/icp/io/sha1_mod.c
- +1,307 −0 module/icp/io/sha2_mod.c
- +171 −0 module/icp/os/modconf.c
- +925 −0 module/icp/os/modhash.c
- +927 −0 module/icp/spi/kcf_spi.c
- +1 −1 scripts/common.sh.in
- +1 −0 zfs-script-config.sh.in
| @@ -0,0 +1,22 @@ | ||
| dnl # | ||
| dnl # Set the target arch for libspl atomic implementation and the icp | ||
| dnl # | ||
| AC_DEFUN([ZFS_AC_CONFIG_ALWAYS_ARCH], [ | ||
| AC_MSG_CHECKING(for target asm dir) | ||
| TARGET_ARCH=`echo ${target_cpu} | sed -e s/i.86/i386/` | ||
| case $TARGET_ARCH in | ||
| i386|x86_64) | ||
| TARGET_ASM_DIR=asm-${TARGET_ARCH} | ||
| ;; | ||
| *) | ||
| TARGET_ASM_DIR=asm-generic | ||
| ;; | ||
| esac | ||
| AC_SUBST([TARGET_ASM_DIR]) | ||
| AM_CONDITIONAL([TARGET_ASM_X86_64], test $TARGET_ASM_DIR = asm-x86_64) | ||
| AM_CONDITIONAL([TARGET_ASM_I386], test $TARGET_ASM_DIR = asm-i386) | ||
| AM_CONDITIONAL([TARGET_ASM_GENERIC], test $TARGET_ASM_DIR = asm-generic) | ||
| AC_MSG_RESULT([$TARGET_ASM_DIR]) | ||
| ]) |
| @@ -0,0 +1,20 @@ | ||
| COMMON_H = \ | ||
| $(top_srcdir)/include/sys/crypto/api.h \ | ||
| $(top_srcdir)/include/sys/crypto/common.h \ | ||
| $(top_srcdir)/include/sys/crypto/icp.h | ||
| KERNEL_H = | ||
| USER_H = | ||
| EXTRA_DIST = $(COMMON_H) $(KERNEL_H) $(USER_H) | ||
| if CONFIG_USER | ||
| libzfsdir = $(includedir)/libzfs/sys/crypto | ||
| libzfs_HEADERS = $(COMMON_H) $(USER_H) | ||
| endif | ||
| if CONFIG_KERNEL | ||
| kerneldir = @prefix@/src/zfs-$(VERSION)/include/sys/crypto | ||
| kernel_HEADERS = $(COMMON_H) $(KERNEL_H) | ||
| endif |
Oops, something went wrong.
0 comments on commit
0b04990