Commit graph

2519 commits

Author SHA1 Message Date
Sudheer Shanka
ba0c62f752 Remove packageName from vold internal state.
std::remove will only move the matching items to the end, there
should be an erase call after that to actually get rid of those
items from the container.

Test: manual
Change-Id: I7d3b48f77fa5fab703fb10cf429d8c183322ed29
2018-12-16 18:35:53 -08:00
Jeff Sharkey
2717699b49 Merge "Create a new mount mode for installer packages." 2018-12-13 16:16:43 +00:00
Sudheer Shanka
03992e3741 Create a new mount mode for installer packages.
New external storage mount mode for installers so
that they can access obb dirs of all apps.

Bug: 111789719
Test: atest android.appsecurity.cts#testExternalStorageObbGifts
Change-Id: Iab112f0273806f8f812f14d6691bbe71dff42d83
2018-12-12 19:04:52 -08:00
Greg Kaiser
93153600a7 Merge changes from topic "userspace_adiantum_support" am: 7adca74263 am: 3d5c751a88
am: ad60a8609c

Change-Id: Ie7c67da59212bd45e446dc81c9109092d9bb6b9b
2018-12-11 21:33:49 -08:00
Greg Kaiser
5b64839190 cryptfs: Add Adiantum support am: 8cb4c9ff78 am: 461e6732b4
am: 8b90442c0f

Change-Id: Iffd163ee7ca99a24cdc021ef567950a2a8f2aa62
2018-12-11 21:33:42 -08:00
Greg Kaiser
ad60a8609c Merge changes from topic "userspace_adiantum_support" am: 7adca74263
am: 3d5c751a88

Change-Id: I3f33a599ce48fd9c8325ad6c2c973e273c8ff629
2018-12-11 21:24:30 -08:00
Greg Kaiser
8b90442c0f cryptfs: Add Adiantum support am: 8cb4c9ff78
am: 461e6732b4

Change-Id: I9c328eeb7ab72bf1b247da6faab1de66d1b5b719
2018-12-11 21:24:25 -08:00
Greg Kaiser
3d5c751a88 Merge changes from topic "userspace_adiantum_support"
am: 7adca74263

Change-Id: I7bd33d9f750bc738c3df43ebf27e7f0d96d6fc5c
2018-12-11 21:16:04 -08:00
Greg Kaiser
461e6732b4 cryptfs: Add Adiantum support
am: 8cb4c9ff78

Change-Id: I57692f2a1d1eb0b66105f7ec7620f5abb9228303
2018-12-11 21:15:49 -08:00
Greg Kaiser
7adca74263 Merge changes from topic "userspace_adiantum_support"
* changes:
  cryptfs: Allow setting dm-crypt sector size
  cryptfs: Add Adiantum support
2018-12-12 04:59:25 +00:00
Greg Kaiser
ab1e84ad5f cryptfs: Allow setting dm-crypt sector size
We add the property ro.crypto.fde_sector_size to allow devices
to pass the "sector_size:<size>" argument to dm-crypt in the kernel.
We also pass "iv_large_sectors" when setting the sector size.

Using 4096-byte sectors rather than the default of 512 improves
dm-crypt performance, especially when the Adiantum encryption mode
is used.

