Commit graph

6377 commits

Author SHA1 Message Date
Android Build Coastguard Worker
845e7468f0 Snap for 11641371 from 3f68f4d7f9 to 24Q3-release
Change-Id: I41fe7eb6c17fb670ce518db16d50c53965015526
2024-03-28 23:24:30 +00:00
Ellen Arteca
3f68f4d7f9 Merge "Revert "Add @SensitiveData tag to IVold"" into main am: 366ad7a6f1 am: f450549fa3
Original change: https://android-review.googlesource.com/c/platform/system/vold/+/3015100

Change-Id: I5a1ff5e2251224d96baf88e6b3b2f1c10bedfdb6
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-03-27 20:19:46 +00:00
Ellen Arteca
f450549fa3 Merge "Revert "Add @SensitiveData tag to IVold"" into main am: 366ad7a6f1
Original change: https://android-review.googlesource.com/c/platform/system/vold/+/3015100

Change-Id: I915c4052995e466f9e4c93c2a7a78dec09ad615a
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-03-27 20:03:15 +00:00
Ellen Arteca
366ad7a6f1 Merge "Revert "Add @SensitiveData tag to IVold"" into main 2024-03-27 19:49:34 +00:00
Ellen Arteca
697c6a5217 Revert "Add @SensitiveData tag to IVold"
This reverts commit da1d160074.

Reason for revert: reverting while figuring out what is causing performance bug 331045735

Change-Id: Ib306e679e65c3a585304ad4c33304c549cbb240e
2024-03-27 05:30:39 +00:00
Android Build Coastguard Worker
1c7f86ea02 Snap for 11617975 from 008b823553 to 24Q3-release
Change-Id: Idd2cd50a6c4ff205b175c14d8c0c74a07a00e845
2024-03-23 01:24:13 +00:00
Ellen Arteca
008b823553 Merge "Add @SensitiveData tag to IVold" into main am: bb525131bb am: 551a069797
Original change: https://android-review.googlesource.com/c/platform/system/vold/+/3006939

Change-Id: Ieadc14e72e0406d6201146b2a35427bf567a8c22
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-03-22 21:49:47 +00:00
Ellen Arteca
551a069797 Merge "Add @SensitiveData tag to IVold" into main am: bb525131bb
Original change: https://android-review.googlesource.com/c/platform/system/vold/+/3006939

Change-Id: Iaa8e5b4daba7df88dfe6ee4a3c3dd567d62530a8
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-03-22 21:38:18 +00:00
Ellen Arteca
bb525131bb Merge "Add @SensitiveData tag to IVold" into main 2024-03-22 21:21:15 +00:00
Android Build Coastguard Worker
c9a399b852 Snap for 11610847 from b7269677a0 to 24Q3-release
Change-Id: I99d5750dc4d69acd274567f746aa3f92f79f01d5
2024-03-21 23:24:32 +00:00
Ellen Arteca
da1d160074 Add @SensitiveData tag to IVold
Mitigate data leak across the Binder boundary to Vold, of secrets derived from the LSKF.
Specifically: the `String secret` argument to both `setCeStorageProtection` and `unlockCeStorage` is
a secret derived from the user's synthetic password.

This CL is part of an effort to wipe instances of the LSKF and
secrets derived from it, so they are not available in a RAMdump.

Bug: 320392352
Test: launch_cvd -daemon

Change-Id: I0439f63fd4739bf5a6c957695cc9c3003ec89eb0
2024-03-21 23:12:18 +00:00
Treehugger Robot
b7269677a0 Merge "Revert "Reduce AppFuse max read size."" into main am: 7ed876741c am: 8a5b1dd831
Original change: https://android-review.googlesource.com/c/platform/system/vold/+/2994273

Change-Id: Idb1d002514c185ccdef4d20521db05af28348c83
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-03-21 15:26:41 +00:00
Treehugger Robot
8a5b1dd831 Merge "Revert "Reduce AppFuse max read size."" into main am: 7ed876741c
Original change: https://android-review.googlesource.com/c/platform/system/vold/+/2994273

Change-Id: I0c9c21ca903c75d1f0f24d3e4e099976b6d40d5a
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-03-21 15:15:22 +00:00
Treehugger Robot
7ed876741c Merge "Revert "Reduce AppFuse max read size."" into main 2024-03-21 15:01:22 +00:00
Martijn Coenen
6bce91cd30 Revert "Reduce AppFuse max read size."
This reverts commit fb014fc6e8.

