Commit graph

68613 commits

Author SHA1 Message Date
Ulyana Trafimovich
6e6e200706 Revert "Set earlyBootEnded before apex starts" am: 82cfe66794
Original change: https://android-review.googlesource.com/c/platform/system/core/+/1665500

Change-Id: I5a5cb6e6d073ddbf5daad345003d885dc7232671
2021-04-06 22:35:37 +00:00
Akilesh Kailash
e6ef7f8db8 Merge "libsnapshot:snapuserd: Terminate daemon after applying OTA." am: 591edca44d
Original change: https://android-review.googlesource.com/c/platform/system/core/+/1663841

Change-Id: I959ca9db5f20a9af47934db18ac21618f6ce9bf1
2021-04-06 18:43:51 +00:00
Akilesh Kailash
591edca44d Merge "libsnapshot:snapuserd: Terminate daemon after applying OTA." 2021-04-06 18:02:52 +00:00
Ulyana Trafimovich
82cfe66794 Revert "Set earlyBootEnded before apex starts"
Revert "Cryptographic security for MAX_BOOT_LEVEL"

Revert submission 1660531-max-boot-level-crypto

Reason for revert: broken test com.android.tests.odsign.OnDeviceSigningHostTest#verifyArtUpgradeSignsFiles on aosp-master on aosp_cf_x86_64_phone-userdebug at 7261517

Reverted Changes:
Ia3b968afc:Set earlyBootEnded before apex starts
Ia69891291:Expose AID_KEYSTORE
I12530cd13:Cryptographic security for MAX_BOOT_LEVEL

Bug: 184635938
Change-Id: Ibf63734a02a2c132142671c0fae5d0177bf46079
Test: forrest run for the broken test
2021-04-06 16:07:07 +00:00
Paul Crowley
e5c1b5691c Merge changes from topic "max-boot-level-crypto" am: de2769dc1e
Original change: https://android-review.googlesource.com/c/platform/system/core/+/1664099

Change-Id: I6664936eef2074623da530333ee903611164344d
2021-04-06 11:43:56 +00:00
Paul Crowley
4adc0fac1a Expose AID_KEYSTORE am: 8306ab68f7
Original change: https://android-review.googlesource.com/c/platform/system/core/+/1663719

Change-Id: Iffd046482da8f773efa53d396530fc3f6321c057
2021-04-06 11:43:43 +00:00
Paul Crowley
de2769dc1e Merge changes from topic "max-boot-level-crypto"
* changes:
  Set earlyBootEnded before apex starts
  Expose AID_KEYSTORE
2021-04-06 11:15:29 +00:00
Paul Crowley
02e0ddcaf9 Set earlyBootEnded before apex starts
earlyBootEnded signals to keystore2 to read the database for the first
time, and start the MAX_BOOT_LEVEL system. It must therefore run
after /data is mounted and /data/misc/keystore is created, but before
apexd or odsign starts.

Bug: 176450483
Test: cuttlefish: check keystore2 logs to ensure all looks well.
Change-Id: Ia3b968afc38edf95712480e99e545ba88ea309c3
2021-04-05 21:40:36 -07:00
Yo Chiang
127e1bee5f Merge changes from topic "ReadDefaultFstab_requires_sepolicies" am: aeb962f09a
Original change: https://android-review.googlesource.com/c/platform/system/core/+/1657801

Change-Id: I6ebdb5602f3c6e824822a1766522d66876c0f57a
2021-04-06 04:20:30 +00:00
Yi-Yo Chiang
71fbb66b2a fs_mgr: Strengthen ReadFstabFromFile() around gsi_public_metadata_file am: ea4369d141
Original change: https://android-review.googlesource.com/c/platform/system/core/+/1647010

Change-Id: I2d1c8037c6066902ae61d417ee4e4004eba03be5
2021-04-06 04:20:12 +00:00
Yo Chiang
aeb962f09a Merge changes from topic "ReadDefaultFstab_requires_sepolicies"
* changes:
  fs_mgr: Refactor ReadDefaultFstab() and ReadFstabFromFile()
  fs_mgr: Strengthen ReadFstabFromFile() around gsi_public_metadata_file
2021-04-06 03:37:58 +00:00
Akilesh Kailash
e2883c1ea0 libsnapshot:snapuserd: Terminate daemon after applying OTA.
When all threads are terminated, dm-user handler's are removed
from the list. When the last handler is removed, daemon is
shutdown gracefully.

Bug: 183652708
Test: 1: Apply full OTA and verify daemon is terminated; reapply the OTA
      to verify daemon is restarted again.
      2:  vts_libsnapshot_test

