diff options
author | Yi-Yo Chiang <yochiang@google.com> | 2021-03-22 13:45:39 +0800 |
---|---|---|
committer | Yi-Yo Chiang <yochiang@google.com> | 2021-03-22 13:51:48 +0800 |
commit | f72d88aedf164ef39e4af38a48d28dcfd5e51632 (patch) | |
tree | 4481d6e1dbf9c0ba29f83a1829a3d20d4aac1df4 /include | |
parent | 56c2eaad923aa5dd9be2dec033ecfd445e3d51af (diff) | |
download | gsid-f72d88aedf164ef39e4af38a48d28dcfd5e51632.tar.gz |
Make DSU metadata files globally readable
libfstab (fs_mgr_fstab.cpp) could be statically linked into
unpriviledged processes, and calling
fs_mgr_fstab.cpp:ReadFstabFromFile() from an unpriviledged process while
inside of a DSU system would return an incorrect Fstab, because
ReadFstabFromFile() needs to read the DSU metadata files to return the
correct result.
To remedy this, we make DSU metadata files that are required by libfstab
to be globally readable (0644).
We also split the sepolicy label gsi_metadata_filea into two part,
gsi_metadata_file and gsi_public_metadata_file, and make
gsi_public_metadata_file:file readable by other domain (not banned by
neverallow).
Bug: 181110285
Test: Write a small utility program to validate the result of
ReadFstabFromFile() in DSU.
Change-Id: Ia7c8c584b23752195198cc43698c71a31cabc00e
Diffstat (limited to 'include')
-rw-r--r-- | include/libgsi/libgsi.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/include/libgsi/libgsi.h b/include/libgsi/libgsi.h index 17066ff..41898df 100644 --- a/include/libgsi/libgsi.h +++ b/include/libgsi/libgsi.h @@ -28,6 +28,14 @@ static constexpr char kGsiServiceName[] = "gsiservice"; #define DSU_METADATA_PREFIX "/metadata/gsi/dsu/" +// These files need to be globally readable so that fs_mgr_fstab, which is +// statically linked into processes, can return consistent result for non-root +// processes: +// * kDsuActiveFile +// * kGsiBootedIndicatorFile +// * kGsiLpNamesFile +// * DsuMetadataKeyDirFile(slot) + static constexpr char kGsiBootedIndicatorFile[] = DSU_METADATA_PREFIX "booted"; static constexpr char kGsiLpNamesFile[] = DSU_METADATA_PREFIX "lp_names"; |