Commit graph

58495 commits

Author SHA1 Message Date
Jooyung Han
f7cb833300 Merge "init: generate apex-info-list.xml" am: a657c799bf
Original change: https://android-review.googlesource.com/c/platform/system/core/+/1354547

Change-Id: I4beef3524237f39f8ef7da8ee82ab816e1bde2b0
2020-07-06 21:46:58 +00:00
Jooyung Han
a657c799bf Merge "init: generate apex-info-list.xml" 2020-07-06 21:32:25 +00:00
Josh Gao
d6fcfc8099 Merge "[adb] Fix crash in mdns service removal." am: 7229923bcd
Original change: https://android-review.googlesource.com/c/platform/system/core/+/1352926

Change-Id: Ic92ae62b4ddfc47b7bb85227b841558e8330bd67
2020-07-06 20:24:44 +00:00
Josh Gao
7229923bcd Merge "[adb] Fix crash in mdns service removal." 2020-07-06 20:14:27 +00:00
Jooyung Han
1d951b7700 init: generate apex-info-list.xml
If a device doesn't support unflattened APEXes, init activates flattened
APEXes instead of apexd.

Because apexd dumps apex-info-list.xml after it activates all APEXes,
init should do the same thing.

Bug: 159585065
Test: lunch aosp_cf_x86_phone_noapex & m & boot
      adb more /apex/apex-info-list.xml
      adb shell ls -lZ /apex/apex-info-list.xml
       -> -rw-rw-rw- 1 root root u:object_r:apex_info_file:s0 ..
Change-Id: I74a4d0ee363761564225097c5949e5ce335ac6dc
2020-07-05 00:12:04 +00:00
Jim Kaye
a283bf1bdb Merge "Add Silent Mode boot controls" am: 08097d4ba4
Original change: https://android-review.googlesource.com/c/platform/system/core/+/1353985

Change-Id: I924c026070bdf2a5458af6594fba1dd36aad5da3
2020-07-03 18:24:20 +00:00
Jim Kaye
08097d4ba4 Merge "Add Silent Mode boot controls" 2020-07-03 18:12:18 +00:00
Treehugger Robot
52feb83b51 Merge "Remove SkipMountingPartitions from vendor libfstab" am: 437ded4dbd
Original change: https://android-review.googlesource.com/c/platform/system/core/+/1354545

Change-Id: I1c8983d21d3c63566dd6f22a6268bff97f86eaa0
2020-07-03 12:14:27 +00:00
Treehugger Robot
437ded4dbd Merge "Remove SkipMountingPartitions from vendor libfstab" 2020-07-03 12:02:55 +00:00
Hung-ying Tyan
e7cb09d226 Remove SkipMountingPartitions from vendor libfstab
SkipMountingPartitions() should only be called from a system process
as the config file is in /system_ext.
Remove it from the vendor variant of libfstab.

Bug: 158301941
Test: build hardware/interfaces/boot/1.1/default/boot_control and check symbol
Change-Id: I834183a623c0711dd79b89486fc3fc80f9710801
2020-07-03 17:16:21 +08:00
Jim Kaye
b7386a6239 Add Silent Mode boot controls
Add "reboot,forcedsilent" and "reboot,forcednonsilent"

Bug: 134521909
Test: Manually with 'adb reboot forcedsilent'
Change-Id: Ib07d2b78e6263bc25b23e9973590e399eaf4d7ca
2020-07-01 16:57:01 -07:00
Treehugger Robot
5879334b0e Merge "libprocessgroup: Allow vendor profile attributes to override system ones" am: bf95cc25e3
Original change: https://android-review.googlesource.com/c/platform/system/core/+/1352609

Change-Id: I3f0f044158a5c8a853d293147d8b942a4697dbe5
2020-07-01 22:49:56 +00:00
Treehugger Robot
bf95cc25e3 Merge "libprocessgroup: Allow vendor profile attributes to override system ones" 2020-07-01 22:35:04 +00:00
Joshua Duong
1922ad0dd4 [adb] Fix crash in mdns service removal.
If std::remove_if is a no-op (no service name match), then
std::vector::erase would crash.

Bug: 160025305

Test: test_adb.py
Test: Manual.
1) Enable wireless debugging on multiple devices
2) Disable wireless debugging on all devices