Signed-off-by: Akilesh Kailash <akailash@google.com>
Change-Id: Ibd41223fc0eba884993a533fcc95661f72805db2
2021-04-05 21:50:46 +00:00
Steven Moreland
d8c4c860ef Merge "ANDROID_UTILS_REF_BASE_DISABLE_IMPLICIT_CONSTRUCTION" am: 99037347d6
Original change: https://android-review.googlesource.com/c/platform/system/core/+/1660499

Change-Id: I8551b54d9b7384076d63cb5ec8fa5300f3a47267
2021-04-05 20:26:46 +00:00
Steven Moreland
99037347d6 Merge "ANDROID_UTILS_REF_BASE_DISABLE_IMPLICIT_CONSTRUCTION" 2021-04-05 20:00:39 +00:00
Joel Galenson
5b2b727eb9 Merge "Add Rust interface for the pull API." am: 177f93f9cb
Original change: https://android-review.googlesource.com/c/platform/system/core/+/1658885

Change-Id: I5e31c0ffe099ec775be63ce6f7166f2ee74ddf4e
2021-04-05 19:22:15 +00:00
Joel Galenson
177f93f9cb Merge "Add Rust interface for the pull API." 2021-04-05 18:50:47 +00:00
Steven Moreland
da75cef983 ANDROID_UTILS_REF_BASE_DISABLE_IMPLICIT_CONSTRUCTION
In form, inspired by ANDROID_BASE_UNIQUE_FD_DISABLE_IMPLICIT_CONVERSION.

We get occasional bugs about sp double-ownership. When this flag is
enabled, we have:
- you must construct RefBase objects using sp<>::make
- you must construct wp<> objects by converting them to sp<>
- if you want to convert a raw pointer to an sp<> object (this is
  possible since the refcount is used internally, and is used commonly
  on this*), then you must use 'assertStrongRefExists' semantics which
  aborts if there is no strong ref held. That is, if a client uses
  std::make_shared and then calls a function which internally used to
  call `sp<T>(this)`, you would now call
  `sp<T>::assertStrongRefExists(this)`, and the double ownership
  problem would become a runtime error.

Bug: 184190315
Test: libutils_test
Change-Id: Ie18d3146420df1808e3733027070ec234dda4e9d
2021-04-05 17:45:18 +00:00
Paul Crowley
8306ab68f7 Expose AID_KEYSTORE
Keystore uses this as the user ID for keys that it creates for its
own use.

Bug: 176450483
Test: keystore2_test
Change-Id: Ia698912917cd209eebcfc007a8badce7a39159d6
2021-04-03 08:38:41 -07:00
Steven Moreland
fb91070a83 Merge "libutils: better docs for sp<>::make" am: 767f264fa4
Original change: https://android-review.googlesource.com/c/platform/system/core/+/1663182

Change-Id: Ibb44ea12326866e455f7efc1541197fb04b77874
2021-04-02 21:51:28 +00:00
Steven Moreland
767f264fa4 Merge "libutils: better docs for sp<>::make" 2021-04-02 21:16:52 +00:00
Steven Moreland
09b0495b47 libutils: better docs for sp<>::make
Bug: 184190315
Test: N/A
Change-Id: I56621058b9d85122b7dca3727e40c8c85595031f
2021-04-02 17:26:16 +00:00
Yo Chiang
14d8badf58 Merge "fs_mgr: Suppress SkipMountingPartitions log in ReadFstabFromFile" am: a2b662cf23
Original change: https://android-review.googlesource.com/c/platform/system/core/+/1662019

Change-Id: If9f26afce00a670ddae8ebe950f42c2ca5b33e54
2021-04-02 05:48:30 +00:00
Akilesh Kailash
1e88568d40 Merge "libsnapshot:snapuserd: Fix memory leak" am: ef8d3c39b5
Original change: https://android-review.googlesource.com/c/platform/system/core/+/1662684

Change-Id: Ic8b4f2221f14f40bed88d0957b6700caef89db36
2021-04-02 05:48:05 +00:00
Yi-Yo Chiang
1a3c050a35 fs_mgr: Refactor ReadDefaultFstab() and ReadFstabFromFile()
* Eliminate redundant std::move() by transforming
    ReadFstabFromDt(&dt_fstab, false);
    *fstab = std::move(dt_fstab);
  to
    fstab->clear();
    ReadFstabFromDt(fstab, false);

* Don't modify output parameter if ReadFstabFromFile() failed.

Bug: 181110285
Test: Presubmit
Change-Id: I4e4d9852cc618a66d79e423780bf97773dca2a58
2021-04-02 05:26:01 +00:00
Yi-Yo Chiang
ea4369d141 fs_mgr: Strengthen ReadFstabFromFile() around gsi_public_metadata_file
ReadFstabFromFile() calls access() to check the existence of DSU
metadata files to determine if device is in DSU running state. This is
error prone because a failed access() can mean non-exsitent file as well
as the caller lacking the permission to path resolute the pathname.

