android_kernel_xiaomi_sm8350/fs
Eric Biggers 421f9ccc75 quota: explicitly forbid quota files from being encrypted
commit d3cc1b0be258191d6360c82ea158c2972f8d3991 upstream.

Since commit d7e7b9af104c ("fscrypt: stop using keyrings subsystem for
fscrypt_master_key"), xfstest generic/270 causes a WARNING when run on
f2fs with test_dummy_encryption in the mount options:

$ kvm-xfstests -c f2fs/encrypt generic/270
[...]
WARNING: CPU: 1 PID: 2453 at fs/crypto/keyring.c:240 fscrypt_destroy_keyring+0x1f5/0x260

The cause of the WARNING is that not all encrypted inodes have been
evicted before fscrypt_destroy_keyring() is called, which violates an
assumption.  This happens because the test uses an external quota file,
which gets automatically encrypted due to test_dummy_encryption.

Encryption of quota files has never really been supported.  On ext4,
ext4_quota_read() does not decrypt the data, so encrypted quota files
are always considered invalid on ext4.  On f2fs, f2fs_quota_read() uses
the pagecache, so trying to use an encrypted quota file gets farther,
resulting in the issue described above being possible.  But this was
never intended to be possible, and there is no use case for it.

Therefore, make the quota support layer explicitly reject using
IS_ENCRYPTED inodes when quotaon is attempted.

Cc: stable@vger.kernel.org
Signed-off-by: Eric Biggers <ebiggers@google.com>
Signed-off-by: Jan Kara <jack@suse.cz>
Message-Id: <20230905003227.326998-1-ebiggers@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2023-11-28 16:50:19 +00:00
..
9p
adfs
affs affs: initialize fsdata in affs_truncate() 2023-02-06 07:52:36 +01:00
afs afs: Fix vlserver probe RTT handling 2023-06-21 15:44:12 +02:00
autofs autofs: fix memory leak of waitqueues in autofs_catatonic_mode 2023-09-23 11:00:02 +02:00
befs
bfs
btrfs btrfs: don't arbitrarily slow down delalloc if we're committing 2023-11-28 16:50:19 +00:00
cachefiles
ceph ceph: fix incorrect revoked caps assert in ceph_fill_file_size() 2023-10-25 11:53:19 +02:00
cifs cifs: spnego: add ';' in HOST_KEY_LEN 2023-11-28 16:50:17 +00:00
coda coda: Avoid partial allocation of sig_inputArgs 2023-03-11 16:43:56 +01:00
configfs
cramfs
crypto
debugfs new helper: lookup_positive_unlocked() 2023-09-23 10:59:40 +02:00
devpts
dlm dlm: fix plock lookup when using multiple lockspaces 2023-09-23 10:59:55 +02:00
ecryptfs
efivarfs
efs
erofs erofs: ensure that the post-EOF tails are all zeroed 2023-09-23 10:59:36 +02:00
exportfs
ext2 ext2: fix datatype of block number in ext2_xattr_set2() 2023-09-23 11:00:04 +02:00
ext4 ext4: move 'ix' sanity check to corrent position 2023-11-20 10:30:12 +01:00
f2fs f2fs: fix to initialize map.m_pblk in f2fs_precache_extents() 2023-11-20 10:30:14 +01:00
fat treewide: Remove uninitialized_var() usage 2023-06-09 10:29:01 +02:00
freevxfs
fscache
fuse fuse: nlookup missing decrement in fuse_direntplus_link 2023-09-23 11:00:00 +02:00
gfs2 gfs2: ignore negated quota changes 2023-11-28 16:50:15 +00:00
hfs hfs: fix missing hfs_bnode_get() in __hfs_bnode_create 2023-03-11 16:43:59 +01:00
hfsplus treewide: Remove uninitialized_var() usage 2023-06-09 10:29:01 +02:00
hostfs
hpfs
hugetlbfs
iomap
isofs treewide: Remove uninitialized_var() usage 2023-06-09 10:29:01 +02:00
jbd2 jbd2: fix potential data lost in recovering journal raced with synchronizing fs bdev 2023-11-28 16:50:19 +00:00
jffs2 jffs2: reduce stack usage in jffs2_build_xattr_subsystem() 2023-07-27 08:37:25 +02:00
jfs jfs: fix array-index-out-of-bounds in diAlloc 2023-11-28 16:50:15 +00:00
kernfs new helper: lookup_positive_unlocked() 2023-09-23 10:59:40 +02:00
lockd fs: lockd: avoid possible wrong NULL parameter 2023-09-23 10:59:48 +02:00
minix
nfs NFSv4.1: fix SP4_MACH_CRED protection for pnfs IO 2023-11-28 16:50:16 +00:00
nfs_common
nfsd nfsd: lock_rename() needs both directories to live on the same fs 2023-11-08 11:23:38 +01:00
nilfs2 nilfs2: fix potential use after free in nilfs_gccache_submit_read_data() 2023-10-10 21:46:41 +02:00
nls fs/nls: make load_nls() take a const parameter 2023-09-23 10:59:38 +02:00
notify fanotify: disallow mount/sb marks on kernel internal pseudo fs 2023-07-27 08:37:26 +02:00
ntfs
ocfs2 fs: ocfs2: namei: check return value of ocfs2_add_entry() 2023-09-23 10:59:42 +02:00
omfs treewide: Remove uninitialized_var() usage 2023-06-09 10:29:01 +02:00
openpromfs
orangefs
overlayfs overlayfs: set ctime when setting mtime and atime 2023-10-25 11:53:23 +02:00
proc procfs: block chmod on /proc/thread-self/comm 2023-09-23 10:59:55 +02:00
pstore pstore/ram: Check start of empty przs during init 2023-09-23 10:59:55 +02:00
qnx4
qnx6
quota quota: explicitly forbid quota files from being encrypted 2023-11-28 16:50:19 +00:00
ramfs
reiserfs reiserfs: Check the return value from __getblk() 2023-09-23 10:59:40 +02:00
romfs
squashfs revert "squashfs: harden sanity check in squashfs_read_xattr_id_table" 2023-02-22 12:50:39 +01:00
sysfs
sysv fs/sysv: Null check to prevent null-ptr-deref bug 2023-08-11 11:53:59 +02:00
tracefs tracefs: Add missing lockdown check to tracefs_create_dir() 2023-09-23 11:00:06 +02:00
ubifs treewide: Remove uninitialized_var() usage 2023-06-09 10:29:01 +02:00
udf udf: initialize newblock to 0 2023-09-23 10:59:56 +02:00
ufs
unicode
verity fsverity: skip PKCS#7 parser when keyring is empty 2023-09-23 10:59:55 +02:00
xfs xfs: verify buffer contents when we skip log replay 2023-06-28 10:18:42 +02:00
aio.c aio: fix mremap after fork null-deref 2023-02-22 12:50:35 +01:00
anon_inodes.c
attr.c attr: block mode changes of symlinks 2023-09-23 11:00:06 +02:00
bad_inode.c
binfmt_aout.c
binfmt_elf_fdpic.c fs: binfmt_elf_efpic: fix personality for ELF-FDPIC 2023-10-10 21:46:42 +02:00
binfmt_elf.c
binfmt_em86.c
binfmt_flat.c
binfmt_misc.c
binfmt_script.c
block_dev.c
buffer.c
char_dev.c
compat_binfmt_elf.c
compat_ioctl.c
compat.c
coredump.c
d_path.c
dax.c
dcache.c
dcookies.c
direct-io.c
drop_caches.c
eventfd.c eventfd: prevent underflow for eventfd semaphores 2023-09-23 10:59:40 +02:00
eventpoll.c epoll: ep_autoremove_wake_function should use list_del_init_careful 2023-06-28 10:18:35 +02:00
exec.c
fcntl.c
fhandle.c
file_table.c
file.c fs: prevent out-of-bounds array speculation when closing a file descriptor 2023-03-17 08:32:47 +01:00
filesystems.c
fs_context.c fs: avoid empty option when generating legacy mount string 2023-07-27 08:37:25 +02:00
fs_parser.c
fs_pin.c
fs_struct.c
fs_types.c
fs-writeback.c writeback: fix call of incorrect macro 2023-05-17 11:35:58 +02:00
fsopen.c
inode.c fs: Establish locking order for unrelated directories 2023-07-27 08:37:26 +02:00
internal.h fs: Establish locking order for unrelated directories 2023-07-27 08:37:26 +02:00
io_uring.c io_uring: have io_kill_timeout() honor the request references 2023-06-05 08:17:32 +02:00
ioctl.c
Kconfig
Kconfig.binfmt
libfs.c
locks.c locks: fix KASAN: use-after-free in trace_event_raw_event_filelock_lock 2023-09-23 11:00:02 +02:00
Makefile
mbcache.c mbcache: Avoid nesting of cache->c_list_lock under bit locks 2023-01-18 11:41:59 +01:00
mount.h
mpage.c
namei.c fs: Fix error checking for d_hash_and_lookup() 2023-09-23 10:59:40 +02:00
namespace.c
no-block.c
nsfs.c
open.c
pipe.c
pnode.c
pnode.h
posix_acl.c
proc_namespace.c
read_write.c
readdir.c
select.c
seq_file.c
signalfd.c
splice.c
stack.c
stat.c
statfs.c statfs: enforce statfs[64] structure initialization 2023-05-30 12:44:07 +01:00
super.c fs: Protect reconfiguration of sb read-write from racing writes 2023-08-11 11:53:59 +02:00
sync.c
timerfd.c
userfaultfd.c
utimes.c
xattr.c