Commit graph

6312 commits

Author SHA1 Message Date
Eric Biggers
53b0fcc994 Merge "Check for SELinux labelling errors" am: 826eef6b33 am: 0c7abb02e5 am: 44d3181bc5 am: 13c2e12a5a
Original change: https://android-review.googlesource.com/c/platform/system/vold/+/2465051

Change-Id: I3fd4f932a08debd717026026d9b23a2cae88b8f5
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-03-03 01:23:47 +00:00
Eric Biggers
13c2e12a5a Merge "Check for SELinux labelling errors" am: 826eef6b33 am: 0c7abb02e5 am: 44d3181bc5
Original change: https://android-review.googlesource.com/c/platform/system/vold/+/2465051

Change-Id: Ie71dab9cd4818e1ab7d37c5442b451776451b328
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-03-02 20:27:49 +00:00
Eric Biggers
44d3181bc5 Merge "Check for SELinux labelling errors" am: 826eef6b33 am: 0c7abb02e5
Original change: https://android-review.googlesource.com/c/platform/system/vold/+/2465051

Change-Id: I25c3b804e4e4814a357d8428231c42a33a5f01d8
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-03-02 19:49:30 +00:00
Eric Biggers
0c7abb02e5 Merge "Check for SELinux labelling errors" am: 826eef6b33
Original change: https://android-review.googlesource.com/c/platform/system/vold/+/2465051

Change-Id: I55ae26d92455278fb9e687571392083c5859e4d9
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-03-02 19:14:42 +00:00
Eric Biggers
826eef6b33 Merge "Check for SELinux labelling errors" 2023-03-02 18:35:16 +00:00
Eric Biggers
c7c4f5a902 Check for SELinux labelling errors
It's essential that files created by vold get the correct SELinux
labels, so make sure to check for errors when setting them.

ENOENT (no label defined) is expected on some files such as
/mnt/appfuse/*, so allow ENOENT but log a DEBUG message.

This will help debug b/269567270.  This is not a fix for b/269567270.

Bug: 269567270
Test: Created user and checked SELinux labels of user's directories
Test: atest CtsBlobStoreHostTestCases
Change-Id: Ife005bdd896952653943c57336deb33456f7c5d8
2023-03-01 22:11:29 +00:00
Austin Delgado
d4f0c79fb5 Merge "Revert "Strictly check for SELinux labelling errors"" am: 545f0ab758 am: 9a4265cc20 am: edb3220e2b am: 6ed3654033 am: bd79cf1cb0
Original change: https://android-review.googlesource.com/c/platform/system/vold/+/2461593

Change-Id: Ic11c86f95e156493eb8796d250c0e4821a88d693
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-03-01 02:10:39 +00:00
Austin Delgado
10c408e97f Merge "Revert "Strictly check for SELinux labelling errors"" am: 545f0ab758 am: 9a4265cc20 am: edb3220e2b am: 6ed3654033 am: 349dda09f2
Original change: https://android-review.googlesource.com/c/platform/system/vold/+/2461593

Change-Id: Ie40234ff9cd76c9fc4d122dd40a3604ea42f30ea
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-03-01 02:09:14 +00:00
Austin Delgado
349dda09f2 Merge "Revert "Strictly check for SELinux labelling errors"" am: 545f0ab758 am: 9a4265cc20 am: edb3220e2b am: 6ed3654033
Original change: https://android-review.googlesource.com/c/platform/system/vold/+/2461593

Change-Id: I363320f5d2af4663b0a4179afea0035274113b64
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-03-01 01:13:11 +00:00
Austin Delgado
bd79cf1cb0 Merge "Revert "Strictly check for SELinux labelling errors"" am: 545f0ab758 am: 9a4265cc20 am: edb3220e2b am: 6ed3654033
Original change: https://android-review.googlesource.com/c/platform/system/vold/+/2461593

Change-Id: Id992e07388777ffb57ff0197b6d41db60e0f96a1
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-03-01 01:12:27 +00:00
Austin Delgado
6ed3654033 Merge "Revert "Strictly check for SELinux labelling errors"" am: 545f0ab758 am: 9a4265cc20 am: edb3220e2b
Original change: https://android-review.googlesource.com/c/platform/system/vold/+/2461593

Change-Id: I9839fde4983f0ef66e5da75f9ad26537765b4773
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-03-01 00:19:37 +00:00
Eric Biggers
c8e993fd55 Merge "Strictly check for SELinux labelling errors" am: 5554b80afb am: d8bf3b2681 am: 2df74f43c0 am: f65f63a29c am: 3c69beeb5a
Original change: https://android-review.googlesource.com/c/platform/system/vold/+/2456274

Change-Id: I858255f9403e042eef5cacee359c6540bc34096a
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-02-28 23:46:42 +00:00
Austin Delgado
edb3220e2b Merge "Revert "Strictly check for SELinux labelling errors"" am: 545f0ab758 am: 9a4265cc20
Original change: https://android-review.googlesource.com/c/platform/system/vold/+/2461593

Change-Id: Ia7bd2386936b722f2c4effa3f2615caa11918353
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-02-28 23:41:28 +00:00
Eric Biggers
017ea112b4 Merge "Strictly check for SELinux labelling errors" am: 5554b80afb am: d8bf3b2681 am: 2df74f43c0 am: f65f63a29c am: f9ea98a1ba
Original change: https://android-review.googlesource.com/c/platform/system/vold/+/2456274

Change-Id: I4bf219d3820646902b855df4ed28352b92f34f5f
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-02-28 23:08:42 +00:00
Eric Biggers
3c69beeb5a Merge "Strictly check for SELinux labelling errors" am: 5554b80afb am: d8bf3b2681 am: 2df74f43c0 am: f65f63a29c
Original change: https://android-review.googlesource.com/c/platform/system/vold/+/2456274

Change-Id: I5e0bcea1dbb2131f6da83c8ec898975147d3e01f
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-02-28 22:55:03 +00:00
Austin Delgado
9a4265cc20 Merge "Revert "Strictly check for SELinux labelling errors"" am: 545f0ab758
Original change: https://android-review.googlesource.com/c/platform/system/vold/+/2461593

Change-Id: Id02634939a86d6fb05b8a2762c4a6cb161ed7476
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-02-28 22:44:36 +00:00
Eric Biggers
f9ea98a1ba Merge "Strictly check for SELinux labelling errors" am: 5554b80afb am: d8bf3b2681 am: 2df74f43c0 am: f65f63a29c
Original change: https://android-review.googlesource.com/c/platform/system/vold/+/2456274

Change-Id: Ib712102acd25edfbcf9e66784a57cc8eb2646cf5
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-02-28 22:27:00 +00:00
Austin Delgado
545f0ab758 Merge "Revert "Strictly check for SELinux labelling errors"" 2023-02-28 22:05:45 +00:00
Austin Delgado
b0f997deae Revert "Strictly check for SELinux labelling errors"
This reverts commit 2ef4e85448.

Reason for revert: b/271157681

Change-Id: I7224fd68027e2e9824694171547b8b2c808f9923
2023-02-28 21:58:08 +00:00
Eric Biggers
f65f63a29c Merge "Strictly check for SELinux labelling errors" am: 5554b80afb am: d8bf3b2681 am: 2df74f43c0
Original change: https://android-review.googlesource.com/c/platform/system/vold/+/2456274

Change-Id: I0d2c7197660c0a3b1428c5ebe6904fd4db7f1a61
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-02-28 21:46:35 +00:00
Eric Biggers
2df74f43c0 Merge "Strictly check for SELinux labelling errors" am: 5554b80afb am: d8bf3b2681
Original change: https://android-review.googlesource.com/c/platform/system/vold/+/2456274

Change-Id: Iaac9bc0c82a43a4808cec59867320ff6084cff67
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-02-28 21:03:43 +00:00
Eric Biggers
d8bf3b2681 Merge "Strictly check for SELinux labelling errors" am: 5554b80afb
Original change: https://android-review.googlesource.com/c/platform/system/vold/+/2456274

Change-Id: I7c4ab5c3fdfbda22b24a8875915f3acfef1b8003
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-02-28 20:25:42 +00:00
Eric Biggers
5554b80afb Merge "Strictly check for SELinux labelling errors" 2023-02-28 19:31:24 +00:00
Nathan Huckleberry
759ac5f87c Clean up potential busy files after key eviction.
There is a race condition between key eviction and killing user
processes.  The race condition is difficult to properly fix without
significantly degrading UI performance.

If the race condition occurs, decrypted filesystem data is left in
various kernel caches.  To mitigate, we try to ensure the caches are
flushed by evicting the keys again in a worker thread.

Test: Checked that the correct log messages appear when evicting a
user's keys
Bug: 140762419

Change-Id: I9e39e5bb0f5190284552bcd252b6213a22a51e91
(cherry picked from commit a21962b207)
Merged-In: I9e39e5bb0f5190284552bcd252b6213a22a51e91
2023-02-28 18:47:56 +00:00
Eric Biggers
2ef4e85448 Strictly check for SELinux labelling errors
It's essential that files created by vold get the correct SELinux
labels, so make sure to check for errors when setting them.

This will help debug b/269567270.  This is not a fix for b/269567270.

Bug: 269567270
Test: Created user and checked SELinux labels of user's directories
Change-Id: I99e4d530a00f9401532c9cb0990df254b7a12a80
2023-02-27 21:01:25 +00:00
Eric Biggers
920ed71a38 Merge "Fix logspam when user removed before CE storage prepared" am: 481a5367a3 am: 6f2860e3d1 am: 82a70284e8 am: ca08807617 am: 82477817c7
Original change: https://android-review.googlesource.com/c/platform/system/vold/+/2456268

Change-Id: I22560bfb5c1e05e317342af6bca2307cce96a353
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-02-25 05:25:00 +00:00
Eric Biggers
fe39a2dc83 Merge "Fix logspam when user removed before CE storage prepared" am: 481a5367a3 am: 6f2860e3d1 am: 82a70284e8 am: ca08807617 am: de7b5a0630
Original change: https://android-review.googlesource.com/c/platform/system/vold/+/2456268

Change-Id: Ie89de8d3a7b64995b0ecf3185d461cb09b048f04
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-02-25 05:24:30 +00:00
Eric Biggers
de7b5a0630 Merge "Fix logspam when user removed before CE storage prepared" am: 481a5367a3 am: 6f2860e3d1 am: 82a70284e8 am: ca08807617
Original change: https://android-review.googlesource.com/c/platform/system/vold/+/2456268

Change-Id: Ibadbd201508d4bf5138c22d896ad9dd63731eb4b
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-02-25 04:15:40 +00:00
Eric Biggers
82477817c7 Merge "Fix logspam when user removed before CE storage prepared" am: 481a5367a3 am: 6f2860e3d1 am: 82a70284e8 am: ca08807617
Original change: https://android-review.googlesource.com/c/platform/system/vold/+/2456268

Change-Id: I96739dd0e525f24f1611af54df683c50f6fe0a2c
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-02-25 04:15:35 +00:00
Eric Biggers
ca08807617 Merge "Fix logspam when user removed before CE storage prepared" am: 481a5367a3 am: 6f2860e3d1 am: 82a70284e8
Original change: https://android-review.googlesource.com/c/platform/system/vold/+/2456268

Change-Id: I4b47090596f05f70b1a1118daa2db7e65816f1e1
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-02-25 03:38:20 +00:00
Eric Biggers
82a70284e8 Merge "Fix logspam when user removed before CE storage prepared" am: 481a5367a3 am: 6f2860e3d1
Original change: https://android-review.googlesource.com/c/platform/system/vold/+/2456268

Change-Id: I6893e48e0a0e4435c2ad24273111622476d281fa
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-02-25 02:41:48 +00:00
Eric Biggers
6f2860e3d1 Merge "Fix logspam when user removed before CE storage prepared" am: 481a5367a3
Original change: https://android-review.googlesource.com/c/platform/system/vold/+/2456268

Change-Id: I23d149b794f713a87b6af202eb3c843ce590db54
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-02-25 02:04:20 +00:00
Eric Biggers
481a5367a3 Merge "Fix logspam when user removed before CE storage prepared" 2023-02-24 22:40:59 +00:00
Eric Biggers
629c63414e Fix logspam when user removed before CE storage prepared
Due to frameworks/base commit 5c65b1ee1023 ("Don't prepare CE storage on
user creation") (http://ag/20241697), removing a user immediately after
creating it causes the user's directories to be destroyed before CE
storage was prepared.

Functionally this works fine; however, it causes some error messages to
be spammed to the log because 'vold_prepare_subdirs destroy' doesn't
like that /data/misc_ce/$userId and /data/vendor_ce/$userId don't exist.
vold_prepare_subdirs logs two error messages itself, but it also exits
with a failure status, which bubbles up and causes a Slog.wtf with a
stack trace in StorageManagerService.

Fix this by making rmrf_contents() simply return true if the directory
doesn't exist.

Bug: 232452368
Test: 'pm create-user 10 && pm remove-user 10' and check logcat
Change-Id: I867a915f4b25e1a5f0603fbd84680b673ff5eb96
2023-02-24 22:38:06 +00:00
Nathan Huckleberry
791d952883 Merge "Clean up potential busy files after key eviction." am: eee1149800 am: 5c76dbd2b9 am: e182824b3b am: 173097221d am: f40bac66fd
Original change: https://android-review.googlesource.com/c/platform/system/vold/+/2448745

Change-Id: I698c808a4448bded11c51c0bfd2d17c7c92d87e5
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-02-24 11:25:49 +00:00
Nathan Huckleberry
f40bac66fd Merge "Clean up potential busy files after key eviction." am: eee1149800 am: 5c76dbd2b9 am: e182824b3b am: 173097221d
Original change: https://android-review.googlesource.com/c/platform/system/vold/+/2448745

Change-Id: I5a1f3cb3cfaf8ff6dc4205495adfbb30363088bc
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-02-24 10:49:45 +00:00
Nathan Huckleberry
167e99b602 Merge "Clean up potential busy files after key eviction." am: eee1149800 am: 5c76dbd2b9 am: e182824b3b am: 173097221d
Original change: https://android-review.googlesource.com/c/platform/system/vold/+/2448745

Change-Id: Ie50837e43d9d0c23fe0e3a9a6b83dfec26c29bb8
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-02-24 10:49:36 +00:00
Nathan Huckleberry
173097221d Merge "Clean up potential busy files after key eviction." am: eee1149800 am: 5c76dbd2b9 am: e182824b3b
Original change: https://android-review.googlesource.com/c/platform/system/vold/+/2448745

Change-Id: I5c59d48db22feea4a84103a847802585ef422a5d
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-02-24 09:34:26 +00:00
Nathan Huckleberry
e182824b3b Merge "Clean up potential busy files after key eviction." am: eee1149800 am: 5c76dbd2b9
Original change: https://android-review.googlesource.com/c/platform/system/vold/+/2448745

Change-Id: I1a4051b2a23b3dbef7b4ab94d3a596cabbbab8ba
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-02-24 08:57:22 +00:00
Nathan Huckleberry
5c76dbd2b9 Merge "Clean up potential busy files after key eviction." am: eee1149800
Original change: https://android-review.googlesource.com/c/platform/system/vold/+/2448745

Change-Id: I8f821920d4d1e344741d90594e2a96b9e6ecc3ee
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-02-24 08:30:59 +00:00
Nathan Huckleberry
eee1149800 Merge "Clean up potential busy files after key eviction." 2023-02-24 08:18:07 +00:00
Nathan Huckleberry
a21962b207 Clean up potential busy files after key eviction.
There is a race condition between key eviction and killing user
processes.  The race condition is difficult to properly fix without
significantly degrading UI performance.

If the race condition occurs, decrypted filesystem data is left in
various kernel caches.  To mitigate, we try to ensure the caches are
flushed by evicting the keys again in a worker thread.

Test: Checked that the correct log messages appear when evicting a
user's keys
Bug: 140762419

Change-Id: I9e39e5bb0f5190284552bcd252b6213a22a51e91
2023-02-23 21:44:24 +00:00
Treehugger Robot
0152242d53 Merge "MetadataCrypt: extend timeout for low performance device" am: c2b0578e19 am: a38a2fa330 am: 3f2652163e am: 2866455471 am: e5dabe0fdd
Original change: https://android-review.googlesource.com/c/platform/system/vold/+/2422559

Change-Id: Ic01e241f362b8f21bc2a1a5dd617b468a3203655
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-02-17 22:37:17 +00:00
Treehugger Robot
e5dabe0fdd Merge "MetadataCrypt: extend timeout for low performance device" am: c2b0578e19 am: a38a2fa330 am: 3f2652163e am: 2866455471
Original change: https://android-review.googlesource.com/c/platform/system/vold/+/2422559

Change-Id: I6f78085305c844bd06837bee4e552ea6eda4e8bf
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-02-17 21:26:08 +00:00
Treehugger Robot
2d6c9f6adb Merge "MetadataCrypt: extend timeout for low performance device" am: c2b0578e19 am: a38a2fa330 am: 3f2652163e am: 2866455471
Original change: https://android-review.googlesource.com/c/platform/system/vold/+/2422559

Change-Id: Id43c94047cf30c73c4569933e0973f34440ab9c0
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-02-17 21:18:14 +00:00
Treehugger Robot
2866455471 Merge "MetadataCrypt: extend timeout for low performance device" am: c2b0578e19 am: a38a2fa330 am: 3f2652163e
Original change: https://android-review.googlesource.com/c/platform/system/vold/+/2422559

Change-Id: If51358824575a5e5785bc05f65fe4253da1ab283
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-02-17 19:52:22 +00:00
Treehugger Robot
3f2652163e Merge "MetadataCrypt: extend timeout for low performance device" am: c2b0578e19 am: a38a2fa330
Original change: https://android-review.googlesource.com/c/platform/system/vold/+/2422559

Change-Id: I2a2e85bb2b030daadb76c5efea4652f0ddbcbfd1
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-02-17 18:42:15 +00:00
Treehugger Robot
a38a2fa330 Merge "MetadataCrypt: extend timeout for low performance device" am: c2b0578e19
Original change: https://android-review.googlesource.com/c/platform/system/vold/+/2422559

Change-Id: I0713915e7e5123269462fbff51c449910262fc56
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-02-17 17:37:51 +00:00
Treehugger Robot
c2b0578e19 Merge "MetadataCrypt: extend timeout for low performance device" 2023-02-17 16:50:01 +00:00
Alfred Piccioni
f39c44a093 Revert "Add NTFS support in vold"
Ignore-AOSP-First: Change already merged in AOSP, has same change ID, so
manually merging into master.
This reverts commit 564f6c649a.

Reason for revert: Un-backporting.

Note: This is not a direct revert. We should keep the minor refactoring
in PublicVolume.cpp; no point making the code worse.

Test: Revert.
Change-Id: I68e31bd55158ea06af4f42f14723d3404d63f6d5
2023-02-16 12:16:28 +01:00