Strengthen ReadFstabFromFile() to check the errno after a failed
access() or open(), if the errno is not ENOENT, then return with error,
as this may be indicating the caller doesn't have sufficient access
rights to call ReadFstabFromFile().

After this change, processes would need these policies to call
ReadFstabFromFile():
  allow scontext { metadata_file gsi_metadata_file_type }:dir search;
And these policies to call ReadFstabFromFile() within a DSU system:
  allow scontext gsi_public_metadata_file:file r_file_perms;

Bug: 181110285
Test: Presubmit
Change-Id: I1a6a796cb9b7b49af3aa5e7a5e8d99cde25e5857
2021-04-02 05:25:46 +00:00
Yo Chiang
a2b662cf23 Merge "fs_mgr: Suppress SkipMountingPartitions log in ReadFstabFromFile" 2021-04-02 05:23:16 +00:00
Yi-Yo Chiang
20579011cf fs_mgr: Suppress SkipMountingPartitions log in ReadFstabFromFile
Minor refactoring and renaming, goal is to make the follow-up patch
easier to read.

Bug: 184132970
Test: Presubmit
Change-Id: I66416161b30ac310934d901cbaf11bc926e2cbf7
2021-04-02 05:23:02 +00:00
Akilesh Kailash
ef8d3c39b5 Merge "libsnapshot:snapuserd: Fix memory leak" 2021-04-02 05:13:11 +00:00
Akilesh Kailash
e722a1b169 libsnapshot:snapuserd: Fix memory leak
When worker threads were created, snapuserd was converted to a
shared_pointer. Earlier, memory was forcefully released
by setting snapuserd to nullptr which worked as it
was a unique pointer. Now, every worker thread holds
a reference. Clear the vector once all the worker
threads are terminated.

Test: Apply OTA and verify memory is released after OTA is applied
Bug: 183652708
Signed-off-by: Akilesh Kailash <akailash@google.com>
Change-Id: I256d26d98b02ad599aff49b92192226546c59b17
2021-04-02 00:49:18 +00:00
Treehugger Robot
07d6796b6f Merge "Populate all other emulator properties as ro.boot.qemu.*" am: 6463f60a56
Original change: https://android-review.googlesource.com/c/platform/system/core/+/1661935

Change-Id: I5f681da5562f9922ec5e1a57f3ec18f969135df9
2021-04-01 23:12:01 +00:00
Treehugger Robot
45e9ced9d3 Merge changes I5989f49c,I394b5aa9 am: 71a220901a
Original change: https://android-review.googlesource.com/c/platform/system/core/+/1662679

Change-Id: I5bee72b2785c806b962db08e0e2bdcd9cda9e78f
2021-04-01 22:59:18 +00:00
Treehugger Robot
6463f60a56 Merge "Populate all other emulator properties as ro.boot.qemu.*" 2021-04-01 22:39:55 +00:00
Treehugger Robot
71a220901a Merge changes I5989f49c,I394b5aa9
* changes:
  Update owners for modprobe.c
  libmodprobe: refactor blocklist functionality
2021-04-01 22:34:27 +00:00
Will McVicker
ff825b29b1 Update owners for modprobe.c
Test: treehugger
Change-Id: I5989f49c284b4f06a24b6350a531902832e2eef5
2021-04-01 12:42:21 -07:00
Roman Kiryanov
bcc7946ef0 Populate all other emulator properties as ro.boot.qemu.*
Bug: 182291166
Test: getprop | grep "ro\.boot\.qemu\."
Signed-off-by: Roman Kiryanov <rkir@google.com>
Change-Id: I0d2a4a9edd87999b35fac8496e9cda93fc7d0cf1
2021-04-01 11:39:30 -07:00
Nikita Ioffe
7aaed1de1a Merge "Revert "libdexfile_external is being replaced by libdexfile."" am: 89e50ee521
Original change: https://android-review.googlesource.com/c/platform/system/core/+/1660249

Change-Id: Ia0cbcdbe0b07a144607a35b983a0b6f0e5c91955
2021-04-01 15:03:24 +00:00
Nikita Ioffe
89e50ee521 Merge "Revert "libdexfile_external is being replaced by libdexfile."" 2021-04-01 14:22:53 +00:00
Nikita Ioffe
698370e933 Revert "libdexfile_external is being replaced by libdexfile."
Revert "Merge libdexfile_external into libdexfile."

Revert "libdexfile_external is replaced by libdexfile."

Revert "Rename libdexfile_external_static to libdexfile_static."

Revert "Rename libdexfile_external_static to libdexfile_static."

Revert "Allow dependencies from platform variants to APEX modules."

