Commit graph

51342 commits

Author SHA1 Message Date
Ryan Prichard
4440f8bc20 Merge changes I5e33e5bf,I64237006
am: c37f4a4199

Change-Id: I1afe1a7cd33f6316411143429a593d29ac192516
2019-07-15 17:35:07 -07:00
Christopher Ferris
bdcd4f8e85 Merge "Optimize code that only uses PageMap call."
am: 1e7b753c36

Change-Id: I4a8e28e4e929eaf3c308cd851ef4d12f24e6b817
2019-07-15 17:31:26 -07:00
David Anderson
54db37769c Merge "Revert "Remove libfiemap_writer from fs_mgr and move it to gsid.""
am: 4c3d9b2491

Change-Id: I4749aa8c1438f9b1c2ff04c100af297aec62e732
2019-07-15 17:30:33 -07:00
Ryan Prichard
c37f4a4199 Merge changes I5e33e5bf,I64237006
* changes:
  Make android_load_sphal_library thread-safe
  Switch libvndksupport's linker.c to C++
2019-07-16 00:06:21 +00:00
Christopher Ferris
1e7b753c36 Merge "Optimize code that only uses PageMap call." 2019-07-16 00:00:18 +00:00
David Anderson
4c3d9b2491 Merge "Revert "Remove libfiemap_writer from fs_mgr and move it to gsid."" 2019-07-15 23:55:25 +00:00
David Anderson
31656c2c53 Revert "Remove libfiemap_writer from fs_mgr and move it to gsid."
This reverts commit 20fbf0d672.

Reason for revert: broke build

Change-Id: I6914455ba1f0fd56fbf3572f349242d734281610
2019-07-15 23:52:49 +00:00
Tom Cherry
47d680f924 Merge "init: clean up file / socket descriptor creation"
am: c8620ddafe

Change-Id: I0d33e2f797147f1c6a49e2b323b7ac09f93604c9
2019-07-15 16:33:17 -07:00
Tom Cherry
306ca15d79 Merge "Add reserved AID ranges for all partitions"
am: 2a0a0810a1

Change-Id: I639c3ed66293da360318b5979480c1def45f1955
2019-07-15 16:32:41 -07:00
David Anderson
759f119fc9 Merge "Remove libfiemap_writer from fs_mgr and move it to gsid."
am: 3d5b8bc373

Change-Id: I8950fcf3b780da4e00f813b90e6689d0a164141e
2019-07-15 16:22:42 -07:00
Tom Cherry
c8620ddafe Merge "init: clean up file / socket descriptor creation" 2019-07-15 23:20:13 +00:00
Tom Cherry
2a0a0810a1 Merge "Add reserved AID ranges for all partitions" 2019-07-15 23:19:41 +00:00
David Anderson
3d5b8bc373 Merge "Remove libfiemap_writer from fs_mgr and move it to gsid." 2019-07-15 22:54:21 +00:00
David Anderson
20fbf0d672 Remove libfiemap_writer from fs_mgr and move it to gsid.
gsid is the only consumer for this library, and it's unlikely to grow
beyond gsid.

Bug: 134536978
Test: gsid builds
Change-Id: Ib632b1dd8de3e29c02d1fe443a1e409af5f1257d
2019-07-15 22:53:39 +00:00
Ryan Prichard
8c733615aa Make android_load_sphal_library thread-safe
Also: remove an obsolete comment from linker_test.cpp. The test program is
at /data/nativetest[64]/libvndksupport-tests/libvndksupport-tests, which
may will be in the system or legacy configuration, and either the "sphal"
or "default" namespace will be visible.

Bug: none
Test: run libvndksupport-tests, device boots
Change-Id: I5e33e5bf1402a0368e046b03827c216789b02c96
2019-07-15 13:58:51 -07:00
Ryan Prichard
807d9d62d8 Switch libvndksupport's linker.c to C++
Bug: none
Test: device boots
Change-Id: I64237006a7f903647c8d8f7ca681b1da23ac53a9
2019-07-15 13:43:05 -07:00
Tom Cherry
2e4c85f157 init: clean up file / socket descriptor creation
clang-tidy hinted that some of this code wasn't right.  Looking
deeper, there is really not much related to file and socket
descriptors, except that they're published in similar ways to the
environment.  All of the abstraction into a 'Descriptor' class takes
us further away from specifying what we really mean.

This removes that abstraction, adds stricter checks and better errors
for parsing init scripts, reports sockets and files that are unable to
be acquired before exec, and updates the README.md for the passcred
option.

Test: build, logd (uses files and sockets) works
Change-Id: I59e611e95c85bdbefa779ef69b32b9dd4ee203e2
2019-07-15 12:17:30 -07:00
Mark Salyzyn
61c7cc6d88 Merge "bootstat: power_on* handling"
am: 91338a6aa2

