Commit graph

71796 commits

Author SHA1 Message Date
Inseob Kim
7418252a4e Completely migrate init first stage to Soong
adb_debug.prop is migrated too. And ramdisk_available is added to all
dependencies.

Bug: 187196593
Test: boot
Change-Id: I59cd149e0021211b8fd59c44b93bbf18dc8637bf
Merged-In: I59cd149e0021211b8fd59c44b93bbf18dc8637bf
2021-06-23 04:26:12 +00:00
TreeHugger Robot
028303d523 Merge "Isolate app profile ref data" into sc-dev 2021-06-22 16:22:45 +00:00
Shawn Willden
2a3c9238fe Merge "Revert^2 "Activate KeyMint."" into sc-dev 2021-06-21 23:12:32 +00:00
Shawn Willden
5dfd44ed5c Revert^2 "Activate KeyMint."
81cdd3f3da

Bug: 177729159
Test: VtsAidlKeyMintTargetTest & CtsKeystoreTestCases
Change-Id: I85d9e57fe83627992ddaa705946893a4b9890001
2021-06-21 19:44:02 +00:00
TreeHugger Robot
c01255b092 Merge "Revert "Activate KeyMint."" into sc-dev 2021-06-21 17:49:42 +00:00
Ioannis Ilkos
81cdd3f3da Revert "Activate KeyMint."
Revert "Activate KeyMint"

Revert submission 14947110-activate_keymint

Reason for revert: Likely b/191652216
Reverted Changes:
I6c5210356:Activate KeyMint
I784d39383:Activate KeyMint.

Bug: b/191652216
Change-Id: I7028a6aedc6e5aca670991033a616b6e8a97515b
2021-06-21 15:45:04 +00:00
Shawn Willden
aa73d0467d Merge "Activate KeyMint." into sc-dev 2021-06-21 12:51:59 +00:00
Treehugger Robot
7980327d6b Isolate app profile ref data
Due to aosp/1708274, ref data directory is now world accessible.
We need to fix ref data directory so that it does not leak app
visibility information.

Bug: 189787375
Test: AppDataIsolationTests
Merged-In: I716852478ce0734c7038934c88c36a567c06393f
Change-Id: I351fd9763c4bdb6d3c0c9a9047de9a4f9986bd03
2021-06-17 19:13:54 +01:00
Shawn Willden
2efdeec6eb Merge "Splitting out Trusty IPC into a library." into sc-dev 2021-06-15 23:17:37 +00:00
Elliott Hughes
eec890e173 Merge "Check for overflow in String16::append and String16::insert." into sc-dev 2021-06-15 22:19:15 +00:00
Elliott Hughes
20462789dc Merge "Check for overflow in String8::real_append." into sc-dev 2021-06-15 20:49:48 +00:00
Max Bires
fc0ed9527d Splitting out Trusty IPC into a library.
This allows the relevant IPC code to be included in the provisioner tool
easily as it's shuffled over into a non-AOSP component due to
chip specific requirements in provisioning Device IDs.

Bug: 178796950
Test: Stuff builds
Change-Id: I57482e89035e8648544f87291ec14c6aece09bd0
2021-06-15 12:15:36 -07:00
Wei Wang
99234c4967 Merge "task_profiles.json: add taskprofile for SurfaceFlinger" into sc-dev 2021-06-15 19:15:19 +00:00
Shawn Willden
8caf16a46e Merge "Add TrustyKeyMintDevice" into sc-dev 2021-06-15 13:15:33 +00:00
Bowgo Tsai
e89ec3c0dc Merge "fastboot: support vbmeta_vendor.img" into sc-dev 2021-06-15 02:09:57 +00:00
Wei Wang
6d6b71e582 task_profiles.json: add taskprofile for SurfaceFlinger
In some platforms, setting a different cpuset (or remove it) and/or
uclamp setting is beneficial to both performance and power. Adding 2
separate profiles for vendor to override surfaceflinger scheduling
policies.