Bug: 112010205
Test: Run on a device
Change-Id: I144ec7088a0aad3430369dc7158370d7ff3ef5d2
2018-12-11 17:22:00 -08:00
Greg Kaiser
8cb4c9ff78 cryptfs: Add Adiantum support
Adiantum is a crypto method Android is supporting for devices
which don't have AES CPU instructions.  See the paper
"Adiantum: length-preserving encryption for entry-level processors"
(https://eprint.iacr.org/2018/720.pdf) for more details.

We add Adiantum to our list of supported crypto types.

Bug: 112010205
Test: Tested on a device
Change-Id: Ic190a9b90fc8bc077fdc7d60c9d5ae8d8f555025
2018-12-11 15:41:17 -08:00
Xin Li
d65cca3e80 [automerger skipped] Merge "DO NOT MERGE" am: 595172d1e6 -s ours am: b009701f6d -s ours
am: 0766daab48  -s ours

Change-Id: I1942f97ec9856eb7d513cd178dacb919112fd064
2018-12-10 12:59:26 -08:00
Xin Li
0766daab48 [automerger skipped] Merge "DO NOT MERGE" am: 595172d1e6 -s ours
am: b009701f6d  -s ours

Change-Id: Icf28433950eef5adccd577128b5235b4e66f361b
2018-12-10 11:19:55 -08:00
Xin Li
b009701f6d [automerger skipped] Merge "DO NOT MERGE"
am: 595172d1e6  -s ours

Change-Id: Id06f53d3a5fdbb4924a9db2c21168b50af6ad42e
2018-12-10 10:18:24 -08:00
Treehugger Robot
595172d1e6 Merge "DO NOT MERGE" 2018-12-10 17:20:41 +00:00
Paul Crowley
042dfdde7b Merge "Check for errors in dup2" am: b1166633b6 am: 1d5d475b51
am: 7748fcf911

Change-Id: Idfb0af866594647a43832d1cbc1b7a597f139144
2018-12-07 18:27:40 -08:00
Paul Crowley
7748fcf911 Merge "Check for errors in dup2" am: b1166633b6
am: 1d5d475b51

Change-Id: I3ec9c4291cad322921a51d34a8ced176abf43de0
2018-12-07 18:23:39 -08:00
Paul Crowley
1d5d475b51 Merge "Check for errors in dup2"
am: b1166633b6

Change-Id: I1b0144fbf19892012baebe08bbaab9f7e77bf71e
2018-12-07 18:15:37 -08:00
Treehugger Robot
b1166633b6 Merge "Check for errors in dup2" 2018-12-08 02:03:37 +00:00
Xin Li
e6ba0cc34a DO NOT MERGE
Merge pie-platform-release (PPRL.181205.001, history only) into master

Bug: 120502534
Change-Id: I087ef5ac78dc1c42448b7c8d50864a412afd3154
2018-12-07 16:14:54 -08:00
Paul Crowley
be857bfd9b Check for errors in dup2
Bug: 26735063
Test: adb shell sm partition disk:7,3 private && adb logcat -d
Change-Id: I3aa8d1f6183dd5e77f54f422482a54ea8197d768
2018-12-07 12:23:25 -08:00
Rubin Xu
62ab2fb831 Merge "Fix signedness mismatch and integer underflow" am: b46a2f7dea am: f0c4361770
am: 938acebc8b

Change-Id: I2eeef5a9648952c8ea0bcb63a7625c4bbcf06422
2018-12-07 03:42:56 -08:00
Rubin Xu
938acebc8b Merge "Fix signedness mismatch and integer underflow" am: b46a2f7dea
am: f0c4361770

Change-Id: I26e7851dfaa09f2efa2ec9a5fcef651367b074ef
2018-12-07 03:33:35 -08:00
Rubin Xu
f0c4361770 Merge "Fix signedness mismatch and integer underflow"
am: b46a2f7dea

Change-Id: Ie2fcbf4af0ae882d67e7ecdbaf7db56b68eabf36
2018-12-07 03:23:23 -08:00
Treehugger Robot
b46a2f7dea Merge "Fix signedness mismatch and integer underflow" 2018-12-07 11:05:17 +00:00
Paul Crowley
c2fc472c7c Merge "Do lazy-unmount to /storage directly" am: 53b0d95903 am: fbc24b5c8f
am: 0bafc3b2c5

Change-Id: Icffe008b85b59357a743cd19f28fe5bb97722895
2018-12-06 23:20:20 -08:00
Paul Crowley
0bafc3b2c5 Merge "Do lazy-unmount to /storage directly" am: 53b0d95903
am: fbc24b5c8f

Change-Id: Id4240e77ce682af6194529d65e47305693ae6cf1
2018-12-06 23:10:43 -08:00
Paul Crowley
fbc24b5c8f Merge "Do lazy-unmount to /storage directly"
am: 53b0d95903

Change-Id: Id43d707386950c50d6dc1e01970223cd2e5b0763
2018-12-06 22:58:59 -08:00
Paul Crowley
53b0d95903 Merge "Do lazy-unmount to /storage directly" 2018-12-07 06:35:48 +00:00
Paul Crowley
613cbae6ca Merge "Clean up use of pipe" am: a33b765ca0 am: 1ca8af7bad
am: 99eb646b36

Change-Id: If084318f245412aa617aec2503308aa3b590eacb
2018-12-06 17:29:31 -08:00
Paul Crowley
99eb646b36 Merge "Clean up use of pipe" am: a33b765ca0
am: 1ca8af7bad

Change-Id: I24f4e15728a0b9127753d544b8df5d3aecd8a9f5
2018-12-06 17:17:32 -08:00
Paul Crowley
1ca8af7bad Merge "Clean up use of pipe"
am: a33b765ca0

Change-Id: Icb2e0ab5e86e00b0d975549e6cf851b84d7d99eb
2018-12-06 16:50:25 -08:00
Treehugger Robot
a33b765ca0 Merge "Clean up use of pipe" 2018-12-07 00:10:45 +00:00
LongPing.WEI
4df104f335 Do lazy-unmount to /storage directly
From man 2 umount:
MNT_DETACH (since Linux 2.4.11)

Perform a lazy unmount: make the mount point unavailable for new
accesses, immediately disconnect the filesystem and all filesystems
mounted below it from each other and from the mount table, and
actually perform the unmount when the mount point ceases to be busy.

So we don't need to unmount the filesystems under it one by one.

Bug: 113796163
Test: atest android.appsecurity.cts.PermissionsHostTest#testInteractiveGrant23
Change-Id: I6a0422466a9865ff6d17122505ca73d041de9d54
2018-12-06 15:56:05 -08:00
Rubin Xu
f83cc61c1f Fix signedness mismatch and integer underflow
persist_get_max_entries() is supposed to return an unsigned integer as the
maximum number of entries but it also wrongly returns "-1" as an error
condition. Also fix an issue where an unsigned subtraction in this routine
could lead to integer underflow.

Bug: 112731440
Test: manual
Change-Id: I9672e39bef2c12156dda7806a08c52044962c178
2018-12-06 14:17:48 -08:00
Paul Crowley
e6d7663889 Clean up use of pipe
Don't duplicate what's already in unique_fd.h
Also, code that tries to handle weird stdout condition won't work
because of cloexec; just don't try that.

My tests:
- Ensure Marlin device boots and vold_prepare_subdirs is called
successfully
- Try adb shell sm set-virtual-disk true, see that eg sgdisk output is
logged.

Bug: 26735063
Bug: 113796163
Test: details in commit
Change-Id: I5698ba0b4c8bd692a740a1bd445e677ad4815d11
2018-12-06 14:02:30 -08:00
Paul Crowley
4ba32a0e3c Merge "Refactor ForkExecvp to improve locking behaviour" am: 6aaedb0dca am: 12d8d6343b
am: 1369936cb4

Change-Id: If1bb4a4bc0670346caf1d3909062ab70b3afe521
2018-12-06 13:34:14 -08:00
Paul Crowley
1369936cb4 Merge "Refactor ForkExecvp to improve locking behaviour" am: 6aaedb0dca
am: 12d8d6343b

Change-Id: If3a108dc16b0aaa53803ae9f9f5d880c78f66b5e
2018-12-06 13:24:49 -08:00
Paul Crowley
12d8d6343b Merge "Refactor ForkExecvp to improve locking behaviour"
am: 6aaedb0dca

Change-Id: I571a44a1b068be0acd9e39c974b67d865f851e66
2018-12-06 13:14:48 -08:00
Paul Crowley
6aaedb0dca Merge "Refactor ForkExecvp to improve locking behaviour" 2018-12-06 20:03:31 +00:00
Paul Crowley
de2d6201ab Refactor ForkExecvp to improve locking behaviour
Do our own fork/exec rather than using a library. This leads to
many improvements:

- unite the output recording path with the other path
- never concatenate arguments with spaces
- never use the shell
- move setexeccon after fork, so we don't need to take the lock
- general code refactor while we're there

My tests:
- Ensure Marlin device boots and vold_prepare_subdirs is called
successfully
- Try adb shell sm set-virtual-disk true, see that eg sgdisk output is
logged.

weilongping@huawei.com's tests:
- unlock a user's de and ce directory;
- connect to a OTG storage device or a sdcard and ensure the mount logic be successful

Bug: 26735063
Bug: 113796163
Test: details in commit
Change-Id: I0976413529d7cbeebf5b8649660a385f9b036f04
2018-12-06 09:37:02 -08:00
Xin Li
47f6902ba7 Merge "Merge pie-platform-release (PPRL.181105.017, history only) into master" am: 80647cf607 am: 4f75fa7703
am: 82a684ec15

Change-Id: I2b6235afa62e52c94e90bb8ed44ba434b80d2516
2018-12-04 14:56:40 -08:00
Xin Li
82a684ec15 Merge "Merge pie-platform-release (PPRL.181105.017, history only) into master" am: 80647cf607
am: 4f75fa7703

Change-Id: I74d82c89ec212ccae1b66ec4063bf303870ea109
2018-12-04 14:47:32 -08:00
Xin Li
4f75fa7703 Merge "Merge pie-platform-release (PPRL.181105.017, history only) into master"
am: 80647cf607

Change-Id: I8adf4be9efcdadb5e629abad21227078f5968109
2018-12-04 14:33:42 -08:00
Xin Li
80647cf607 Merge "Merge pie-platform-release (PPRL.181105.017, history only) into master" 2018-12-04 22:09:27 +00:00
Bill Rassieur
d9aa87ecee Merge PQ1A.181205.006 from Pi-QPR1-Release into ToT for Pi-Platform release.\n\nBUG: 120448245
Change-Id: I65b3aa4e1ad1d95464f0b4cd1af211be4fb1ddbc
2018-12-04 17:00:13 +00:00
Andrey Kulikov
c69b2e388d Merge "Remove dependency on libparcelfiledescriptor" am: cac8b13023 am: 1a5e1ddadc
am: 066328b05b

Change-Id: I1c2c6f40b9bf0c05f3640538ed58f4a5f9c0e5c3
2018-12-04 05:22:30 -08:00
Andrey Kulikov
066328b05b Merge "Remove dependency on libparcelfiledescriptor" am: cac8b13023
am: 1a5e1ddadc

Change-Id: Ibc4b4994c14b47decea5e74267e276080498901e
2018-12-04 05:08:25 -08:00
Andrey Kulikov
1a5e1ddadc Merge "Remove dependency on libparcelfiledescriptor"
am: cac8b13023

Change-Id: I35c751c8ecd2188711fd578de7a1367c1f7945b8
2018-12-04 04:54:53 -08:00