platform_system_vold/model
Zim c9a2be4e3f Allow external_storage or media_rw gid access /mnt/media_rw
PublicVolumes are mounted on /mnt/media_rw/<volume>. Two categories of
apps need access to the mounts. Fortunately, they need access in
mutually exclusive scenarios.

1. The FUSE daemon needs access when serving content from app requests on
/storage/<volume>.

2. File managers (MANAGE_EXTERNAL_STORAGE permission) need access to
ureliable (USB OTG) volumes that are only available on the
/mnt/media_rw paths, i.e, they are not bind mounted into /storage
for apps.

Additionally, we want to ensure that file managers cannot access
/mnt/media_rw when there's a stacked FUSE volume on it. To do this,
we selectively change the mount gid of the /mnt/media_rw/<volume>
path:
-media_rw if it's a reliable volume, ie there's a stacked FUSE volume
-external_storage if it's an unreliable volume.

This ensures that file managers with their external_storage gid can
access unreliable volumes from /mnt/media_rw and cannot interfere with
the FUSE daemon when it's a reliable volume.

Test: adb shell sm set-force-adoptable [on|off] to set reliable or
unreliable volumes && mounting public volumes shows the correct
ACL on /mnt/media_rw/<volume>
Bug: 144914977

Change-Id: Iecf1a422d39e5137105b5a4946704858ce902a8a
2020-01-24 22:21:55 +00:00
..
Disk.cpp vold: const-ify some of the API 2018-12-20 10:38:15 -08:00
Disk.h vold: const-ify some of the API 2018-12-20 10:38:15 -08:00
EmulatedVolume.cpp Handle failures after partial mounts 2020-01-15 16:10:54 +00:00
EmulatedVolume.h Conditionally use sdcardfs. 2020-01-07 09:03:35 +01:00
ObbVolume.cpp Add GetBlockDevSize, GetBlockDevSectors helpers 2018-09-24 14:25:24 +02:00
ObbVolume.h clang-format many files. 2018-09-18 15:41:22 -07:00
PrivateVolume.cpp Fix multi-user and multi-storage with FUSE 2019-11-11 20:24:49 +00:00
PrivateVolume.h Fix multi-user and multi-storage with FUSE 2019-11-11 20:24:49 +00:00
PublicVolume.cpp Allow external_storage or media_rw gid access /mnt/media_rw 2020-01-24 22:21:55 +00:00
PublicVolume.h Conditionally use sdcardfs. 2020-01-07 09:03:35 +01:00
StubVolume.cpp StubVolume as first class Volume in Vold 2018-11-08 07:40:43 +00:00
StubVolume.h StubVolume as first class Volume in Vold 2018-11-08 07:40:43 +00:00
VolumeBase.cpp Add mount callback 2019-11-22 17:06:04 +01:00
VolumeBase.h Add mount callback 2019-11-22 17:06:04 +01:00