android_kernel_oneplus_msm8998/fs/f2fs
Eric Biggers 1bb1d4252d fscrypto: require write access to mount to set encryption policy
commit ba63f23d69a3a10e7e527a02702023da68ef8a6d upstream.

[Please apply to 4.4-stable.  Note: this was already backported, but
only to ext4; it was missed that it should go to f2fs as well.  This is
needed to make xfstest generic/395 pass on f2fs.]

Since setting an encryption policy requires writing metadata to the
filesystem, it should be guarded by mnt_want_write/mnt_drop_write.
Otherwise, a user could cause a write to a frozen or readonly
filesystem.  This was handled correctly by f2fs but not by ext4.  Make
fscrypt_process_policy() handle it rather than relying on the filesystem
to get it right.

Signed-off-by: Eric Biggers <ebiggers@google.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Acked-by: Jaegeuk Kim <jaegeuk@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-10-27 10:23:18 +02:00
..
acl.c f2fs: Don't clear SGID when inheriting ACLs 2017-07-27 15:06:07 -07:00
acl.h f2fs: avoid deadlock on init_inode_metadata 2014-11-03 16:07:33 -08:00
checkpoint.c f2fs: support lower priority asynchronous readahead in ra_meta_pages 2015-10-12 14:03:15 -07:00
crypto.c f2fs crypto: replace some BUG_ON()'s with error checks 2017-10-27 10:23:18 +02:00
crypto_fname.c f2fs crypto: replace some BUG_ON()'s with error checks 2017-10-27 10:23:18 +02:00
crypto_key.c fscrypt: fix dereference of NULL user_key_payload 2017-10-27 10:23:18 +02:00
crypto_policy.c fscrypt: fix context consistency check when key(s) unavailable 2017-05-25 14:30:11 +02:00
data.c f2fs: do not wait for writeback in write_begin 2017-10-21 17:09:05 +02:00
debug.c f2fs: set ->owner for debugfs status file's file_operations 2017-01-06 11:16:13 +01:00
dir.c fscrypt: avoid collisions when presenting long encrypted filenames 2017-05-25 14:30:11 +02:00
extent_cache.c f2fs: fix to skip shrinking extent nodes 2015-10-22 09:39:35 -07:00
f2fs.h f2fs: check entire encrypted bigname when finding a dentry 2017-05-25 14:30:11 +02:00
f2fs_crypto.h fscrypt: remove broken support for detecting keyring key revocation 2017-03-31 09:49:54 +02:00
file.c fscrypto: require write access to mount to set encryption policy 2017-10-27 10:23:18 +02:00
gc.c f2fs: relocate the tracepoint for background_gc 2015-10-13 10:02:01 -07:00
gc.h f2fs: support synchronous gc in ioctl 2015-10-09 16:20:56 -07:00
hash.c f2fs: check entire encrypted bigname when finding a dentry 2017-05-25 14:30:11 +02:00
inline.c f2fs: check entire encrypted bigname when finding a dentry 2017-05-25 14:30:11 +02:00
inode.c f2fs: no need to lock for update_inode_page all the time 2015-10-09 16:20:50 -07:00
Kconfig f2fs: fix typo 2015-08-21 22:43:32 -07:00
Makefile f2fs: maintain extent cache in separated file 2015-08-04 14:09:58 -07:00
namei.c fs/f2fs/namei.c: remove unnecessary new_valid_dev() check 2015-11-09 15:11:24 -08:00
node.c f2fs: export ra_nid_pages to sysfs 2015-10-12 14:03:43 -07:00
node.h f2fs: export ra_nid_pages to sysfs 2015-10-12 14:03:43 -07:00
recovery.c f2fs: check hot_data for roll-forward recovery 2017-09-27 11:00:12 +02:00
segment.c f2fs: fix to clear GCed flag for atomic written page 2015-10-22 09:37:13 -07:00
segment.h Revert "f2fs: do not skip dentry block writes" 2015-10-12 13:38:02 -07:00
shrinker.c f2fs: shrink free_nids entries 2015-08-20 09:00:06 -07:00
super.c f2fs: sanity check checkpoint segno and blkoff 2017-08-11 09:08:51 -07:00
trace.c f2fs: add sbi and page pointer in f2fs_io_info 2015-05-28 15:41:32 -07:00
trace.h f2fs: add sbi and page pointer in f2fs_io_info 2015-05-28 15:41:32 -07:00
xattr.c f2fs: xattr simplifications 2015-11-13 20:34:34 -05:00
xattr.h f2fs crypto: add encryption xattr support 2015-05-28 15:41:47 -07:00