Change-Id: Ia3cccc615dbb49c3624e73ea248b9e3c5d0ad61d
2019-07-15 08:59:33 -07:00
Mark Salyzyn
91338a6aa2 Merge "bootstat: power_on* handling" 2019-07-15 15:47:04 +00:00
Tom Cherry
e1f381603d Merge "Add noexcept to missing places in expected.h"
am: a8b0517108

Change-Id: I414d6976260249be40b9c8e99dc8a8798089b6d6
2019-07-15 08:42:29 -07:00
Tom Cherry
a8b0517108 Merge "Add noexcept to missing places in expected.h" 2019-07-15 15:12:46 +00:00
David Anderson
8c3c846cf3 Merge "fs_mgr: Remove the timeout parameter to DestroyLogicalPartition."
am: cd22e3a6f6

Change-Id: Ia3e60d52b9a6e6f9549ed0d9b07aee80dcba16d2
2019-07-13 11:18:07 -07:00
David Anderson
cd22e3a6f6 Merge "fs_mgr: Remove the timeout parameter to DestroyLogicalPartition." 2019-07-13 18:02:05 +00:00
Christopher Ferris
504d2cce64 Optimize code that only uses PageMap call.
Some code only wants to use PageMap to determine whether pages are
mapped in to memory. Modify the code to optimize this path.

Changes:
- Add a function that doesn't read all of usage stats data for every
  map. This operation is extremely expensive, and some code doesn't
  care about it.
- Optimize the PageMap call to do a single read instead of a single
  read per page.
- Add unit tests for these changes.

Bug: 136245508

Test: Ran new unit tests.
Test: Ran procrank and verified data looks good.
Test: Ran DexDiag art tests.
Change-Id: I37d03f2584551d26cb20be3abacdb958111d4eca
2019-07-12 16:28:09 -07:00
David Anderson
92c53170f3 Merge "libdm: Improve the reliability of dm device paths."
am: c9b797ac25

Change-Id: I30a3bf89f71269b0072dad4f73e6b74273ea031a
2019-07-12 16:24:39 -07:00
David Anderson
c9b797ac25 Merge "libdm: Improve the reliability of dm device paths." 2019-07-12 23:03:41 +00:00
Suren Baghdasaryan
771882633e Merge "lmkd: Prevent non-main threads being registered or killed by lmkd"
am: e0b729d214

Change-Id: I11738b8c2c7acfa4947976e8b12ac9b94e7fc8ac
2019-07-12 13:39:47 -07:00
Suren Baghdasaryan
e0b729d214 Merge "lmkd: Prevent non-main threads being registered or killed by lmkd" 2019-07-12 20:13:35 +00:00
Tom Cherry
fcbc44a371 Merge "init: fix clang-tidy performance issues"
am: 8a779ee959

Change-Id: Ifeba3b1a962c33cf355fa897a7177845630be16a
2019-07-12 12:00:56 -07:00
Mark Salyzyn
bdd1ce8538 Merge "fs_mgr: overlay: do not allow sub-mounts to be overridden"
am: bde9fc1787

Change-Id: I115026d227ceb9950020ebc97694d72c1fc04329
2019-07-12 12:00:19 -07:00
Tom Cherry
8a779ee959 Merge "init: fix clang-tidy performance issues" 2019-07-12 18:49:49 +00:00
Treehugger Robot
bde9fc1787 Merge "fs_mgr: overlay: do not allow sub-mounts to be overridden" 2019-07-12 18:38:39 +00:00
Daniel Norman
08c1556641 Merge "Checks the interface inheritance hierarchy in init_rc files."
am: 4b505fe3a8

Change-Id: Ic479fb46d293260589154c6ce0bf844952c8dd26
2019-07-12 11:32:48 -07:00
Daniel Norman
4b505fe3a8 Merge "Checks the interface inheritance hierarchy in init_rc files." 2019-07-12 18:01:46 +00:00
Tom Cherry
da80b0debc Merge "init: Write the reason in BCB on "reboot recovery""
am: e7a010de01

Change-Id: I3c627e207396e754b56a00d6919ef5a8c2b459b7
2019-07-12 10:54:42 -07:00
Mark Salyzyn
3efb204d73 Merge "init: powerctl support and propagate longer canonical reboot reasons."
am: 5c296a0003

Change-Id: Ief8ece1dd4dda9315bc3d0b0213c518a1af2f721
2019-07-12 10:42:02 -07:00
Tom Cherry
e7a010de01 Merge "init: Write the reason in BCB on "reboot recovery"" 2019-07-12 17:39:32 +00:00
Treehugger Robot
5c296a0003 Merge "init: powerctl support and propagate longer canonical reboot reasons." 2019-07-12 17:37:25 +00:00
Steven Moreland
4f8a4b095d Merge "libutils: remove references to unimplemented func"
am: 67a0dd4e27