Reason for revert: b/325994066

Change-Id: Ia8bb76ac69713df8bd9df5501b3dde9a86a5fd99
2024-03-08 14:37:13 +00:00
Android Build Coastguard Worker
0f2297c3a1 Snap for 11545716 from 5b7e144777 to 24Q3-release
Change-Id: Iaefb05c05c98bb0bcc9565e959a76a030c36f734
2024-03-08 00:25:30 +00:00
Xin Li
5b7e144777 [automerger skipped] Merge "Merge Android 14 QPR2 to AOSP main" into main am: 300df5a5d8 -s ours am: c66e3a405c -s ours
am skip reason: Merged-In Ib360884801c37c093d9836109f0b817987abd850 with SHA-1 481c20da07 is already in history

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

Change-Id: I0b9da01887d5a64fbf8ad53a662b255b5343de8a
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-03-07 09:11:37 +00:00
Xin Li
f86de4b022 [automerger skipped] Merge Android 14 QPR2 to AOSP main am: 01c18abebc -s ours am: 094eecb08c -s ours
am skip reason: Merged-In Ib360884801c37c093d9836109f0b817987abd850 with SHA-1 481c20da07 is already in history

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

Change-Id: Iff6aee9855e4c4ab12bdcc14e7f39145957cbaa9
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-03-07 09:10:21 +00:00
Xin Li
c66e3a405c [automerger skipped] Merge "Merge Android 14 QPR2 to AOSP main" into main am: 300df5a5d8 -s ours
am skip reason: Merged-In Ib360884801c37c093d9836109f0b817987abd850 with SHA-1 481c20da07 is already in history

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

Change-Id: Id08e446287564a857c4415403825232eed2eb474
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-03-07 08:34:42 +00:00
Xin Li
094eecb08c [automerger skipped] Merge Android 14 QPR2 to AOSP main am: 01c18abebc -s ours
am skip reason: Merged-In Ib360884801c37c093d9836109f0b817987abd850 with SHA-1 481c20da07 is already in history

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

Change-Id: I57c50d786c7c58331be3a0e2b716067af1383b99
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-03-07 08:33:22 +00:00
Xin Li
300df5a5d8 Merge "Merge Android 14 QPR2 to AOSP main" into main 2024-03-07 06:10:52 +00:00
Xin Li
01c18abebc Merge Android 14 QPR2 to AOSP main
Bug: 319669529
Merged-In: Ib360884801c37c093d9836109f0b817987abd850
Change-Id: I29925f20f929ec0522ce12e58e8a05f44490ba88
2024-03-06 18:58:28 -08:00
Android Build Coastguard Worker
2b59d82001 Snap for 11533280 from 7854618d72 to 24Q3-release
Change-Id: I9f1c2b5b1b9a3dccaa032a5f6f60e45cf696cb4f
2024-03-06 00:24:10 +00:00
Momoko Hattori
7854618d72 Merge "vold: Unmount StubVolume disks before unmounting EmulatedVolumes" into main am: 2f20c808c2 am: 481c20da07
Original change: https://android-review.googlesource.com/c/platform/system/vold/+/2850049

Change-Id: I4e057799940097a58e876be0ec2b9cbe852247d5
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-03-05 10:14:46 +00:00
Momoko Hattori
481c20da07 Merge "vold: Unmount StubVolume disks before unmounting EmulatedVolumes" into main am: 2f20c808c2
Original change: https://android-review.googlesource.com/c/platform/system/vold/+/2850049

Change-Id: Ib360884801c37c093d9836109f0b817987abd850
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-03-05 09:34:11 +00:00
Momoko Hattori
2f20c808c2 Merge "vold: Unmount StubVolume disks before unmounting EmulatedVolumes" into main 2024-03-05 08:45:29 +00:00
Android Build Coastguard Worker
0daaea4432 Snap for 11510413 from f4324ec4ae to 24Q3-release
Change-Id: Iae4729007051807ec50da3273d06e4f0d8d2c562
2024-02-29 00:25:26 +00:00
Eric Biggers
f4324ec4ae Merge "Delete unused code conditional on MANAGE_MISC_DIRS" into main am: cc2f93829c am: 37216f1084
Original change: https://android-review.googlesource.com/c/platform/system/vold/+/2978556