Change-Id: If58b0dda0bb698fd3fd225d9b6a6726a88ae47e0
2020-07-01 15:06:33 -07:00
Suren Baghdasaryan
81b9f0b763 libprocessgroup: Allow vendor profile attributes to override system ones
In the current implementation vendor profile attributes do not override
system ones and instead generate a warning. Fix that by overriding existing
attribute if a new definition is found.

Bug: 160318642
Test: add vendor attributes and confirm no warnings
Signed-off-by: Suren Baghdasaryan <surenb@google.com>
Change-Id: I71a2ee4d4b3c585e7c9a01b791e973390d409cbc
2020-07-01 20:44:24 +00:00
Treehugger Robot
7fc6cf77dd Merge "libmodprobe: remove unused EnableVerbose() method" am: c3f17840ae
Original change: https://android-review.googlesource.com/c/platform/system/core/+/1350930

Change-Id: I743979a72b79c3b53eea1fad2849b848a0adf5b3
2020-06-29 12:16:27 +00:00
Treehugger Robot
c3f17840ae Merge "libmodprobe: remove unused EnableVerbose() method" 2020-06-29 12:05:21 +00:00
Treehugger Robot
ef4a78efbb Merge "modprobe: add -s/--syslog flag" am: 14260d2314
Original change: https://android-review.googlesource.com/c/platform/system/core/+/1348924

Change-Id: Ic98370efc8e3ce24225b438af3475921c5f27339
2020-06-26 22:45:04 +00:00
Treehugger Robot
14260d2314 Merge "modprobe: add -s/--syslog flag" 2020-06-26 22:36:12 +00:00
Mark Salyzyn
ce30bb8e4b libmodprobe: remove unused EnableVerbose() method
modprobe command no longer uses EnableVerbose, opting to do the
associated operations directly.

Test: compile
Change-Id: Iffc8324f37f34de4eeb9a27e92fdf5524afa2220
2020-06-26 22:30:21 +00:00
Mark Salyzyn
63368beaba modprobe: add -s/--syslog flag
There is a desire to ensure that modprobe as a service can log to
kmesg to help triage issues, so add support for the -s or --syslog
flag to do so.

SideEffects:
- help goes to stdout instead of stderr.
- verbose flag once, sets DEBUG, twice, sets VERBOSE minimum.
- quiet flag sets WARNING minimum.

Bug: 159424228
Bug: 151950334
Test: use modprobe as a service to load modules, check logs
Change-Id: I884995f364b0fc604861797eb90d7225a372f864
2020-06-26 10:31:07 -07:00
Mark Salyzyn
f1ae0e66e3 Merge "modprobe: add --all=modules.load flag" am: 3d246cced8
Original change: https://android-review.googlesource.com/c/platform/system/core/+/1346626

Change-Id: Id4cd3f3fde6d286b2cc8b1f7e10149ef42ed31e9
2020-06-26 11:58:33 +00:00
Mark Salyzyn
3d246cced8 Merge "modprobe: add --all=modules.load flag" 2020-06-26 11:46:48 +00:00
Treehugger Robot
f946ba79cf Merge "modprobe: switch to getopt_long for argument parsing" am: d894b463f1
Original change: https://android-review.googlesource.com/c/platform/system/core/+/1348923

Change-Id: Iee307b7d49b586042f2beb1a7aca2c17587b8ea1
2020-06-25 17:55:11 +00:00
Treehugger Robot
d894b463f1 Merge "modprobe: switch to getopt_long for argument parsing" 2020-06-25 16:52:51 +00:00
Tom Cherry
3f1381fbcd Merge changes I9638e90b,Ib2636dfc am: c58d1e4aec
Original change: https://android-review.googlesource.com/c/platform/system/core/+/1349344

Change-Id: I54b5873749ec46f6489d6e6f8224759239b0b25e
2020-06-25 15:02:35 +00:00
Tom Cherry
c58d1e4aec Merge changes I9638e90b,Ib2636dfc
* changes:
  logd: replace std::vector<uint8_t> in SerializedLogChunk
  logd: fix use after resize of contents_ vector
2020-06-25 14:48:39 +00:00
Mark Salyzyn
6c9a1e4d49 modprobe: add --all=modules.load flag
Add a means to specify the modules to load from a file, rather than
on the argument list by adding an optional argument to the --all flag.
This allows modprobe to be designated as a standalone service to load
a long series of modules in the background and be specified
separately.  The specified (module.load) file contains a newline
separate list of module names, and supports line comments using '#'
since this file may be maintained by a human or scripting that
requires tagging for regions of the file.