Bug: 170507315
Test: build and boot
Signed-off-by: Wei Wang <wvw@google.com>
Change-Id: Ib313fd67c6ccd701109c5683d8dbab9ecd1580d8
2021-06-14 14:47:00 -07:00
Shawn Willden
c3626d0b1d Activate KeyMint.
Ignore-AOSP-First: No merge path from AOSP
Bug: 177729159
Test: VtsAidlKeyMintTargetTest
Change-Id: I784d393835d15e1eac3dd369202a1e245048801f
2021-06-14 14:33:00 -06:00
Shawn Willden
5bd73cceb5 Add TrustyKeyMintDevice
Ignore-AOSP-First: No merge path from AOSP
Bug: 177729159
Test: Not testable until more CLs land
Change-Id: Iea4e70bb5b4ce051492f2e42d2e0d219d088388e
2021-06-14 14:33:00 -06:00
Christopher Ferris
8f682940e5 Merge "Avoid thread cache in unwinder." into sc-dev 2021-06-14 19:40:40 +00:00
TreeHugger Robot
0b6e4c2c5a Merge "Allow others to read the profile ref dir" into sc-dev 2021-06-14 15:29:55 +00:00
Elliott Hughes
a6be6f0acb Check for overflow in String16::append and String16::insert.
Bug: http://b/178802681
Bug: http://b/178821065
Test: new tests
Change-Id: I2352ea4c65e3f29e44e2ad6cad20ad610ceace1f
2021-06-10 17:06:26 -07:00
Elliott Hughes
59682761fb Check for overflow in String8::real_append.
Bug: http://b/178822418
Test: new tests
Change-Id: I73631a070ade0689441abe5645ba5a5f64a58675
2021-06-10 16:42:20 -07:00
Christopher Ferris
49e5a76544 Avoid thread cache in unwinder.
The code in the fallback path calls pthread_key_create when using the
normal thread cache. However, this code is executed out of the linker,
which means that the call doesn't see keys created by the libc version
of pthread_key_create. As of now, simply avoid using the thread cache
to avoid this problem.

Bug: 189803009

Test: debuggerd -b on a media process on a 32 bit Android Go device
Test: and observe no crash.
Test: debuggerd unit tests pass.
Change-Id: I9ca1a55e44d3bb69d49450826d7d64d7a64145c3
2021-06-10 01:24:50 +00:00
David Anderson
1de7384c10 Use std::shared_ptr in Epoll's callback list.
Ignore-AOSP-First: Awaiting security triage
Bug: 187862380
Bug: 190126442
Test: CtsInitTestCases
Change-Id: Ibb34a6b8a5675dbc515b7f8a43d7eecf2084510c
(cherry picked from commit aea9781530)
2021-06-09 19:59:20 +00:00
Calin Juravle
3c34eecf50 Allow others to read the profile ref dir
ART wants to optimize the time when the profile information
is saved for an app. To do so, it needs access to both, the current
profile, and the reference profile. This will allow ART to access
the ref profiles, which previously was not needed.

Test: m & flash
Bug: 185979271
Merged-In: Ie07bce81d2fba9c0b0ae4f322418e960c024e15d
Change-Id: Ie07bce81d2fba9c0b0ae4f322418e960c024e15d
(cherry picked from commit 11197dd8a8)
2021-06-09 13:51:01 +00:00
Bowgo Tsai
3a0dac346a fastboot: support vbmeta_vendor.img
Bug: 181909612
Bug: 190564127
Test: build
Change-Id: If61fff1c83513d71605c0cef2737a38f7575d69b
Merged-In: If61fff1c83513d71605c0cef2737a38f7575d69b
(cherry picked from commit a48a78356f)
2021-06-09 03:55:01 +00:00
Yi-yo Chiang
8f654d8a99 Merge changes Iaf2ec527,I6d6abd44,I6304e0de,Ia4fbce58,I3b60dfa4, ... into sc-dev
* changes:
  first_stage_mount: mount point must be canonical path
  fs_mgr_fstab: Parse overlayfs options from fs flags
  Remove deprecated fs_mgr_overlayfs_required_devices()
  adb-remount-test: Make awk scripts mawk-v1.3.3-compatible
  Make fs_mgr_overlayfs_mount_fstab_entry() available for user builds
  adb-remount-test: Strengthen skip_administrative_mounts
  fs_mgr_overlayfs_mount_fstab_entry(): Rename source device name
  fs_mgr_overlayfs: Polish fs_mgr_overlayfs_mount_fstab_entry()
  first_stage_mount: Remove "overlay" hack from InitRequiredDevices()
  fs_mgr_vendor_overlay: Mount vendor overlay with noatime