Change-Id: I0c474c32b4a01997afbc10ae7dc78468ea484d94
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-02-28 01:13:53 +00:00
Eric Biggers
37216f1084 Merge "Delete unused code conditional on MANAGE_MISC_DIRS" into main am: cc2f93829c
Original change: https://android-review.googlesource.com/c/platform/system/vold/+/2978556

Change-Id: If24e84ecff3eff052814ec5f275d464ab9ebf0e9
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-02-28 00:31:41 +00:00
Eric Biggers
cc2f93829c Merge "Delete unused code conditional on MANAGE_MISC_DIRS" into main 2024-02-27 23:51:33 +00:00
Eric Biggers
d0e9a59885 Delete unused code conditional on MANAGE_MISC_DIRS
Since MANAGE_MISC_DIRS is hardcoded to 0, and it always has been, there
is no need to have it in the code.

Test: build
Change-Id: I30a73e67999841271e07dbc3eeb1b8568529a7c3
2024-02-27 03:00:34 +00:00
Momoko Hattori
b4e033ed4c vold: Unmount StubVolume disks before unmounting EmulatedVolumes
The current shutdown / reset logic in VolumeManager unmounts
EmulatedVolume first, and unmounts the other disks.

In ARC (Android on ChromeOS), ChromeOS Downloads directory (exposed from
ChromeOS to Android as a disk having StubVolume) is bind-mounted to
/data/media/0/Download in the ARC-customized version of
StubVolume::doMount() (http://shortn/_lKaAhTLhY3), and the current
unmount order causes EmulatedVolume not to be cleanly unmounted. This
patch hence changes the order of the unmount of volumes to first unmount
StubVolume disks, then unmount the EmulatedVolumes, then unmount the
non-StubVolume disks.

Bug: 304369444
Test: On an Android phone, create a virtual public volume with the
  following commands on adb shell (taken from
  android.scopedstorage.cts.lib.TestUtils.createNewPublicVolume()):
  $ sm set-force-adoptable on
  $ sm set-virtual-disk true
  $ sm list-disks  # <- This returns the virtual disk name
  $ sm partition <virtual disk name> public
  Then, run `vdc volume reset` on lynx adb shell, observe logcat from
  vold and check that no error is observed.
Test: Run `vdc volume reset` on ARC adb shell, and confirm that:
  * Without this patch, the primary emulated volume fails to unmount
    with "Device or resource busy", followed by MyFiles volume unmount.
  * With this patch, MyFiles volume is unmounted before the primary
    emulated volume, and no error is observed.

Change-Id: I54f60e3320574ccf8d3589545ff77967fff14fc7
2024-02-22 18:07:18 +09:00
Android Build Coastguard Worker
23931ae8a4 Snap for 11469542 from b198cf9540 to 24Q3-release
Change-Id: Iff953261a20e32cba35bc987926c362826a035cf
2024-02-20 00:25:08 +00:00
Treehugger Robot
b198cf9540 Merge "Reduce AppFuse max read size." into main am: 527a52874e am: f291279b12
Original change: https://android-review.googlesource.com/c/platform/system/vold/+/2859125

Change-Id: Ic9b4a36e68e1228fb504d2e8068c076e2f708a88
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-02-19 12:00:03 +00:00
Treehugger Robot
f291279b12 Merge "Reduce AppFuse max read size." into main am: 527a52874e
Original change: https://android-review.googlesource.com/c/platform/system/vold/+/2859125

Change-Id: Ib3c5e4302d38e527d3c15e94b25991994ea9bdfc
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-02-19 11:19:41 +00:00
Treehugger Robot
527a52874e Merge "Reduce AppFuse max read size." into main 2024-02-19 10:39:40 +00:00
Aditya Choudhary
73874ce868 Migrate Test Targets to New Android Ownership Model
This CL is created as a best effort to migrate test targets to the new Android ownership model.
It is based on historical data from repository history and insights from git blame.
Given the nature of this effort, there may be instances of incorrect attribution. If you find incorrect or unnecessary
attribution in this CL, please create a new CL to fix that.

For detailed guidelines and further information on the migration please refer to the link below,
go/new-android-ownership-model

Bug: 304529413
Test: N/A
Change-Id: Ifbead75f744dc00b84aa71b5847ec6a5e0289251
2024-02-02 13:56:19 +00:00
David Anderson
4ed5b5f4b5 Merge "Add API to get remaining lifetime as a percentage." into main am: f75d8fc237 am: 3774a02e66
Original change: https://android-review.googlesource.com/c/platform/system/vold/+/2940229

Change-Id: Ib004cb63ef91f30a7df230f99c732dce9eccd6c6
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-02-01 06:07:25 +00:00
David Anderson
3774a02e66 Merge "Add API to get remaining lifetime as a percentage." into main am: f75d8fc237
Original change: https://android-review.googlesource.com/c/platform/system/vold/+/2940229

Change-Id: Ifbecbd4442b970b87605b6c223e89efd11f5bcba
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-02-01 05:27:53 +00:00
David Anderson
f75d8fc237 Merge "Add API to get remaining lifetime as a percentage." into main 2024-02-01 04:51:03 +00:00
David Anderson
0620564ecb Add API to get remaining lifetime as a percentage.
This differs slightly from the previous API, which exists for idle
maintenance, whereas this value is intended to be displayed to users.
First, it returns remaining lifetime, rather than used lifetime. Second,
it rounds up the returned value for usabilty purposes. This isn't an
issue on Pixel (which reports at 1% granularity), but devices which
report at 10% granularity should show 100% out-of-box, which is not
possible to distinguish in the old API.

Bug: 309886423
Test: StorageManager.getRemainingStorageLifetime
Change-Id: Ic5f6ec9969667302ba8bad95b2765e2cc740bed4
2024-01-31 22:50:18 +00:00
Xin Li
8e0120892b [automerger skipped] Merge Android 24Q1 Release (ab/11220357) am: eb6960e364 -s ours
am skip reason: Merged-In I8efef8efbc9f01e1177fbe3105513166ad90d22f with SHA-1 f428f9e6f0 is already in history

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

Change-Id: I9e95e86c1cc2e8a3c1f0c54357b747f4ee383d1b
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-01-31 02:03:08 +00:00
Xin Li
eb6960e364 Merge Android 24Q1 Release (ab/11220357)
Bug: 319669529
Merged-In: I8efef8efbc9f01e1177fbe3105513166ad90d22f
Change-Id: If7ebdccc494c7edb5b1603eb3154ca508e14dc33
2024-01-23 22:16:46 -08:00
Neil Fuller
2f22bd0f3f Merge "Add time_offset=<UTC offset> to mount arguments" into main am: 5b711b10db am: bb1f4dcdbd
Original change: https://android-review.googlesource.com/c/platform/system/vold/+/2901301

Change-Id: I430cf7e7004faa43cf0b258248b29803a12335d8
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-01-19 18:43:54 +00:00
Neil Fuller
bb1f4dcdbd Merge "Add time_offset=<UTC offset> to mount arguments" into main am: 5b711b10db
Original change: https://android-review.googlesource.com/c/platform/system/vold/+/2901301

Change-Id: I96fac82b8cbad9f471b0dbcb26ac6fbc54a51273
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-01-19 18:01:13 +00:00
Neil Fuller
5b711b10db Merge "Add time_offset=<UTC offset> to mount arguments" into main 2024-01-19 17:26:00 +00:00
Neil Fuller
6eea031719 Add time_offset=<UTC offset> to mount arguments
Add time_offset=<UTC offset> to mount arguments for the vfat driver.

This is not being release flagged as it's a fix for a regression but is
a cosmetic fix that shouldn't affect anything besides reported file
timestamps.

Changes for issue 246256335 in Android U stopped Android syncing the
current time zone UTC offset to the kernel because doing so is
discouraged. It is discouraged because the current offset alone is not
very useful - it tells the kernel nothing of DST or historic UTC
offsets. Converting to and from local times are are best left to
userspace where time zone rules information is available, and different
users can use different time zones.

However, because FAT32 is poorly designed WRT timestamps, the kernel
FAT32 driver, vfat, does use the kernel offset when available and when
it isn't given a fixed offset to use at volume mount time. This means
that Android devices after the change from issue 246256335 displayed
more obviously incorrect times.

This change adds the argument necessary to vold when mounting a FAT32
volume to set a fixed UTC offset to adjust FAT32 local times
to a UTC-like time ("UTC time" from now on). Userspace then uses the UTC
offset for that UTC time, calculated using TZDB rules, to convert back
to a local time. This is still prone to generating some incorrect times,
e.g. due to DST or other historic offset changes, or a user time zone
change on device after mounting the volume. FAT32 lacks the information
about "what was the UTC offset at file time X?" (unlike exFAT) AND the
vfat driver has no way to look up the time zone rules itself. This
change is a reasonable "better than nothing" change to address times
being obviously wrong after the change from issue 246256335, especially
when a user copies a file from a desktop computer to USB / sd card
storage and immediately plugs the device into an Android device. It does
this without reverting to kernel UTC offset syncing, which is flawed
(i.e. it would never work completely), discouraged, and more effort/code
to improve, e.g. because userspace would have to schedule alarms for
offset changes.

Testing:

1) Obtain a USB FAT32 formatted USB storage device that can be plugged into
   a pixel device, e.g. with an OTG USB adapter.
