Commit graph

5753 commits

Author SHA1 Message Date
Daeho Jeong
baee102002 Merge "vold: fix the range of stopped state of idleMaint" into tm-dev 2022-05-20 21:15:13 +00:00
Zimuzo Ezeozue
a45a8426ae Merge "Abort FUSE as part of volume reset" am: 3712b8de01 am: 73383ddb7f am: 2b5038faa5 am: 341016f6ac
Original change: https://android-review.googlesource.com/c/platform/system/vold/+/2101651

Change-Id: I7ca6786c209dd01c37aa65e21dd7582a4df66eac
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-05-20 13:37:46 +00:00
Corina Grigoras
7b9e9b9e25 [automerger skipped] Merge "Abort FUSE as part of volume reset" into tm-dev am: 05098fee39 am: 97c642cc99 -s ours am: 31337d3da3 -s ours
am skip reason: Merged-In I9e559a48b9a72e6ecbc3a277a09ea5d34c9ec499 with SHA-1 11a666b092 is already in history

Original change: https://googleplex-android-review.googlesource.com/c/platform/system/vold/+/18492349

Change-Id: Ie7b700f59cb55fd5fc0f931a94f6afb9065af72a
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-05-20 13:37:13 +00:00
Corina Grigoras
16fa729a1d [automerger skipped] Merge "Abort FUSE as part of volume reset" into tm-dev am: 05098fee39 am: 31667410da am: def08b57d6 -s ours
am skip reason: Merged-In I9e559a48b9a72e6ecbc3a277a09ea5d34c9ec499 with SHA-1 11a666b092 is already in history

Original change: https://googleplex-android-review.googlesource.com/c/platform/system/vold/+/18492349

Change-Id: I32425235ed3ed50b4b1d7ff65a5bfe597e5d53b4
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-05-20 13:34:05 +00:00
Corina Grigoras
7d5fabdbae Merge "Abort FUSE as part of volume reset" into tm-dev am: 05098fee39 am: 31667410da am: 6d5d430593
Original change: https://googleplex-android-review.googlesource.com/c/platform/system/vold/+/18492349

Change-Id: I65dc81b9c120938e571f9a98998dc64c623f23dc
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-05-20 13:33:06 +00:00
Corina Grigoras
6d5d430593 Merge "Abort FUSE as part of volume reset" into tm-dev am: 05098fee39 am: 31667410da
Original change: https://googleplex-android-review.googlesource.com/c/platform/system/vold/+/18492349

Change-Id: Iff61fa271395b36e4fc8aaa55162429ea98f29e1
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-05-20 13:17:13 +00:00
Zimuzo Ezeozue
341016f6ac Merge "Abort FUSE as part of volume reset" am: 3712b8de01 am: 73383ddb7f am: 2b5038faa5
Original change: https://android-review.googlesource.com/c/platform/system/vold/+/2101651

Change-Id: I4220a1a657c3830165927dc55d47911566e04c1a
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-05-20 13:16:49 +00:00
Corina Grigoras
31337d3da3 [automerger skipped] Merge "Abort FUSE as part of volume reset" into tm-dev am: 05098fee39 am: 97c642cc99 -s ours
am skip reason: Merged-In I9e559a48b9a72e6ecbc3a277a09ea5d34c9ec499 with SHA-1 11a666b092 is already in history

Original change: https://googleplex-android-review.googlesource.com/c/platform/system/vold/+/18492349

Change-Id: I92d7a4bc2640f9f2f10ec4e3479d5e35d7ef5bd4
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-05-20 13:16:18 +00:00
Zimuzo Ezeozue
2b5038faa5 Merge "Abort FUSE as part of volume reset" am: 3712b8de01 am: 73383ddb7f
Original change: https://android-review.googlesource.com/c/platform/system/vold/+/2101651

Change-Id: I96d9d16e7989a547b3c0bfa97317f3e6e136bfab
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-05-20 13:15:55 +00:00
Corina Grigoras
def08b57d6 Merge "Abort FUSE as part of volume reset" into tm-dev am: 05098fee39 am: 31667410da
Original change: https://googleplex-android-review.googlesource.com/c/platform/system/vold/+/18492349