Revert submission 1658000

Reason for revert: Breaks full-eng build: b/184239856
Reverted Changes:
I4f8ead785:Avoid internal APEX stubs for libsigchain and clea...
I68affdf69:Allow dependencies from platform variants to APEX ...
I54b33784e:Rename libdexfile_external_static to libdexfile_st...
Id68ae9438:libdexfile_external is being replaced by libdexfil...
I12ac84eb4:libdexfile_external is replaced by libdexfile.
If05dbffc8:Rename libdexfile_external_static to libdexfile_st...
Ia011fa3a8:Merge libdexfile_external into libdexfile.

Change-Id: I2448810c9a863cde32b6ed98d9ed0a99cf260d34
2021-04-01 10:58:24 +00:00
Martin Stjernholm
dcd76b6d7e Merge "libdexfile_external is being replaced by libdexfile." am: 3080a06431
Original change: https://android-review.googlesource.com/c/platform/system/core/+/1644045

Change-Id: I626de68c88966609dbf1368d9a68e815f8e16fc3
2021-04-01 07:37:21 +00:00
Martin Stjernholm
3080a06431 Merge "libdexfile_external is being replaced by libdexfile." 2021-04-01 06:53:13 +00:00
Treehugger Robot
e23f80b7de Merge "trusty: apploader: Log errors to logcat" am: 817f8971ac
Original change: https://android-review.googlesource.com/c/platform/system/core/+/1660506

Change-Id: Id9030cd0a516505b2830a5abe470ff7e28d917cd
2021-04-01 06:12:23 +00:00
Treehugger Robot
817f8971ac Merge "trusty: apploader: Log errors to logcat" 2021-04-01 05:30:25 +00:00
Joel Galenson
559379ea58 Add Rust interface for the pull API.
Test: Manually run statsd_testdrive
Change-Id: Ib2e99ddbd60d054189caac712e0ae5438045f0bc
2021-03-31 14:41:24 -07:00
Tri Vo
413ab28953 trusty: apploader: Log errors to logcat
Otherwise, these error logs don't end up in bugreports, making it very
difficult to debug.

When using locally, users will have to check logcat instead of stderr.

Bug: 183919392
Bug: 115420908
Test: m
Change-Id: I3b829347971d05968b851e11ce784829d12ef098
2021-03-31 13:27:57 -07:00
Will McVicker
87b2ef0edf libmodprobe: refactor blocklist functionality
Remove the function EnableBlocklist() and add a constructor argument to
enable/disable the use of modules.blocklist. In all cases, the
enabling/disabling of the blocklist happens immediately after creating
the Modprobe object. So this simplies libmodprobe.

Additionally, the use of the blocklist by libmodprobe should be enabled
by default unless explicitly disabled during creation of the Modprobe
object. Currently, only modprobe(8) defaults to not using the blocklist
and includes the argument -b BLOCKLIST for enabling it. That
functionality remains.

This refactor allows us to use the blocklist during first stage init.
However, additional logic is needed to not return an error for the
blocked non-aliased modules during first stage init; otherwise, the
error would result in an init crash leading to a device reboot. So fixup
LoadListedModules() to allow blocking modules without returning an
error.

Bug: 182582036
Test: boot test on pixel 5 with a module in modules.blocklist
Change-Id: I394b5aa98fa98821011982cfe693749010c381f7
2021-03-31 09:34:47 -07:00
Josh Gao
f0b017f03c Merge "debuggerd: store commandline instead of process name." am: 007d7941c8
Original change: https://android-review.googlesource.com/c/platform/system/core/+/1634599

Change-Id: Ia99ba73c4829840f988ffda1068636135c8e8cdc
2021-03-31 09:20:06 +00:00
Josh Gao
007d7941c8 Merge "debuggerd: store commandline instead of process name." 2021-03-31 08:29:54 +00:00
Treehugger Robot
f294b51140 Merge "Copy vendor.sys.usb.adb.enabled to sys.usb.adb.enabled." am: 911850ecc3
Original change: https://android-review.googlesource.com/c/platform/system/core/+/1649750

Change-Id: Id93bff7e02fd479dc1d56fa9684b28e4d128d01f
2021-03-31 00:34:32 +00:00
Treehugger Robot
911850ecc3 Merge "Copy vendor.sys.usb.adb.enabled to sys.usb.adb.enabled." 2021-03-31 00:06:44 +00:00
David Anderson
2365c0d9bc Merge "libsnapshot: Ensure we can remove bad snapshots when beginning an update." am: 7ab8f2eeba
Original change: https://android-review.googlesource.com/c/platform/system/core/+/1650826

Change-Id: Iae132ec4e2af2a759c9adc475e864efb344b3be6
2021-03-30 19:28:36 +00:00