2) On a desktop computer, mount the device and write some files / note
   times associated with existing files. These times will already be
   adjusted by this OS to be "local time" based on its own logic, but if
   it's working correctly that time will be exactly the local time value
   stored in the FAT32 volume itself.
3) On a rooted Android device where you can use adb via Wifi (adb tcpip
   / adb connect), leaving the USB port free for external USB devices....
   a) $ adb root
   b) Insert the USB storage
   c) $ mount | grep 'fat'
   d) For the USB storage drive, observe the time_offset argument (or
   tz=UTC when time_offset == 0) reported (this would not be reported
   without this patch)
   e) ls -l /mnt/<mount location from (3c)>
   f) Confirm the local time displayed is as expected. e.g. the time
   should be the same as shown in (2), regardless of the device's time
   zone.
4) To observe the "fixed offset behavior" at mount time, alter the time
   zone setting on the device via Settings -> System -> Date & Time
   a) Repeat 3c-3e.
   b) The times shown will have changed by the difference between
   the original and new time zone chosen.
   c) Extract / re-insert the USB storage device.
   d) Repeat 3c-3e
   e) The times shown should match the times from (2) again
5) Confirm the write behavior:
   a) $ touch /mnt/<mount location from (3c)>/foobar
   b) $ ls -l /mnt/<mount location from (3c)>
   c) The time should match the device's displayed local time (status
   bar)
   d) Unmount the USB device and insert the USB device into a desktop computer
   e) Confirm the timestamp matches the Android device's local time when
   (5a) took place, e.g. using "ls -lT" on MacOS.