Change-Id: I5d7f1e8f3fa31054338973f1c66f2d56fddc1428
2019-07-12 10:11:35 -07:00
Steven Moreland
1c9abb85cb Merge "libadbd_services: remove unused deps"
am: a1821e13f3

Change-Id: I8ebee3fde274c70f60b3419c3dc920de51a87213
2019-07-12 10:10:55 -07:00
Steven Moreland
67a0dd4e27 Merge "libutils: remove references to unimplemented func" 2019-07-12 16:48:04 +00:00
Steven Moreland
a1821e13f3 Merge "libadbd_services: remove unused deps" 2019-07-12 16:36:16 +00:00
Suren Baghdasaryan
0082ef15cf lmkd: Prevent non-main threads being registered or killed by lmkd
Only thread group leaders should be registered with lmkd. Add a check to
ignore any non-leader TIDs and generate an error if such condition is
detected. Run the same check before killing a process to detect cases of
non-leader TIDs being used to kill a process. This might happen if PIDs
overflow and previously registered PID gets reused for a non-leader
thread in the following scenario:

1. pid X is a thread group leader and is registered with lmkd
2. pid X dies without lmkd knowing it and pid gets recycled
3. process Y creates a thread with tid X
4. lmkd kills pid X which results in process Y being killed

Bug: 136408020
Test: lmkd_unit_test
Change-Id: I46c5a0b273f2b72cefc20ec59b80b4393f2a1a37
Signed-off-by: Suren Baghdasaryan <surenb@google.com>
2019-07-12 15:11:54 +00:00
Steven Moreland
c0927e64b1 libutils: remove references to unimplemented func
printWeakPointer isn't implemented anywhere. This also allows us to
remove a forward declaration of TextOutput.

Bug: N/A
Test: N/A
Change-Id: Ie2debdfda17b7cc1d599c431eaf4c362a591e482
2019-07-11 17:50:52 -07:00
Steven Moreland
e0d94b6493 libadbd_services: remove unused deps
Bug: 137311188
Test: library still builds
Change-Id: I52e110ddfda073c833e86194eaf7a9502b9181a6
2019-07-11 16:13:10 -07:00
David Anderson
470fe2b5f0 fs_mgr: Remove the timeout parameter to DestroyLogicalPartition.
This is no longer needed as CreateLogicalPartition() ensures the
obtained path will not race with device deletion.

Bug: 135771280
Test: device builds, flashes
Change-Id: I821290aa08fede99d5c51cd68681c351a1ea97bc
2019-07-11 15:39:53 -07:00
David Anderson
924858cd18 libdm: Improve the reliability of dm device paths.
This fixes a race condition where WaitForFile() after
GetDmDevicePathByName appears to succeed, but a subsequent operation on
the path fails. This can happen when CreateDevice() is called
immediately after a call to DeleteDevice (from any process), and the
path is re-used, enqueuing udev events to remove and re-add the block
device.

The fix for this is to introduce a new variant of CreateDevice() that
has a timeout parameter. When the timeout is positive, CreateDevice()
will wait for a /dev/block/mapper/by-uuid symlink to be created, which
signals that ueventd has finished processing the operation.

ueventd will now create these by-uuid symlinks for device-mapper nodes.
Unfortunately, the uuid is only available during "change" events, so we
have to special case device-mapper symlink creation. And since the uuid
is not available during "remove" events, we simply find matching links
to remove them.

This ensures that callers of CreateDevice() can use the device path
knowing that no asynchronous removals are pending. Code that uses the
old CreateDevice+WaitForFile pattern will be transitioned to the new
method.

Note that it is safe to ignore the timeout, or to use the "unsafe"
CreateDevice, if the caller ensures the path by other means. For example
first-stage init has no device removal, and regenerates uevents until
it has acquired all the paths it needs.

Finally, since libdm now inspects sysfs unconditionally, libdm consumers
need r_dir_file perms for sysfs_dm in their sepolicy. Additionally
linking to libdm now requires linking to libext2_uuid.

Bug: 135771280
Test: libdm_test
      device flashes, boots
Change-Id: If5a7383ea38f32a7fbbcf24842dce6a668050a70
2019-07-11 15:39:52 -07:00
Daniel Norman
3f42a767cd Checks the interface inheritance hierarchy in init_rc files.
Bug: 118016875
Test: Added 'interface' lines to an init_rc file and observed errors
when misspelled or missing entire inheritance hierarchy.
Change-Id: I681420f15539742d8415808b2a0dcbf0bf6faaf1
2019-07-11 14:43:11 -07:00
Steven Moreland
538b50d9d5 Merge "Remove binder dependency in init."
am: 4280165ae0

Change-Id: I54ee7ce313210ff47c62ad417c96da40a03cbb29
2019-07-11 14:32:21 -07:00
Steven Moreland
4280165ae0 Merge "Remove binder dependency in init." 2019-07-11 20:56:12 +00:00