Change-Id: I8ab722e85f8e198caebe8f7b22ffe6986a93237d
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-05-20 13:15:43 +00:00
Corina Grigoras
31667410da Merge "Abort FUSE as part of volume reset" into tm-dev am: 05098fee39
Original change: https://googleplex-android-review.googlesource.com/c/platform/system/vold/+/18492349

Change-Id: Iea2d826dc84d499473d36c9634514e532c2a9d47
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-05-20 12:45:48 +00:00
Zimuzo Ezeozue
73383ddb7f Merge "Abort FUSE as part of volume reset" am: 3712b8de01
Original change: https://android-review.googlesource.com/c/platform/system/vold/+/2101651

Change-Id: I7e4e62ee8b89168c03ab86071a8e7e109958906b
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-05-20 12:45:14 +00:00
Corina Grigoras
97c642cc99 Merge "Abort FUSE as part of volume reset" into tm-dev am: 05098fee39
Original change: https://googleplex-android-review.googlesource.com/c/platform/system/vold/+/18492349

Change-Id: Ie48a761a1b173f66e3cddbae6f965148c7a18645
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-05-20 12:43:50 +00:00
Corina Grigoras
05098fee39 Merge "Abort FUSE as part of volume reset" into tm-dev 2022-05-20 09:59:53 +00:00
Zimuzo Ezeozue
3712b8de01 Merge "Abort FUSE as part of volume reset" 2022-05-20 09:34:24 +00:00
Zim
817f224fb4 Abort FUSE as part of volume reset
This fixes a bug in Android T where MediaProvider leaked FUSE fds in
it's process preveventing it from dying after being killed. This
resulted in the MP in a zombie state.

Even though, this bug was more prevalent in Android T due to a change
in the Parcel lifecycle (see b/233216232), this bug could have always
occurred in theory.

This fix should be harmless since after volume reset, all FUSE volumes
should be unmounted and aborting the FUSE connections will either
no-op or actually prevent the FUSE daemon from getting wedged in a
zombie state.

Test: Manually trigger a FUSE fd leak in the MediaProvider, kill it
and verify that it is restarted without zombie.
Bug: 233216232
Bug: 231792374
Bug: 230445008
Change-Id: I9e559a48b9a72e6ecbc3a277a09ea5d34c9ec499
2022-05-20 09:33:12 +00:00
Eric Biggers
a405db560e Remove obsolete support for emulated FBE
Emulated FBE was a developer-mode feature intended to allow developers
to add Direct Boot support to apps before native FBE devices became
widely available.  Since all devices running the latest version of
Android now use native FBE (except for a couple edge cases not relevant
here, like in-development devices on which encryption hasn't been
enabled yet), and emulated FBE doesn't work on native FBE devices
anyway, there's no longer any need to carry the code for emulated FBE.

Bug: 232458753
Change-Id: Ia6824699b578aca3af340fe578e26d5a5dc82b16
2022-05-20 04:41:42 +00:00
Zim
11a666b092 Abort FUSE as part of volume reset
This fixes a bug in Android T where MediaProvider leaked FUSE fds in
it's process preveventing it from dying after being killed. This
resulted in the MP in a zombie state.

Even though, this bug was more prevalent in Android T due to a change
in the Parcel lifecycle (see b/233216232), this bug could have always
occurred in theory.

This fix should be harmless since after volume reset, all FUSE volumes
should be unmounted and aborting the FUSE connections will either
no-op or actually prevent the FUSE daemon from getting wedged in a
zombie state.

Test: Manually trigger a FUSE fd leak in the MediaProvider, kill it
and verify that it is restarted without zombie.
Bug: 233216232
Bug: 231792374

Change-Id: I9e559a48b9a72e6ecbc3a277a09ea5d34c9ec499
Merged-In: I9e559a48b9a72e6ecbc3a277a09ea5d34c9ec499
2022-05-19 17:17:10 +01:00
Daeho Jeong
f4d14515d5 Merge "vold: fix the range of stopped state of idleMaint" am: 289bcb5305 am: d7237292e3 am: 684554549d am: b56efd29a7
Original change: https://android-review.googlesource.com/c/platform/system/vold/+/2100921

