linux/fs/crypto
Eric Biggers 92cfcd030e fscrypt: remove reachable WARN in fscrypt_setup_iv_ino_lblk_32_key()
I_CREATING isn't actually set until the inode has been assigned an inode
number and inserted into the inode hash table.  So the WARN_ON() in
fscrypt_setup_iv_ino_lblk_32_key() is wrong, and it can trigger when
creating an encrypted file on ext4.  Remove it.

This was sometimes causing xfstest generic/602 to fail on ext4.  I
didn't notice it before because due to a separate oversight, new inodes
that haven't been assigned an inode number yet don't necessarily have
i_ino == 0 as I had thought, so by chance I never saw the test fail.

Fixes: a992b20cd4 ("fscrypt: add fscrypt_prepare_new_inode() and fscrypt_set_context()")
Reported-by: Theodore Y. Ts'o <tytso@mit.edu>
Link: https://lore.kernel.org/r/20201031004556.87862-1-ebiggers@kernel.org
Signed-off-by: Eric Biggers <ebiggers@google.com>
2020-11-06 09:48:55 -08:00
..
Kconfig fscrypt: switch fscrypt_do_sha256() to use the SHA-256 library 2020-07-21 16:02:13 -07:00
Makefile fscrypt: add inline encryption support 2020-07-08 10:29:30 -07:00
bio.c fscrypt: add inline encryption support 2020-07-08 10:29:30 -07:00
crypto.c fscrypt: adjust logging for in-creation inodes 2020-09-22 06:48:38 -07:00
fname.c fscrypt: export fscrypt_d_revalidate() 2020-09-28 14:44:51 -07:00
fscrypt_private.h fscrypt: handle test_dummy_encryption in more logical way 2020-09-22 06:48:49 -07:00
hkdf.c fscrypt: use crypto_shash_tfm_digest() 2020-05-08 15:32:14 +10:00
hooks.c fscrypt: rename DCACHE_ENCRYPTED_NAME to DCACHE_NOKEY_NAME 2020-09-23 21:29:49 -07:00
inline_crypt.c fscrypt: stop pretending that key setup is nofs-safe 2020-09-22 06:48:42 -07:00
keyring.c fscrypt: adjust logging for in-creation inodes 2020-09-22 06:48:38 -07:00
keysetup.c fscrypt: remove reachable WARN in fscrypt_setup_iv_ino_lblk_32_key() 2020-11-06 09:48:55 -08:00
keysetup_v1.c fscrypt: stop pretending that key setup is nofs-safe 2020-09-22 06:48:42 -07:00
policy.c fscrypt: make fscrypt_set_test_dummy_encryption() take a 'const char *' 2020-09-22 06:48:52 -07:00