2021-06-08 07:51:52 +00:00
Nikita Ioffe
a35d50c234 Merge "libdm: Add DeleteDeviceDeferred API" into sc-dev 2021-06-04 10:15:39 +00:00
Mitch Phillips
b9637b0a87 [MTE] Print cause and alloc/dealloc traces to logcat.
This information clearly meets the bar for being dumped to logcat. If we
omit the info, we may confuse the user into thinking that it's not
available at all, especially if it's their first time seeing an MTE
report.

This also adds some functionality to the integration testing library to
pull logcat messages and scan them to make sure the contents are in both
places.

Fixes: 187881237
Test: atest debuggerd_test # on QEMU w/ MTE.
Change-Id: Icc17ea45bda7628331cc4812eaad3bc5c949b7a7
Merged-In: Icc17ea45bda7628331cc4812eaad3bc5c949b7a7
2021-06-03 13:13:15 -07:00
Yi-Yo Chiang
84fe96bfbc first_stage_mount: mount point must be canonical path
Ban weird paths such as /../system or //vendor in first stage mount.
Add utility function fs_mgr_create_canonical_mount_point() that:

* mkdir(mount_point) to ensure mount_point's existence
* Test that realpath(mount_point) =?= mount_point

Bug: 188898525
Test: Presubmit
Test: Boot CF
Change-Id: Iaf2ec52701277f26cc81f3e15a47b6083a788334
Merged-In: Iaf2ec52701277f26cc81f3e15a47b6083a788334
(cherry picked from commit 3431d52675)
2021-06-03 15:53:12 +08:00
Nikita Ioffe
8c427b9f67 libdm: Add DeleteDeviceDeferred API
This can be useful in case when a device mapper device can't be deleted
straight away, and instead delete needs to be enqueued until last
reference to the device is closed.

Bug: 187864524
Bug: 188713178
Test: atest libdm_test
Change-Id: Ie8a130baa54e6e16d8d159389bd760bf873eca40
Merged-In: Ie8a130baa54e6e16d8d159389bd760bf873eca40
(cherry picked from commit d13cef7435)
2021-06-02 16:13:45 +01:00
Yi-Yo Chiang
a79bc0d1b3 fs_mgr_fstab: Parse overlayfs options from fs flags
Parse the "lowerdir=" option from fs mount flags instead of fs_mgr flags
for consistency.

Before:

  none /mnt/product/test1 overlay ro lowerdir=/1:/2,first_stage_mount

After:

  none /mnt/product/test1 overlay ro,lowerdir=/1:/2 first_stage_mount

Bug: 188862155
Test: Boot to normal with overlayfs mount entries in first stage fstab
Change-Id: I6d6abd44ab32afadec428005f4aece834f9c8905
Merged-In: I6d6abd44ab32afadec428005f4aece834f9c8905
(cherry picked from commit 7b81023e2a)
2021-06-02 16:54:39 +08:00
Yi-Yo Chiang
bbe9268671 Remove deprecated fs_mgr_overlayfs_required_devices()
It is unused since Ifc8720378259654472d3822e97059b6c366f601d

Bug: 188862155
Test: Build pass
Change-Id: I6304e0dedb36d03a87c556083e937b4a2ce30b1b
Merged-In: I6304e0dedb36d03a87c556083e937b4a2ce30b1b
(cherry picked from commit a07ed968b5)
2021-06-02 16:54:11 +08:00
Yi-Yo Chiang
aedf0fbce8 adb-remount-test: Make awk scripts mawk-v1.3.3-compatible
Our CI is failing because the host machine is using mawk instead of gawk.
mawk v1.3.3 cannot parse regex such as '/[/]/', while mawk v1.3.4 and
gawk can.
Change regex of '[/]' to '\/' so that our test script is as backward
compatible as possible.

Bug: 188862155
Test: Run adb-remount-test.sh on CI
Change-Id: Ia4fbce58a61325a5e5280ede0d5b7760832d8ec1
Merged-In: Ia4fbce58a61325a5e5280ede0d5b7760832d8ec1
(cherry picked from commit ad3a57bdba)
2021-06-02 16:53:27 +08:00
Yi-Yo Chiang
18a6cc2bac Make fs_mgr_overlayfs_mount_fstab_entry() available for user builds
Rename fs_mgr_overlayfs_mount_fstab_entry() to
fs_mgr_mount_overlayfs_fstab_entry() and move it out of
fs_mgr_overlayfs.cpp to make it available for user builds.