Change-Id: I7d1e0197bcc63c043e550fe187775b8f03ed664e
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-05-19 07:54:58 +00:00
Daeho Jeong
b56efd29a7 Merge "vold: fix the range of stopped state of idleMaint" am: 289bcb5305 am: d7237292e3 am: 684554549d
Original change: https://android-review.googlesource.com/c/platform/system/vold/+/2100921

Change-Id: If02e0b9392a5124653911e42e71eee2e5537818c
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-05-19 02:21:01 +00:00
Daeho Jeong
684554549d Merge "vold: fix the range of stopped state of idleMaint" am: 289bcb5305 am: d7237292e3
Original change: https://android-review.googlesource.com/c/platform/system/vold/+/2100921

Change-Id: I1e70ad65c055db304ccbd9f64c739e3c8830175f
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-05-19 01:35:59 +00:00
Daeho Jeong
d7237292e3 Merge "vold: fix the range of stopped state of idleMaint" am: 289bcb5305
Original change: https://android-review.googlesource.com/c/platform/system/vold/+/2100921

Change-Id: I3fc7979d0d5bd5da8fe49ffd1da3589a7df2db5d
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-05-19 00:53:22 +00:00
Daeho Jeong
7667d64ab8 vold: fix the range of stopped state of idleMaint
When it is stuck in runDevGC() for an unexpected reason, now it cannot
prevent the other callers from entering into it again. Fix it.

Bug: 232297944
Test: run "sm idle-maint run" twice & check whether they are overlapped
Signed-off-by: Daeho Jeong <daehojeong@google.com>
Change-Id: I785c8aeebd8fcf58c34d9be9968d99634d0b420a
Merged-In: I785c8aeebd8fcf58c34d9be9968d99634d0b420a
2022-05-18 16:29:46 -07:00
Daeho Jeong
289bcb5305 Merge "vold: fix the range of stopped state of idleMaint" 2022-05-18 23:27:40 +00:00
Daeho Jeong
372b3510b5 vold: fix the range of stopped state of idleMaint
When it is stuck in runDevGC() for an unexpected reason, now it cannot
prevent the other callers from entering into it again. Fix it.

Bug: 232297944
Test: run "sm idle-maint run" twice & check whether they are overlapped
Signed-off-by: Daeho Jeong <daehojeong@google.com>
Change-Id: I785c8aeebd8fcf58c34d9be9968d99634d0b420a
2022-05-18 09:03:15 -07:00
Eric Biggers
df8b0e7608 Merge "Add and use prepare_dir_with_policy() helper function" am: 14ac67efab am: b0aec67fab am: 814dbfb77c am: 8faad6f2dc
Original change: https://android-review.googlesource.com/c/platform/system/vold/+/2097184

Change-Id: Iff722e5cb0e15f93d113e005cb007e647003a638
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-05-13 10:20:36 +00:00
Eric Biggers
8faad6f2dc Merge "Add and use prepare_dir_with_policy() helper function" am: 14ac67efab am: b0aec67fab am: 814dbfb77c
Original change: https://android-review.googlesource.com/c/platform/system/vold/+/2097184

Change-Id: I7c6c00e0ab05614792c85298dd9e11910c6c388b
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-05-13 09:39:29 +00:00
Eric Biggers
814dbfb77c Merge "Add and use prepare_dir_with_policy() helper function" am: 14ac67efab am: b0aec67fab
Original change: https://android-review.googlesource.com/c/platform/system/vold/+/2097184

Change-Id: I090927709e10f6eb6ade3192ab76ce73e29ec10e
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-05-13 08:50:08 +00:00
Eric Biggers
b0aec67fab Merge "Add and use prepare_dir_with_policy() helper function" am: 14ac67efab
Original change: https://android-review.googlesource.com/c/platform/system/vold/+/2097184

Change-Id: I2d4d4a5832d66ded83e7f2effe14d34728d0db5d
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-05-13 03:53:23 +00:00
Eric Biggers
14ac67efab Merge "Add and use prepare_dir_with_policy() helper function" 2022-05-13 03:04:50 +00:00
Eric Biggers
91180c5aeb Merge changes from topic "deny-create-user-dirs" am: 9fb8825578 am: 65f0713d14 am: cf8713daf4 am: 896625bc6d
Original change: https://android-review.googlesource.com/c/platform/system/vold/+/2095484

Change-Id: Ia624dd81e1bac39a11347617b3be6726387ba5c8
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-05-12 20:33:33 +00:00
Eric Biggers
a7815b6ce4 Don't return /data/data from BuildDataUserCePath() am: aafc1bfb73 am: 50cfdadab0 am: e515951101 am: af5e9ca469
Original change: https://android-review.googlesource.com/c/platform/system/vold/+/2095483

Change-Id: I6796d564a245da1008532df086c6dbcf41b7bab3
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-05-12 20:33:32 +00:00
Eric Biggers
ca9a97ed6c Add and use prepare_dir_with_policy() helper function
Having prepare_dir() and EnsurePolicy() be separate operations is
error-prone; it lengthens the window of time that files could
accidentally be created in new directories before they are encrypted,
and it makes it easier to accidentally never encrypt a directory.

To partially address this, add a function prepare_dir_with_policy() that
combines the two steps, and use it everywhere possible.  This function
is now the only place in vold that calls EnsurePolicy().

As a follow-up change, we could go a bit further and make this helper
function create the directory under a temporary name and move it into
place already-encrypted.  This change just focuses on getting the helper
function in place, without changing the behavior too much.

Change-Id: I98ab345df235120db6727f7dbe0da6a8b6ef2579
2022-05-12 20:21:33 +00:00
Eric Biggers
896625bc6d Merge changes from topic "deny-create-user-dirs" am: 9fb8825578 am: 65f0713d14 am: cf8713daf4
Original change: https://android-review.googlesource.com/c/platform/system/vold/+/2095484

Change-Id: I9395c42e8d2ebc5acf48b56dc3b489b23fbb6646
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-05-12 20:16:36 +00:00
Eric Biggers
af5e9ca469 Don't return /data/data from BuildDataUserCePath() am: aafc1bfb73 am: 50cfdadab0 am: e515951101
Original change: https://android-review.googlesource.com/c/platform/system/vold/+/2095483

Change-Id: Ia19d6556ce520e0a8364001de8bb4314f339241e
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-05-12 20:16:34 +00:00
Eric Biggers
cf8713daf4 Merge changes from topic "deny-create-user-dirs" am: 9fb8825578 am: 65f0713d14
Original change: https://android-review.googlesource.com/c/platform/system/vold/+/2095484

Change-Id: Id9e1c58d6a5bcf2609229c387db91eec76afeefc
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-05-12 19:57:49 +00:00
Eric Biggers
e515951101 Don't return /data/data from BuildDataUserCePath() am: aafc1bfb73 am: 50cfdadab0
Original change: https://android-review.googlesource.com/c/platform/system/vold/+/2095483

Change-Id: I49b25ca9d4666edeee056588b24f4528a495af32
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-05-12 19:57:48 +00:00
Eric Biggers
65f0713d14 Merge changes from topic "deny-create-user-dirs" am: 9fb8825578
Original change: https://android-review.googlesource.com/c/platform/system/vold/+/2095484

Change-Id: I89516d7b997e2b48e1767e895c797eec349ffa17
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-05-12 19:38:52 +00:00
Eric Biggers
50cfdadab0 Don't return /data/data from BuildDataUserCePath() am: aafc1bfb73
Original change: https://android-review.googlesource.com/c/platform/system/vold/+/2095483

Change-Id: Ib1953e89a41e68f845e33878b0cb7728b06a9e8e
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-05-12 19:38:51 +00:00
Eric Biggers
9fb8825578 Merge changes from topic "deny-create-user-dirs"
* changes:
  Prepare /data/user/0 and /data/media/obb during initUser0
  Don't return /data/data from BuildDataUserCePath()
2022-05-12 18:41:21 +00:00
Eric Biggers
5fb7959397 [automerger skipped] Enforce that internal storage is prepared first am: c193c3fbb8 -s ours am: 6e62eb2100 -s ours am: 3ff1aa1b0d -s ours
am skip reason: Merged-In Ib26cc1bd46ffa2578f6f0156dfacc5496dae3178 with SHA-1 c66c2e306d is already in history

Original change: https://googleplex-android-review.googlesource.com/c/platform/system/vold/+/18163020