Testing was done with numerous zones with positive, negative and zero offsets.
Interesting zones like India (UTC+5:30), Kiribati (UTC+14), Wake Island
(UTC-11), the various fixed offset zones like Etc/GMT+12, Etc/GMT-14
were tried.

Note: Depending on the time zones being used on devices (Android and
desktop) and when the files were written / testing took place during the
year, you may see file times shifting by 1 hour from the "ls -l" step
depending on whether they were written in summer or winter time.  This
is because the userspace code for rendering times knows about DST but
the kernel driver is applying a fixed offset and does not.  This is
expected and illustrates the points at the top of this comment about
FAT32 integration never being perfect.
See https://www.google.com/search?q=fat32+dst for other examples.

Bug: 319417938
Bug: 315058275
Bug: 246256335
Test: See above
Change-Id: Ic7ce159d88db5d5cf5894bcc26ea60bd7c44917d
2024-01-19 16:51:20 +00:00
Treehugger Robot
43de76b3b5 Merge "Don't use std::allocator::pointer" into main am: 55af483b78 am: 1e1940d434 am: fb3c316d41
Original change: https://android-review.googlesource.com/c/platform/system/vold/+/2901505

Change-Id: I4ca2dda97c9fa8acbfc6fc3cded226441b0f9976
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-01-11 23:11:49 +00:00
Treehugger Robot
fb3c316d41 Merge "Don't use std::allocator::pointer" into main am: 55af483b78 am: 1e1940d434
Original change: https://android-review.googlesource.com/c/platform/system/vold/+/2901505

Change-Id: I82bbc9bad9f7bd4ba20226ab9113f2b398dccf86
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-01-11 22:41:07 +00:00
Treehugger Robot
1e1940d434 Merge "Don't use std::allocator::pointer" into main am: 55af483b78
Original change: https://android-review.googlesource.com/c/platform/system/vold/+/2901505

Change-Id: I110e19f98b191da52c353e979dfa4e00da270d7f
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-01-11 21:55:22 +00:00