android_kernel_samsung_sm8650/fs/incfs
Lee Jones 9b655e9328 ANDROID: Incremental fs: Allocate data buffer based on input request size
Presently the data buffer used to return the per-UID timeout description
is created based on information provided by the user.  It is expected
that the user populates a variable called 'timeouts_array_size' which is
heavily scrutinised to ensure the value provided is appropriate i.e.
smaller than the largest possible value but large enough to contain all
of the data we wish to pass back.

The issue is that the aforementioned scrutiny is imposed on a different
variable to the one expected.  Contrary to expectation, the data buffer
is actually being allocated to the size specified in a variable named
'timeouts_array_size_out'.  A variable originally designed to only
contain the output information i.e. the size of the data actually copied
to the user for consumption.  This value is also user provided and is
not given the same level of scrutiny as the former.

The fix in this case is simple.  Ignore 'timeouts_array_size_out' until
it is time to populate (over-write) it ourselves and use
'timeouts_array_size' to shape the buffer as intended.

Bug: 281547360
Change-Id: I95e12879a33a2355f9e4bc0ce2bfc3f229141aa8
Signed-off-by: Lee Jones <joneslee@google.com>
(cherry picked from commit 5a4d20a3eb4e651f88ed2f1f08cee066639ca801)
2023-07-18 17:21:16 +00:00
..
data_mgmt.c ANDROID: incremental fs: Move throttling to outside page lock 2023-02-22 19:22:01 +00:00
data_mgmt.h ANDROID: incremental fs: Move throttling to outside page lock 2023-02-22 19:22:01 +00:00
format.c ANDROID: Incremental fs: fix minor printk format warning 2021-04-15 15:18:35 +00:00
format.h ANDROID: Incremental fs: Build merkle tree when enabling verity 2021-02-10 14:46:45 -08:00
integrity.c ANDROID: Incremental fs: sha.h has been split into two, handle this. 2020-12-15 15:37:52 +00:00
integrity.h ANDROID: Incremental fs: Remove signature checks from kernel 2020-03-18 16:22:17 +00:00
internal.h ANDROID: Incremental fs: Add FS_IOC_ENABLE_VERITY 2021-02-10 14:19:46 -08:00
Kconfig ANDROID: Incremental fs: Add zstd compression support 2020-11-05 23:00:32 +00:00
main.c ANDROID: Incremental fs: Add status to sysfs 2021-04-21 14:35:45 +00:00
Makefile ANDROID: Incremental fs: Add status to sysfs 2021-04-21 14:35:45 +00:00
pseudo_files.c ANDROID: Incremental fs: Allocate data buffer based on input request size 2023-07-18 17:21:16 +00:00
pseudo_files.h ANDROID: Incremental fs: fix .blocks_written 2021-01-06 16:57:22 +00:00
sysfs.c ANDROID: incremental fs: Evict inodes before freeing mount data 2023-04-04 22:27:50 +00:00
sysfs.h ANDROID: Incremental fs: Make sysfs_name changeable on remount 2021-05-18 19:36:32 +00:00
verity.c ANDROID: incremental fs: Move throttling to outside page lock 2023-02-22 19:22:01 +00:00
verity.h ANDROID: Incremental fs: Add FS_IOC_READ_VERITY_METADATA 2021-04-13 15:22:56 +00:00
vfs.c ANDROID: incremental fs: Evict inodes before freeing mount data 2023-04-04 22:27:50 +00:00
vfs.h Revert "ANDROID: incremental-fs: fix mount_fs issue" 2022-03-17 15:40:23 -07:00