Add checks to unsure overlayfs mount point doesn't contain symbolic
link or /../.

Check the mount point with an allowlist if user build. The mount point
should either be /vendor, /product ... or their submounts, or strict
submounts of /mnt/vendor and /mnt/product.

Bug: 188862155
Test: Boot test with overlayfs mount entries on user build
Change-Id: I3b60dfa4b63cf2ae0754f53d1d08365aa7be1ee0
Merged-In: I3b60dfa4b63cf2ae0754f53d1d08365aa7be1ee0
(cherry picked from commit 23816e84ca)
2021-05-27 16:55:28 +08:00
Yi-Yo Chiang
8570398065 adb-remount-test: Strengthen skip_administrative_mounts
Refactor skip_administrative_mounts so that it filters by device name,
mount point and filesystem type. (Was filtering by device name and mount
point.)

We need this because pseudo filesystems such as tmpfs and overlayfs can
have free-formed device name:

  blah /mnt/mnt_point overlay ro,lowerdir=...

However the filesystem type (third field of /proc/mounts) must be
reflecting the actual filesystem, so to robustly filter out
administrative filesystems, we have to check the filesystem type field.

Bug: 188862155
Test: adb-remount-test.sh
Change-Id: I5058cbe8a36920f25b73a5d5833e9fc5a096e90f
Merged-In: I5058cbe8a36920f25b73a5d5833e9fc5a096e90f
(cherry picked from commit f931ad9446)
2021-05-26 15:33:18 +08:00
Yi-Yo Chiang
a38c89a2f0 fs_mgr_overlayfs_mount_fstab_entry(): Rename source device name
adb-remount-test.sh would fail if a overlayfs named "overlay" is mounted
in first_stage_init via fs_mgr_overlayfs_mount_fstab_entry():

  [  FAILED  ] overlay takeover unexpected at this phase

Prepend the source device name with "overlay-", so that the overlayfs
mounted by fs_mgr_overlayfs_mount_fstab_entry() mustn't be named
"overlay".

Bug: 188862155
Test: adb-remount-test.sh
Change-Id: Ia0b3f1c92ed5650c3e584fba23758344a4733657
Merged-In: Ia0b3f1c92ed5650c3e584fba23758344a4733657
(cherry picked from commit 7b90e6936c)
2021-05-26 15:33:03 +08:00
Yi-Yo Chiang
94d1f3b4fa fs_mgr_overlayfs: Polish fs_mgr_overlayfs_mount_fstab_entry()
* Add logs.
* Append "override_creds=off" overlayfs mount flag only if
  fs_mgr_overlayfs_valid() returns kOverrideCredsRequired.
  Pre-4.6 kernels or kernels without the override_creds patch don't
  need or don't recognize the override_creds mount flag.
  (Background: I832c8ca3fce0269bdef4ce988541adb7ba9662ed)
* mkdir(mount_point) before mount() to ensure the mount point exists.
  This could happen if the mount point is in a tmpfs, such as /mnt.

Bug: 188862155
Test: Boot to normal with overlayfs mount entries in first stage fstab
Change-Id: I1a05696346610d7fd61de6d25c379520fd58ca9b
Merged-In: I1a05696346610d7fd61de6d25c379520fd58ca9b
(cherry picked from commit dcf1c1f462)
2021-05-26 07:31:19 +00:00
Yi-Yo Chiang
aa061738bc first_stage_mount: Remove "overlay" hack from InitRequiredDevices()
GetDmVerityDevices() should filter out overlayfs fstab entries in the
first place, so InitRequiredDevices() don't need to filter out overlayfs
pseudo device names.

Bug: 188862155
Test: Boot to normal with overlayfs mount entries in first stage fstab
Change-Id: I0ac8b7ac0f21daa0c191580d9349adf217854864
Merged-In: I0ac8b7ac0f21daa0c191580d9349adf217854864
(cherry picked from commit 87290f8e9b)
2021-05-26 07:31:12 +00:00
Yi-Yo Chiang
1d56fe6538 fs_mgr_vendor_overlay: Mount vendor overlay with noatime
Change relatime to noatime as our filesystems and partitions are all
read-only, so relatime doesn't really work in the first place.

