Skip to content
Snippets Groups Projects
Commit a859c01a authored by Eric Biggers's avatar Eric Biggers Committed by Nick Desaulniers
Browse files

UPSTREAM: fscrypto: lock inode while setting encryption policy


commit 8906a8223ad4909b391c5628f7991ebceda30e52 upstream.

i_rwsem needs to be acquired while setting an encryption policy so that
concurrent calls to FS_IOC_SET_ENCRYPTION_POLICY are correctly
serialized (especially the ->get_context() + ->set_context() pair), and
so that new files cannot be created in the directory during or after the
->empty_dir() check.

Bug: 38276297
Signed-off-by: default avatarEric Biggers <ebiggers@google.com>
Signed-off-by: default avatarTheodore Ts'o <tytso@mit.edu>
Reviewed-by: default avatarRichard Weinberger <richard@nod.at>
Cc: stable@vger.kernel.org
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
(cherry picked from commit 3a19419c)
Change-Id: I67a50f992998f985bd0fe98245c1a2525ce5d261
Signed-off-by: default avatarEric Biggers <ebiggers@google.com>
parent 21ceafcd
No related branches found
No related tags found
No related merge requests found
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment