Commit graph

68635 commits

Author SHA1 Message Date
Treehugger Robot
a8b2ac4b30 Merge "Populate ro.boot.debug.sf.nobootanimation from android.bootanim" 2021-04-08 17:42:18 +00:00
Steven Moreland
dc43fb279f libutils: wp::fromExisting bugfix
This API was tested before, but it wasn't used until it is needed in
libbinder. Previously it passed the tests because wp::operator==
compares weak_ptrs which are never deleted, but it doesn't check the
value of m_ptr as well. This assumes that the RefBase implementation is
self-consistent.

Future considerations:
- add additional CHECK (perf?)
- add an additional optional CHECK?
- update all refbase tests to use an embellished form of this operator

Bug: 184190315
Test: libutils_test, boot and kill process when libbinder is using this
API

Change-Id: I66c97386d769529d5efae48e06775d4b4a344025
2021-04-07 23:06:09 +00:00
Roman Kiryanov
0312c20a71 Populate ro.boot.dalvik.vm.checkjni from android.checkjni
emulator passes `android.checkjni` in the kernel
command which we want to use in
frameworks/base/core/jni/AndroidRuntime.cpp

Bug: 182291166
Test: getprop ro.boot.dalvik.vm.checkjni
Signed-off-by: Roman Kiryanov <rkir@google.com>
Change-Id: If9473aa9492fa09d8de7cc8fb08614380e4e15f3
2021-04-07 15:55:21 -07:00
Elliott Hughes
016beb8559 Remove String16::makeLower().
If you need to do a case transformation for a Unicode string, you need
to use icu4c. This only worked for ASCII, which is just silly. Luckily
it doesn't seem to be used anywhere.

Test: treehugger
Change-Id: I4a864823ec35a0b57b50909587cc3efac3f531a7
Merged-In: I4a864823ec35a0b57b50909587cc3efac3f531a7
2021-04-07 22:38:20 +00:00
Steven Moreland
1d68548823 libutils: add sp::cast method
Previously, sp::sp(T*) internally had a static cast, and people
frequently wrote code like this:

    sp<A> a = ...;
    sp<B> b(a.get()); // implicit static cast

Luckily, none of the other sp constructors have this implicit cast. So,
for explicit code, rather than making those use static_cast internally,
adding an sp::cast function.

Bug: 184190315
Test: use in libbinder
Change-Id: Id205c88d03e16cf85ccb8f493ce88b4bbc65a688
2021-04-07 20:30:21 +00:00
Yo Chiang
b20e9a3606 Merge "fs_mgr: SkipMountingPartitions() support glob patterns" 2021-04-07 05:04:21 +00:00
Treehugger Robot
02c97e837d Merge "[LSC] Add LOCAL_LICENSE_KINDS to system/core" 2021-04-07 03:46:57 +00:00
Roman Kiryanov
c755e5edf9 Populate ro.boot.debug.sf.nobootanimation from android.bootanim
emulator passes `android.bootanim=0` in the kernel
command line to disable boot animation.

Bug: 182336906
Test: boot emulator with -np-boot-anim
Signed-off-by: Roman Kiryanov <rkir@google.com>
Change-Id: Id89a6c92dd4724cac414ffbf8ee731b2bfcc7195
2021-04-06 20:44:57 -07:00
Bob Badour
8c2fe15b47 [LSC] Add LOCAL_LICENSE_KINDS to system/core
Added SPDX-license-identifier-Apache-2.0 to:
  libstats/pull_rust/Android.bp

Bug: 68860345
Bug: 151177513
Bug: 151953481

Test: m all

Exempt-From-Owner-Approval: janitorial work
Change-Id: I362f72ab99850558ddc7b50108c1ec6a212cb258
2021-04-06 17:46:33 -07:00
Treehugger Robot
0cf8af6860 Merge "ueventd: Fix wrong argument index in devpath comparison" 2021-04-06 23:10:05 +00:00
Andrew Chant
d64b988959 fastboot: use --force to bypass requirements
Allow using --force to bypass flashing requirements
from android-info.txt.

We often provide builds to deviceholders who don't have
an exact matching bootloader or radio image and it is
unimportant.  Having the option to override is useful.