Bug: 188862155
Test: atest -v fs_mgr_vendor_overlay_test
Test: Presubmit
Change-Id: I869bba24c2d6d8a986bf0eec0f487ba7b935ab4b
Merged-In: I869bba24c2d6d8a986bf0eec0f487ba7b935ab4b
(cherry picked from commit 7cbed5a9ce)
2021-05-25 05:14:51 +00:00
Chavi Weingarten
d04966a2fd Merge "Fix implicit cast from ssize_t to size_t in KeyedVector.h" into sc-dev 2021-05-24 14:25:56 +00:00
Michael Butler
229c46569e Merge "Revert "Add libneuralnetworks_shim.so to requireLibs."" into sc-dev 2021-05-21 17:57:00 +00:00
Vishnu Nair
51b958d57c Fix implicit cast from ssize_t to size_t in KeyedVector.h
Fixes a compiler warning for implicit conversion changes from signed
to unsigned which surfaced when refactoring native input libraries.
Add an explicit cast to avoid adding -Wno-sign-conversion compile
flags.

Test: b libsurfaceflinger_unittest
Bug: b/188792659

Change-Id: I1b9309c3530d6063d5cefcaa31af84d9cebc3f5d
Merged-In: I8866aef7f09ca5173604abe18c586b68bbf12ed6
2021-05-21 16:49:07 +00:00
TreeHugger Robot
cab42d2b23 Merge "tombstoned: fix file creation for ANRs." into sc-dev 2021-05-20 19:02:05 +00:00
Michael Butler
2a8dbee2fc Revert "Add libneuralnetworks_shim.so to requireLibs."
This reverts commit 14f6751df1.

Reason for revert: Removing libneuralnetworks_shim.so from Android S

Ignore-AOSP-First: This change is being submitted to sc-dev, which no
longer automerges from AOSP. The AOSP change is separately being
submitted in aosp/1711709

Bug: 188587379
Test: mma
Change-Id: I23acbdc31ddc488ad59225b483936905fa3652ee
2021-05-20 00:24:54 +00:00
Josh Gao
35a45b20c2 tombstoned: fix file creation for ANRs.
Bug: http://b/188315622
Test: manual
Change-Id: I2948b929beb3093b59c8d37b706c857e7422a3cc
Merged-In: I2948b929beb3093b59c8d37b706c857e7422a3cc
(cherry picked from commit 931274862f)
2021-05-19 17:09:59 -07:00
Akilesh Kailash
24305239d6 snapuserd: Send header-response once per entire IO request
Header response from daemon is sent once at the
beginning of the payload. This is a corner case
when the IO request can get broken into multiple chunks
if the IO is un-aligned.

Additionally, add error checks in the IO path
to validate sector information when the read
requests are merged.

Bug: 188361387
Test: Simulate an IO request to forcefully break the IO
response into multiple chunks and verify the correctness.

Signed-off-by: Akilesh Kailash <akailash@google.com>
Change-Id: I1f4fa7a79c60493f4bbed3ad49e257098b930beb
Merged-In: I1f4fa7a79c60493f4bbed3ad49e257098b930beb
2021-05-19 01:01:52 +00:00
Wei Wang
1d14bd3c1a Merge "libprocessgroup: remove failure log for aggregate profiles" into sc-dev 2021-05-18 05:43:15 +00:00
Wei Wang
f9d426b4c6 libprocessgroup: remove failure log for aggregate profiles
The inner profile should print error message if needed.

Bug: 178070122
Test: Build
Signed-off-by: Wei Wang <wvw@google.com>
Change-Id: I2d9d54e21fb064678feccdbae453a398806d51d6
(cherry picked from commit 8722e4d219)
2021-05-14 22:51:57 -07:00
Peter Collingbourne
5b457453c9 Merge "Run MTE tests on zero-sized allocations." am: 93406da189 am: 4bd1c5c8ac am: 5edd60e418
Original change: https://android-review.googlesource.com/c/platform/system/core/+/1706267

Change-Id: Ic491afecc907e064ccda33141ae9c3510335efcd
2021-05-14 05:11:04 +00:00