Bug: 159424228
Bug: 151950334
Test: use modprobe as a service to load modules
Change-Id: Id32641c7244e65848fca3a4a82c8d08b2042bf2f
2020-06-24 18:10:12 -07:00
Mark Salyzyn
3ad274be15 modprobe: switch to getopt_long for argument parsing
Add support for long options, and fit existing options to upstream
behaviors and extensions.  Fix some missing std::endl and
android::base::Join() usage.

Bug: 159424228
Bug: 151950334
Test: manually test long options work
Change-Id: Id792d87d4407628e706aeccecb6e2bce22bcad10
2020-06-24 18:10:12 -07:00
Tom Cherry
b6cb992cf3 logd: replace std::vector<uint8_t> in SerializedLogChunk
Turns out std::vector::resize() and std::vector::clear() don't
actually deallocate any memory.  std::vector::shrink_to_fit() can be
used for this but isn't a 'guarantee'.  Instead of trying to get
std::vector to play nice, this change replaces std::vector<uint8_t>
with std::unique_ptr<uint8_t[]>, which is more accurate to how I'm
using this memory anyway.

Test: logging unit tests
Change-Id: I9638e90bbf50bcf316c5aa172c8278ea945d27e7
2020-06-24 16:19:28 -07:00
Tom Cherry
b07e339b53 logd: fix use after resize of contents_ vector
SerializedFlushToState::PopNextUnreadLog() was calling
AddMinHeapEntry() to replenish the element that was just popped off of
the heap, however AddMinHeapEntry() also manages reference counts for
the buffers, and this resulting in the following scenario:

PopNextUnreadLog() returns a pointer referencing log buffer #1
AddMinHeapEntry() sees that all logs from buffer #1 has been read, so
it decrements the reference count
The caller of PopNextUnreadLog() uses the result which references
invalid memory.

This calls CheckForNewLogs() within HasUnreadLogs() instead of
requiring a separate call, which fixes an additional issue where
continuing from the loop in SerializedLogBuffer::FlushTo() may not
pick up subsequent logs in a given log buffer, since CheckForNewLogs()
wouldn't be called.  This was exacerbated by the above change.

This adds a test to check the reference counts for this case and fixes
an argument mismatch in SerializedFlushToStateTest.

This adds the corpus that surfaced the issue.

Bug: 159753229
Bug: 159783005
Test: these unit tests, run fuzzer without error
Change-Id: Ib2636dfc14293b7e2cd00876b9def6e9dbbff4ce
2020-06-24 15:31:46 -07:00
Nikita Ioffe
b3a10e5220 Merge "Explicitly call restorecon_recursive on /metadata/apex" am: 5b2457ed34
Original change: https://android-review.googlesource.com/c/platform/system/core/+/1348884

Change-Id: I42ac96691e09e203976c0c804da0132ba4053ccc
2020-06-24 17:00:40 +00:00
Nikita Ioffe
5b2457ed34 Merge "Explicitly call restorecon_recursive on /metadata/apex" 2020-06-24 16:40:52 +00:00
Nikita Ioffe
a462044ac8 Explicitly call restorecon_recursive on /metadata/apex
On some devices we see a weird in which /metadata/apex will have a wrong
selinux label. This will effectively prevent such devices from getting
any apex updates. Since we haven't figured out a root cause for this
bug, it's safer to explicitly call restorecon on /metadata/apex to make
sure it's correct.

This change shouldn't affect a normal boot flow, since /metadata/apex
will already have a correct label and restorecon_recursive will be a
no-op.

Test: rm -Rf /metadata/apex && \
    mkdir /metadata/apex &&
    mkdir /metadata/apex/sessions
Bug: 149317789
Merged-In: I971ffe35c93bb79d9e71106c24515ec0ee70333a
Change-Id: I971ffe35c93bb79d9e71106c24515ec0ee70333a
(cherry picked from commit cf7b6bad55)
2020-06-24 16:30:03 +01:00
Lorenzo Colitti
fc10e3f883 Merge "add a new trigger for launching the bpfloader" am: d9299c5119
Original change: https://android-review.googlesource.com/c/platform/system/core/+/1345185

Change-Id: I9669ff9795fc78b006101030e6ba10f40d4d8b63
2020-06-24 03:10:33 +00:00
Lorenzo Colitti
d9299c5119 Merge "add a new trigger for launching the bpfloader" 2020-06-24 02:50:28 +00:00
Tom Cherry
cc37c07a8b Merge changes Id5f03945,I69c74471 am: 23ae9df08e
Original change: https://android-review.googlesource.com/c/platform/system/core/+/1346625

