OpenCloudOS-Kernel/fs/f2fs
Chao Yu 958ed92922 f2fs: fix fallocate to use file_modified to update permissions consistently
This patch tries to fix permission consistency issue as all other
mainline filesystems.

Since the initial introduction of (posix) fallocate back at the turn of
the century, it has been possible to use this syscall to change the
user-visible contents of files.  This can happen by extending the file
size during a preallocation, or through any of the newer modes (punch,
zero, collapse, insert range).  Because the call can be used to change
file contents, we should treat it like we do any other modification to a
file -- update the mtime, and drop set[ug]id privileges/capabilities.

The VFS function file_modified() does all this for us if pass it a
locked inode, so let's make fallocate drop permissions correctly.

Cc: stable@kernel.org
Signed-off-by: Chao Yu <chao.yu@oppo.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
2022-05-18 15:36:09 -07:00
..
Kconfig f2fs: introduce F2FS_UNFAIR_RWSEM to support unfair rwsem 2022-03-04 09:15:53 -08:00
Makefile f2fs: separate out iostat feature 2021-08-23 10:25:51 -07:00
acl.c f2fs: support idmapped mounts 2022-02-12 06:20:46 -08:00
acl.h vfs: add rcu argument to ->get_acl() callback 2021-08-18 22:08:24 +02:00
checkpoint.c f2fs: kill volatile write support 2022-05-12 10:14:03 -07:00
compress.c Filesystem folio changes for 5.18 2022-03-22 18:26:56 -07:00
data.c f2fs: kill volatile write support 2022-05-12 10:14:03 -07:00
debug.c f2fs: kill volatile write support 2022-05-12 10:14:03 -07:00
dir.c f2fs: don't use casefolded comparison for "." and ".." 2022-05-17 11:19:23 -07:00
extent_cache.c f2fs: support fault injection for f2fs_kmem_cache_alloc() 2021-08-17 11:59:05 -07:00
f2fs.h f2fs: don't use casefolded comparison for "." and ".." 2022-05-17 11:19:23 -07:00
file.c f2fs: fix fallocate to use file_modified to update permissions consistently 2022-05-18 15:36:09 -07:00
gc.c f2fs: do not stop GC when requiring a free section 2022-05-17 11:19:19 -07:00
gc.h f2fs: introduce gc_merge mount option 2021-03-30 18:48:56 -07:00
hash.c f2fs: don't use casefolded comparison for "." and ".." 2022-05-17 11:19:23 -07:00
inline.c f2fs: move f2fs to use reader-unfair rwsems 2022-01-24 17:40:04 -08:00
inode.c f2fs: change the current atomic write way 2022-05-12 10:14:03 -07:00
iostat.c f2fs: use iomap for direct I/O 2021-12-10 15:48:30 -08:00
iostat.h f2fs: introduce periodic iostat io latency traces 2021-08-23 10:25:51 -07:00
namei.c f2fs: change the current atomic write way 2022-05-12 10:14:03 -07:00
node.c f2fs: change the current atomic write way 2022-05-12 10:14:03 -07:00
node.h f2fs: change the current atomic write way 2022-05-12 10:14:03 -07:00
recovery.c f2fs-for-5.18 2022-03-22 10:00:31 -07:00
segment.c f2fs: do not stop GC when requiring a free section 2022-05-17 11:19:19 -07:00
segment.h f2fs: change the current atomic write way 2022-05-12 10:14:03 -07:00
shrinker.c f2fs: avoid race condition for shrinker count 2020-12-03 00:59:26 -08:00
super.c f2fs: do not stop GC when requiring a free section 2022-05-17 11:19:19 -07:00
sysfs.c f2fs-for-5.18 2022-03-22 10:00:31 -07:00
verity.c f2fs: kill volatile write support 2022-05-12 10:14:03 -07:00
xattr.c f2fs: move f2fs to use reader-unfair rwsems 2022-01-24 17:40:04 -08:00
xattr.h f2fs: code cleanup by removing ifdef macro surrounding 2020-05-26 18:56:10 -07:00