Change-Id: Id34986c0b00dd041c05ebe6a0f8b21de97c5953b
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-05-11 22:19:13 +00:00
Eric Biggers
5b04932ea1 [automerger skipped] Enforce that internal storage is prepared first am: c193c3fbb8 am: 449ac4d8ff -s ours am: cac2ea1a11 -s ours
am skip reason: Merged-In Ib26cc1bd46ffa2578f6f0156dfacc5496dae3178 with SHA-1 c66c2e306d is already in history

Original change: https://googleplex-android-review.googlesource.com/c/platform/system/vold/+/18163020

Change-Id: I6477caef0b435dc1426d58a0a0f420b5132e553d
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-05-11 22:11:47 +00:00
Eric Biggers
9ea5344daf Prepare /data/user/0 and /data/media/obb during initUser0
Prepare these directories during initUser0.  This greatly shortens the
gap between the creation and encryption of /data/user/0, and this makes
it possible to remove init's write access to all directories containing
per-user encrypted directories.

Bug: 156305599
Change-Id: Ibf3d25356e8f0bca70da078c5d2428ae8615240e
2022-05-11 21:56:01 +00:00
Eric Biggers
352411a591 [automerger skipped] Enforce that internal storage is prepared first am: c193c3fbb8 am: 449ac4d8ff am: e358ce1a50 -s ours
am skip reason: Merged-In Ib26cc1bd46ffa2578f6f0156dfacc5496dae3178 with SHA-1 c66c2e306d is already in history

Original change: https://googleplex-android-review.googlesource.com/c/platform/system/vold/+/18163020

Change-Id: I503dcd26faa2de70a865e9e19383bd0f27b6a27c
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-05-11 21:54:29 +00:00
Eric Biggers
3ff1aa1b0d [automerger skipped] Enforce that internal storage is prepared first am: c193c3fbb8 -s ours am: 6e62eb2100 -s ours
am skip reason: Merged-In Ib26cc1bd46ffa2578f6f0156dfacc5496dae3178 with SHA-1 c66c2e306d is already in history

Original change: https://googleplex-android-review.googlesource.com/c/platform/system/vold/+/18163020

Change-Id: I39f93e7e2c13242195524abeb712e6248530fd0a
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-05-11 21:31:34 +00:00
Eric Biggers
cac2ea1a11 [automerger skipped] Enforce that internal storage is prepared first am: c193c3fbb8 am: 449ac4d8ff -s ours
am skip reason: Merged-In Ib26cc1bd46ffa2578f6f0156dfacc5496dae3178 with SHA-1 c66c2e306d is already in history

Original change: https://googleplex-android-review.googlesource.com/c/platform/system/vold/+/18163020

Change-Id: If3f6ec126e7d92865bae3c733b414047e5fdbaa3
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-05-11 21:24:37 +00:00
Eric Biggers
e358ce1a50 Enforce that internal storage is prepared first am: c193c3fbb8 am: 449ac4d8ff
Original change: https://googleplex-android-review.googlesource.com/c/platform/system/vold/+/18163020

Change-Id: I230fdf8a3a4e38dcaf303c41867fdf924a3eae03
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-05-11 21:24:28 +00:00
Eric Biggers
6e62eb2100 [automerger skipped] Enforce that internal storage is prepared first am: c193c3fbb8 -s ours
am skip reason: Merged-In Ib26cc1bd46ffa2578f6f0156dfacc5496dae3178 with SHA-1 c66c2e306d is already in history

Original change: https://googleplex-android-review.googlesource.com/c/platform/system/vold/+/18163020

Change-Id: I5166e083498635a96526d45c6470884ea4adf0a9
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-05-11 21:09:44 +00:00
Eric Biggers
449ac4d8ff Enforce that internal storage is prepared first am: c193c3fbb8
Original change: https://googleplex-android-review.googlesource.com/c/platform/system/vold/+/18163020

Change-Id: Ide14963edb87119fa4c7b06cee5a2d01eb1fe8dc
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-05-11 21:08:54 +00:00
Eric Biggers
aafc1bfb73 Don't return /data/data from BuildDataUserCePath()
There is no reason for this function to sometimes return the legacy
alias "/data/data" for /data/user/0.  Just use /data/user/0 instead.

Bug: 156305599
Change-Id: I305a9463c1bf0a59495c34ef33430f92257c2f0d
2022-05-11 05:33:25 +00:00