This shouldn't affect bootloader.img so should never
prevent a device from returning to fastboot in case of
gross error.

Test: Downloaded a build w/ different radio.

Got the following output:

...
Checking 'version-baseband'                        FAILED

Device version-baseband is 'xyz'.
Update requires 'abc' or '123'.

requirements not met! but proceeding due to --force
Setting current slot to 'a'                        OKAY [  0.065s]

Bug: 184661990
Change-Id: I8680b8275b854304026cff3b2e663b7ef2594383
2021-04-06 15:28:41 -07:00
David Anderson
0da1d617d2 Merge changes from topic "revert-1660531-max-boot-level-crypto-KFMCEDKSIV"
* changes:
  Revert "Expose AID_KEYSTORE"
  Revert "Set earlyBootEnded before apex starts"
2021-04-06 21:54:44 +00:00
Kelvin Zhang
7006048957 Add MockSnapshotMergeStats
Test: th
Change-Id: If4f43e132e9c482418d6a0adbd98ffca9576b39b
2021-04-06 15:47:43 -04:00
Akilesh Kailash
591edca44d Merge "libsnapshot:snapuserd: Terminate daemon after applying OTA." 2021-04-06 18:02:52 +00:00
Ulyana Trafimovich
a801eabe11 Revert "Expose AID_KEYSTORE"
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: Id02f63a794544d650abb95c8e7f201eea03391eb
Test: forrest run for the broken test
2021-04-06 16:07:07 +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
Martin Stjernholm
0648856a1f libdexfile_external is replaced by libdexfile (reland).
This relands https://r.android.com/1644045 after fixing the build issue
in b/184239856.

Test: atest CtsSimpleperfTestCases
Bug: 143978909
Change-Id: I4315189b243503f5633f64d46a0ffedad3bebf0c
2021-04-06 14:01:44 +01: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
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
Suchang Woo
8681f7e7a3 ueventd: Fix wrong argument index in devpath comparison
args[2](user name to run as) is used instead of args[1](devpath).

Test: atest CtsInitTestCases
Signed-off-by: Suchang Woo <suchang.woo@samsung.com>
Change-Id: Id271755993d55e332bad54d0414e2232071e5e8e
2021-04-06 11:15:28 +09:00
Chris Wailes
9fd4627645 Added ARTD user
Test: boot and check for artd process
Bug: 177273468
Change-Id: Ic5a3f626598d5347dfada8f67c07c55c7da29f5f
2021-04-05 15:46:14 -07: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
99037347d6 Merge "ANDROID_UTILS_REF_BASE_DISABLE_IMPLICIT_CONSTRUCTION" 2021-04-05 20:00:39 +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
Hridya Valsaraju
6b7311fc99 Use property ro.product.enforce_debugfs_restrictions to enable debugfs
restrictions

Use the property ro.product.enforce_debugfs_restrictions to enable
debugfs restrictions instead of checking the launch API level. Vendors
can enable build-time as well as run-time debugfs restrictions by
setting the build flag PRODUCT_SET_DEBUGFS_RESTRICTIONS true which in
turn sets ro.product.enforce_debugfs_restrictions true as well enables
sepolicy neverallow restrictions that prevent debugfs access. The
intention of the build flag is to prevent debugfs dependencies from
creeping in during development on userdebug/eng builds.

Test: build and boot
Bug: 184381659
Change-Id: If555037f973e6e4f35eb7312637f58e8360c3013
2021-04-02 17:00:50 -07: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
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
Yi-Yo Chiang
2f2fe4afaf fs_mgr: SkipMountingPartitions() support glob patterns
Enhance skip_mount.cfg to be able to specify glob patterns.

Bug: 184132970
Test: GSI Boot test
Change-Id: I8e6528e4aff6ea176aa028c3c55d6cedaff3e181
2021-04-02 05:23:44 +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
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
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
3080a06431 Merge "libdexfile_external is being replaced by libdexfile." 2021-04-01 06:53:13 +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
007d7941c8 Merge "debuggerd: store commandline instead of process name." 2021-03-31 08:29:54 +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