kernel_optimize_test/Documentation/filesystems
Eric Biggers 68ac723fb1 fscrypt: allow 256-bit master keys with AES-256-XTS
[ Upstream commit 7f595d6a6cdc336834552069a2e0a4f6d4756ddf ]

fscrypt currently requires a 512-bit master key when AES-256-XTS is
used, since AES-256-XTS keys are 512-bit and fscrypt requires that the
master key be at least as long any key that will be derived from it.

However, this is overly strict because AES-256-XTS doesn't actually have
a 512-bit security strength, but rather 256-bit.  The fact that XTS
takes twice the expected key size is a quirk of the XTS mode.  It is
sufficient to use 256 bits of entropy for AES-256-XTS, provided that it
is first properly expanded into a 512-bit key, which HKDF-SHA512 does.

Therefore, relax the check of the master key size to use the security
strength of the derived key rather than the size of the derived key
(except for v1 encryption policies, which don't use HKDF).

Besides making things more flexible for userspace, this is needed in
order for the use of a KDF which only takes a 256-bit key to be
introduced into the fscrypt key hierarchy.  This will happen with
hardware-wrapped keys support, as all known hardware which supports that
feature uses an SP800-108 KDF using AES-256-CMAC, so the wrapped keys
are wrapped 256-bit AES keys.  Moreover, there is interest in fscrypt
supporting the same type of AES-256-CMAC based KDF in software as an
alternative to HKDF-SHA512.  There is no security problem with such
features, so fix the key length check to work properly with them.

Reviewed-by: Paul Crowley <paulcrowley@google.com>
Link: https://lore.kernel.org/r/20210921030303.5598-1-ebiggers@kernel.org
Signed-off-by: Eric Biggers <ebiggers@google.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2021-11-18 14:03:54 +01:00
..
caching
cifs
ext4 ext4: describe fast_commit feature flags 2020-11-06 23:01:01 -05:00
nfs Documentation: update RPCSEC_GSSv3 RFC link 2020-09-25 18:01:27 -04:00
spufs
9p.rst
adfs.rst
affs.rst affs: fix basic permission bits to actually work 2020-08-31 12:20:31 +02:00
afs.rst
api-summary.rst docs: fs: api-summary.rst: get rid of kernel-doc include 2020-10-28 11:41:15 -06:00
autofs-mount-control.rst
autofs.rst
automount-support.rst
befs.rst
bfs.rst
btrfs.rst
ceph.rst libceph, rbd, ceph: "blacklist" -> "blocklist" 2020-10-12 15:29:26 +02:00
coda.rst
configfs.rst
cramfs.rst
dax.txt
debugfs.rst debugfs: remove return value of debugfs_create_devm_seqfile() 2020-10-30 08:37:39 +01:00
devpts.rst
directory-locking.rst
dlmfs.rst ocfs2: replace HTTP links with HTTPS ones 2020-08-07 11:33:22 -07:00
dnotify.rst
ecryptfs.rst
efivarfs.rst
erofs.rst
ext2.rst
ext3.rst
f2fs.rst f2fs: fix to avoid adding tab before doc section 2021-07-20 16:05:52 +02:00
fiemap.rst
files.rst
fscrypt.rst fscrypt: allow 256-bit master keys with AES-256-XTS 2021-11-18 14:03:54 +01:00
fsverity.rst docs: get rid of :c:type explicit declarations for structs 2020-10-15 07:49:40 +02:00
fuse-io.rst
fuse.rst fuse: update project homepage 2020-09-04 11:32:10 +02:00
gfs2-glocks.rst
gfs2-uevents.rst
gfs2.rst
hfs.rst
hfsplus.rst
hpfs.rst
index.rst Documentation: better locations for sysfs-pci, sysfs-tagging 2020-10-09 09:33:23 -06:00
inotify.rst
isofs.rst
journalling.rst jbd2: drop jbd2_fc_init documentation 2020-11-06 23:01:03 -05:00
locking.rst Documentation/filesystems/locking.rst: remove an incorrect sentence 2020-09-02 07:59:59 -06:00
locks.rst
mandatory-locking.rst
mount_api.rst Documentation: filesystems: mount_api: fix headings 2020-09-24 10:37:43 -06:00
nilfs2.rst
ntfs.rst
ocfs2-online-filecheck.rst
ocfs2.rst ocfs2: replace HTTP links with HTTPS ones 2020-08-07 11:33:22 -07:00
omfs.rst
orangefs.rst
overlayfs.rst ovl: implement volatile-specific fsync error behaviour 2021-02-10 09:29:16 +01:00
path-lookup.rst
path-lookup.txt
porting.rst
proc.rst doc, mm: clarify /proc/<pid>/oom_score value range 2020-08-12 10:57:56 -07:00
qnx6.rst
quota.rst
ramfs-rootfs-initramfs.rst Documentation: Fix intiramfs script name 2021-07-28 14:35:47 +02:00
relay.rst
romfs.rst
seq_file.rst seq_file: document how per-entry resources are managed. 2021-03-04 11:38:37 +01:00
sharedsubtree.rst
splice.rst
squashfs.rst
sysfs.rst Driver Core patches for 5.10-rc1 2020-10-14 16:09:32 -07:00
sysv-fs.rst
tmpfs.rst tmpfs: support 64-bit inums per-sb 2020-08-07 11:33:24 -07:00
ubifs-authentication.rst docs: ubifs-authentication: Add a top-level heading 2020-09-09 11:53:33 -06:00
ubifs.rst
udf.rst
vfat.rst
vfs.rst
virtiofs.rst
xfs-delayed-logging-design.rst
xfs-self-describing-metadata.rst
zonefs.rst zonefs: document the explicit-open mount option 2020-09-15 18:32:58 +09:00