Change-Id: If6b639632128985911c1fe437771414d76a2dcec
2020-06-23 22:24:51 +00:00
Tom Cherry
23ae9df08e Merge changes Id5f03945,I69c74471
* changes:
  logd: add fuzzer for SerializedLogBuffer and other improvements
  logd: join() the SerializedLogBuffer deleter thread
2020-06-23 22:06:36 +00:00
Tom Cherry
f2774a04ca logd: add fuzzer for SerializedLogBuffer and other improvements
1) Add fuzzer for SerializedLogBuffer
2) Enable fuzzing on host
3) Read logs after writing them
4) Silence log tags error on host

Test: run these fuzzers
Change-Id: Id5f0394546ecbccf5281e3d8855853be90dee3f0
2020-06-23 11:37:49 -07:00
Tom Cherry
1fdbdbe148 logd: join() the SerializedLogBuffer deleter thread
Logd never deletes SerializedLogBuffer, so it seemed reasonable to
detach the deleter thread, however unit tests and fuzzers do delete
SerializedLogBuffer, so we must safely join the deleter thread in the
destructor.

This simplifies the deleter thread code and ensures that only one
deleter thread will be running at a time.

Test: fuzzing works
Change-Id: I69c7447109898a1bb7038a03337cadacb1213281
2020-06-23 11:37:49 -07:00
Treehugger Robot
2b5725828a Merge "Use standard colors in logcat color output" am: 7382be402a
Original change: https://android-review.googlesource.com/c/platform/system/core/+/1345183

Change-Id: Icfdb034b46a3378b0c83b1e3f0f07cc599eaf367
2020-06-22 21:56:22 +00:00
Treehugger Robot
7382be402a Merge "Use standard colors in logcat color output" 2020-06-22 21:43:14 +00:00
Tom Cherry
a182decd18 Merge "logd: make drop_privs work if neither klogd or auditd are used" am: ef8c9574c5
Original change: https://android-review.googlesource.com/c/platform/system/core/+/1345186

Change-Id: I35237aea8134335568a437c6b87f640deeb7f75d
2020-06-22 19:19:32 +00:00
Tom Cherry
ef8c9574c5 Merge "logd: make drop_privs work if neither klogd or auditd are used" 2020-06-22 18:51:56 +00:00
Tom Cherry
54b00a9e3c logd: make drop_privs work if neither klogd or auditd are used
Fix a bug that was causing cap_set_flag() fail and logd to exit.

Bug: 159588327
Test: caps are set correctly and logd functions with both, one of, or
      none of klogd and auditd enabled.
Change-Id: Ia51f078ad848535ce1ac29edd8a56a2b686a12cc
2020-06-22 10:20:44 -07:00
Maciej Żenczykowski
6c72c16e3d add a new trigger for launching the bpfloader
Test: built and booted
Bug: 150040815
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: If80758b3d7bf499d428880efa5ed555076bfc291
2020-06-22 01:11:39 -07:00
Peter Kalauskas
8b477b6d10 Use standard colors in logcat color output
Previously, colors were specified from the 216 additional colors, which
typically specify an exact RGB color value. Instead, use escape codes
for standard colors (default foreground, red, green, yellow, etc.),
which are commonly adjusted by terminal emulators user preferences.

Bug: 159503129
Test: adb logcat --format color
Test: atest liblog
Change-Id: I0b10a70a76a29d896d04d6c49e716b09cb09b19a
2020-06-20 03:26:12 +00:00
Victor Khimenko
f3f15d2867 Merge "Make libbacktrace buildable for native_bridge" am: a2f97dbb0f
Original change: https://android-review.googlesource.com/c/platform/system/core/+/1343519

Change-Id: Ie5c0a7407838babda3eca8f1b12b26ee15a2184d
2020-06-19 21:35:09 +00:00
Victor Khimenko
a2f97dbb0f Merge "Make libbacktrace buildable for native_bridge" 2020-06-19 21:22:39 +00:00
Treehugger Robot
3ff439fe77 Merge "Explicitly show the destination filename for a bugreport." am: ca876d8037
Original change: https://android-review.googlesource.com/c/platform/system/core/+/1343880

Change-Id: Ie577838df014386543d1392ae4d68567f39e441c
2020-06-19 21:04:52 +00:00