Commit Graph

17 Commits

Author SHA1 Message Date
Paul Lawrence
764dba028d ANDROID: Incremental fs: Fix mislabeled __user ptrs
Found by sparse

Bug: 153174547
Test: make C=2 fs/incfs/incrementalfs.ko no errors, incfs_test pass
Signed-off-by: Paul Lawrence <paullawrence@google.com>
Change-Id: I9ff4f4f35975fe09936724488b96cd8bdeeb719e
2020-04-08 13:36:10 +00:00
Paul Lawrence
2fb9b719ce ANDROID: Incremental fs: Fix remount
Bug: 153017385
Test: incfs_test passes
Signed-off-by: Paul Lawrence <paullawrence@google.com>
Change-Id: I13f3a3c91d746d725e0e21b1e2bcfe0a64a13716
2020-04-01 23:32:34 +00:00
Paul Lawrence
ca72c79936 ANDROID: Incremental fs: Protect get_fill_block, and add a field
Since INCFS_IOC_GET_FILLED_BLOCKS potentially leaks information about usage
patterns, and is only useful to someone filling the file, best protect it in
the same way as INCFS_IOC_FILL_BLOCKS.

Add useful field data_block_out as well

Test: incfs_test passes
Bug: 152983639
Signed-off-by: Paul Lawrence <paullawrence@google.com>
Change-Id: I126a8cf711e56592479093e9aadbfd0e7f700752
2020-04-01 23:32:27 +00:00
Paul Lawrence
c062bc8e76 ANDROID: Incremental fs: Fix four resource bugs
Without these, you can't unmount a volume on which incfs was
mounted and the tests run.

Also incfs_tests would fail sporadically without the fix to
test_inode

Test: Run incfs_test and unmount underlying volume 1000 times
Bug: 152636070
Signed-off-by: Paul Lawrence <paullawrence@google.com>
Change-Id: I88f11f5d4269c22d9073e5eb671d0c7cc4629f6c
2020-03-30 06:20:08 +00:00
Paul Lawrence
8d963bb240 ANDROID: Incremental fs: Add INCFS_IOC_GET_FILLED_BLOCKS
Test: incfs_test passes
Bug: 151240628
Signed-off-by: Paul Lawrence <paullawrence@google.com>
Change-Id: I66d0ba1911adc5d68ed404585222e6a81a7eb94f
2020-03-26 21:02:02 +00:00
Paul Lawrence
e94931cb2c ANDROID: Incremental fs: Add INCFS_IOC_PERMIT_FILL
Provide a securable way to open a file for filling

Test: incfs_test passes
Bug: 138149732
Signed-off-by: Paul Lawrence <paullawrence@google.com>
Change-Id: Ib4b6fd839ad30ce08e31121d19e2c0d7066d302f
2020-03-18 16:22:25 +00:00
Paul Lawrence
bc6a70e849 ANDROID: Incremental fs: Remove signature checks from kernel
Test: selftests pass
Bug: 133435829
Signed-off-by: Paul Lawrence <paullawrence@google.com>
Change-Id: Ia7e69b1b0176202da4b418ea815b370cbdacd5c2
2020-03-18 16:22:17 +00:00
Paul Lawrence
21b07a7140 ANDROID: Incremental fs: Make fill block an ioctl
Filling blocks is not equivalent to writing a file, since they are
constrained by the root hash. selinux policy may wish to treat them
differently, for instance.

Test: incfs_test passes
Bug: 138149732
Signed-off-by: Paul Lawrence <paullawrence@google.com>
Change-Id: Ic369b84b92547b1cfefe422bd881c4e466090aed
2020-03-18 16:21:50 +00:00
Paul Lawrence
8bd6d52af0 ANDROID: Incremental fs: Remove all access_ok checks
They provide no value and simply duplicate a check in copy_from/to_user

Test: incfs_test passes
Bug: 138149732
Signed-off-by: Paul Lawrence <paullawrence@google.com>
Change-Id: Icc6054a2d6a495c9a03cd1507dda1ab8ca0b0dc4
2020-03-18 16:21:38 +00:00
Paul Lawrence
2dbb045181 ANDROID: Incremental fs: Support xattrs
To make selinux work, add xattr support. This is a bit clunky -
it seems like it would be better for the log and pending read
functionality to be ioctls rather than this mixture of real
and virtual files.

Bug: 133435829
Change-Id: I56579fabe2ae7efb88f0344553948dc9573299aa
Signed-off-by: Paul Lawrence <paullawrence@google.com>
2020-02-19 21:48:00 +00:00
Paul Lawrence
c58df626a9 ANDROID: Incremental fs: Fix crash on failed lookup
Don't call dput on error code

Change-Id: Ie63645c9ed67fa231829917ae8ca154e049b4921
Signed-off-by: Paul Lawrence <paullawrence@google.com>
Bug: 133435829
(cherry picked from commit 334164ca0f18ea89a922b90020f5e3840a928503)
2020-02-06 18:28:35 +00:00
Yurii Zubrytskyi
e8910f2df6 ANDROID: Incremental fs: Make files writeable
- added chmod() to +0222 to make all backing files and dirs
  writable. vold/system_server have a umask that clears those
  flags, making incfs unusable

Signed-off-by: Yurii Zubrytskyi <zyy@google.com>
Signed-off-by: Paul Lawrence <paullawrence@google.com>
Bug: 133435829
Change-Id: Id9258401570cc2cc7cd5735aace89d379a9b043d
(cherry picked from commit bc5e5bc1d007e99228ca0717daa12639627819ba)
2020-02-06 18:11:16 +00:00
Paul Lawrence
eab9b254c0 ANDROID: Incremental fs: Remove C++-style comments
Change-Id: I89e1dc6020e596fb36694f8646f78b98f7ad4a7f
Bug: 133435829
Signed-off-by: Paul Lawrence <paullawrence@google.com>
2020-02-05 23:17:25 +00:00
Paul Lawrence
d0adf8bc01 ANDROID: Incremental fs: Remove unneeded compatibility typedef
Bug: 133435829
Test: builds, incfs_test passes
Change-Id: I9b2ad81d230009daadf2c30f3609fda16e79028c
Signed-off-by: Paul Lawrence <paullawrence@google.com>
2020-02-04 04:51:52 +00:00
Paul Lawrence
8c43b745a4 ANDROID: Incremental fs: Fix sparse errors
Fix all sparse errors in fs/incfs except
fs/incfs/integrity.c:192:9: warning: Variable length array is used

Test: incfs_test passes
Bug: 133435829
Change-Id: I9c2e26e4e1a06a894977f11a3c8559b968dd115e
Signed-off-by: Paul Lawrence <paullawrence@google.com>
2020-02-04 04:51:35 +00:00
Paul Lawrence
6855de4adb ANDROID: Fixing incremental fs style issues
Removed WARN_ONs
Removed compatibilty code
Fixed tab issue

Bug: 133435829
Signed-off-by: Paul Lawrence <paullawrence@google.com>
Change-Id: I8a9e9ead48a65fd09c2d01d22f65d9a352f118e2
2020-02-04 04:51:28 +00:00
Eugene Zemtsov
c6819dd778 ANDROID: Initial commit of Incremental FS
Fully working incremental fs filesystem

Signed-off-by: Eugene Zemtsov <ezemtsov@google.com>
Signed-off-by: Paul Lawrence <paullawrence@google.com>

Bug: 133435829
Change-Id: I14741a61ce7891a0f9054e70f026917712cbef78
2020-02-04 04:51:09 +00:00