Commit graph

34673 commits

Author SHA1 Message Date
Josh Gao
8eada2a90f Merge "libdebuggerd: fix tombstone tests." 2017-10-10 23:05:12 +00:00
Josh Gao
1ce8e14568 libdebuggerd: fix tombstone tests.
Update the tests to match new output (and stop pluralizing '1 entries').

Test: `debuggerd_test{32,64} --gtest_filter="TombstoneTest.*" on hikey960
Change-Id: I16b0335715303252fad3a35d6a053a50fefdac30
2017-10-10 13:55:44 -07:00
Mark Salyzyn
613a5a97e0 Merge "init+bootstat: reduce last reboot reason to canonical alias" 2017-10-10 19:18:19 +00:00
Mark Salyzyn
6290982ee3 init+bootstat: reduce last reboot reason to canonical alias
To make parsing easier for last reboot reason.  This also ensures that
last boot reason matches the content that is typically returned by the
bootloader or in turn landed in the canonical system boot reason.

Simplify parsing in bootstat.  Adjust and fix boot_reason_test.sh for
new reality.  Allow boot reason tests battery and kernel_panic to pass
if device does not support pstore (empty before and after the test).
If device somehow landed in fastboot mode while waiting for the
display, issue a fastboot reboot to move the test along.  Some cleanup
and standardization changes to the test script.

Test: system/core/bootstat/boot_reason_test.sh
Bug: 63736262
Change-Id: I97d5467c0b4a6d65df3525f1a2d0051db813d5ad
2017-10-10 09:37:59 -07:00
Treehugger Robot
be729702ae Merge "set O_CLOEXEC on /dev/ashmem" 2017-10-09 22:39:47 +00:00
Nick Kralevich
30046acdb2 set O_CLOEXEC on /dev/ashmem
Ensure FDs don't leak across exec() boundaries.

Test: builds and boots. No obvious issues.
Change-Id: I00347b489ddb146b9d33442626f0e89a6cf26551
2017-10-09 13:19:36 -07:00
Jeffrey Vander Stoep
f8bc6cee3f Merge "Allow redeclaring typeattributes" 2017-10-08 04:02:55 +00:00
Jeff Vander Stoep
5e9ba3c50b Allow redeclaring typeattributes
Allows partners to add a new attribute definition to their public
policy without causing a compatibility failure with the AOSP system
image.

Bug: 67092827
Bug: 37915794
Test: build and boot aosp_sailfish with a new type declared in public
    policy.

Change-Id: I3899065affb6806ae9080e1a7dfa5a6f368370f0
2017-10-06 17:04:28 -07:00
James Hawkins
732003429e Merge "libmetricslogger: Fix the out-of-sync proto IDs for boot reason." 2017-10-06 21:33:58 +00:00
James Hawkins
f01dbc30ef libmetricslogger: Fix the out-of-sync proto IDs for boot reason.
Long-term fix is to generate from proto directly. b/65625014

Bug: 67508816
Test: None
Change-Id: Ifa671fa5d3816807836fd18cd66a12a7caebb5a1
2017-10-06 14:30:08 -07:00
Tom Cherry
99016bce92 Merge "init: use ro.init.subcontexts_enabled to enable subcontexts" 2017-10-06 20:12:53 +00:00
Mark Salyzyn
0f058759b0 Merge "bootstat: system_boot_reason does not handle reboot_<reason> case" 2017-10-06 18:07:55 +00:00
Tom Cherry
79193a42e7 init: use ro.init.subcontexts_enabled to enable subcontexts
As SEPolicy is developed, use this property to enable/disable
subcontexts.

Bug: 62875318
Test: boot device with/without subcontexts
Change-Id: Ieb879836a71c72d4de1bb16514d083d52480bf9a
2017-10-06 10:37:09 -07:00
Christopher Ferris
283ca30651 Merge "Use Unwinder object for unwind tool." 2017-10-06 17:08:30 +00:00
Christopher Ferris
ae3b136506 Use Unwinder object for unwind tool.
Test: Ran unwind on arm and arm64 processes.
Change-Id: I8a2a3ed31482044fe51d7e0d8c7f5588d5aad81c
2017-10-05 16:05:44 -07:00
Mark Salyzyn
0af71a5327 bootstat: system_boot_reason does not handle reboot_<reason> case
Heuristic would translate reboot_<reason> to reboot._<reason>. Add
checking/squashing for leading comma (,) _or_ underscore (_).

Test: compile
Bug: 63736262
Change-Id: I7ef4930ec8c064a8151183ac08d292931a8584c8
2017-10-05 14:42:08 -07:00
Christopher Ferris
9e6c11da18 Merge "Update the Unwinder object and add tests." 2017-10-05 20:46:01 +00:00
Jaegeuk Kim
4e008547be Merge "init/reboot: call MNT_FORCE at the last umount(2)" 2017-10-05 20:32:14 +00:00
Treehugger Robot
445674ab7c Merge "Stop depending on libnl." 2017-10-05 09:41:23 +00:00
Lorenzo Colitti
e439ffc762 Stop depending on libnl.
We only use it for trivial functions. Replace them and drop the
dependency.

Bug: 67345547
Test: bullhead builds, boots
Test: CtsOsTestCases android.os.cts.StrictModeTest passes
Change-Id: I36254962284babdd1a55a32a76dd0dc92d85420c
2017-10-05 14:56:44 +09:00
Jaegeuk Kim
0f04f72c2d init/reboot: call MNT_FORCE at the last umount(2)
The last one will avoid errors=panic in ext4.

Test: Build
Bug: 63981945
Bug: 65481582
Change-Id: I9c86afcce441767e24fc43668ab1ff6230155a9f
Signed-off-by: Jaegeuk Kim <jaegeuk@google.com>
2017-10-04 19:30:49 -07:00
Christopher Ferris
f6f691b63c Update the Unwinder object and add tests.
Changes:
- Remove unused GetReturnAddressFromDefault function and tests.
- Modify the unwinder to stop when a pc/sp in a device map.
- Modify the unwinder to skip initial frames based on map names.
- Unit tests that exercise all of the paths in the unwinder code.
- Move the test Elf/ElfInterface objects into their own file.
- Update RegsFake to handle extra cases.
- Modify libbacktrace code to use this unwinder.

The new unwinder does not implement the ignore frame functionality since
this is not used very often and is better implemented using a skip frames
in named libraries functionality.

Test: Ran new unit tests, ran backtrace tests.
Change-Id: Ifd65e9acd66ac5e2d0e04bd32a9ad870b54610ff
2017-10-04 14:40:14 -07:00
Mark Salyzyn
142303b9d9 Merge "base: chrono_utils: supported in linux" 2017-10-04 15:55:56 +00:00
Treehugger Robot
fe3551e9dc Merge "Make liblog headers compile stand-alone." 2017-10-04 00:49:55 +00:00
Treehugger Robot
533fbd62ab Merge "init: log failures if a service cannot start during class_start" 2017-10-03 22:03:33 +00:00
Elliott Hughes
2364d7ccc5 Merge "Set $HOSTNAME in adbd." 2017-10-03 21:57:49 +00:00
Mark Salyzyn
1f9fa7e907 base: chrono_utils: supported in linux
Tried to use this on host executable, and it always read back zero
for duration.  Expanded code to support any linux build.

Test: works on host
Bug: 38446744
Bug: 66912053
Change-Id: I4a2cbbfff3e7739b54cb6c6e877898de4d3d2296
2017-10-03 14:53:26 -07:00
Jayant Chowdhary
12f56a00d3 Make liblog headers compile stand-alone.
Test: process liblog headers individually with header-abi-dumper.

Test: mm -j64

Bug: 66971285

Change-Id: If7dec611b84eb9fa8e1e5a974b444d4ddf54759a
2017-10-03 14:06:33 -07:00
Tom Cherry
20acdef816 init: log failures if a service cannot start during class_start
Test: boot system with this logging and see appropriate failures
Change-Id: I312dca89f6215afe05b10b2539258a212a0c1ae2
2017-10-03 13:16:00 -07:00
Jayant Chowdhary
541428a13b Merge "Hide implementation details of log_time struct" 2017-10-03 20:01:13 +00:00
Jiyong Park
0d047642eb Hide implementation details of log_time struct
In the future, the sizes of tv_sec and tv_nsec (or even the size of
log_time struct itself) can change due to the 32-bit overflow expected
to happen in the year 2138. In order to hide such implementation details
to the clients of liblog, the two macros LOG_TIME_SEC and LOG_TIME_NSEC
are introduced.

Furthermore, vendors are provided with a simplified version of log_time.h
without C++ APIs. In doing so, log_time.h no longer includes time.h.
This breaks several modules that implicitly relied on the hidden
dependency, which should be fixed.

Bug: 37629934
Test: build with BOARD_VNDK_VERSION=current

Merged-In: If213fc291395554fd8de5f5d1fb005ceaaa5ca57
Change-Id: I01b36078c1d8f3f44824be20ae769ba1465b6feb
(cherry picked from commit 98c0d030c9)
2017-10-03 17:45:17 +00:00
Elliott Hughes
ba4d9fd933 Set $HOSTNAME in adbd.
bash sets this itself, but mksh doesn't.

This also makes interactive and non-interactive adb shells more similar,
because when we set this in mkshrc that wouldn't affect non-interactive
shells. (I'm not sure whether this is an improvement or not.)

This is certainly _cheaper_ than doing this in mkshrc by calling out to
getprop though.

Bug: N/A
Test: `adb shell printenv` and `adb shell`, `printenv`
Change-Id: I3ff724f19a5098313df83836253f1f7e7872d6a4
2017-10-03 08:44:27 -07:00
Dan Willemsen
7b3d4da91a Merge changes from topic "linux_glibc"
* changes:
  Rename target.linux[_x86[_64]] to target.linux_glibc[_x86[_64]]
  Move host flags from linux -> host
2017-10-03 02:30:06 +00:00
Treehugger Robot
60bd9ca592 Merge "init: fix subcontext SELinux strings" 2017-10-03 01:57:38 +00:00
Tom Cherry
ac7428b2f5 init: fix subcontext SELinux strings
'object_r' is supposed to be simply 'r'.

Test: boot sailfish with SELinux fully enabled and subcontexts enabled
Change-Id: I7eb8b2dd18e66f23c09863e8961da339f72d25c5
2017-10-02 16:59:02 -07:00
Treehugger Robot
5eaa5bc081 Merge "adb: remove SendConnectOnHost." 2017-10-02 23:27:23 +00:00
Treehugger Robot
8c853c43cc Merge "Silence a use-after-free warning from the analyzer" 2017-10-02 22:32:33 +00:00
Josh Gao
4b5d4da6f6 adb: remove SendConnectOnHost.
This logic appears to be racy, and it shouldn't actually be needed, if
our devices follow the USB spec. Use libusb_set_interface_alt_setting
on device initialization as well, to add one more thing that should
reset the data toggles.

Bug: http://b/32952319
Test: python test_device.py
Change-Id: I392198af3d72c524b893e5056afa2b4617cea49c
2017-10-02 14:38:03 -07:00
Treehugger Robot
81348ffa9e Merge "Keymaster: Move test to std::unique_ptr" 2017-10-02 21:09:17 +00:00
Treehugger Robot
99691dfc74 Merge "CtsLogdTestCases#sepolicy_rate_limiter failure" 2017-10-02 20:12:17 +00:00
George Burgess IV
6753bc4433 Silence a use-after-free warning from the analyzer
The analyzer is known to be very conservative in the face of atomic
operations (e.g. https://bugs.llvm.org/show_bug.cgi?id=34365); this case
is no different.

It's concerned that `delete this;` might read a different value for
`flags`, and proceed to delete `refs`. Since there are many comments
explaining why this won't happen (and it all looks sane to me), use a
NOLINT to silence this warning.

Analyzer warning:
system/core/libutils/RefBase.cpp:445:5: warning: Use of memory after it
is freed

Bug: 27101951
Test: mma. Use-after-free warning is gone.
Change-Id: Ic1623971bd1bad546fbb12a79439116c89a6762d
2017-10-02 19:50:39 +00:00
Tom Cherry
8e09b0b953 Merge "init: run vendor commands in a separate SELinux context" 2017-10-02 19:48:58 +00:00
Andreas Gampe
b9d9da25ca Keymaster: Move test to std::unique_ptr
In preparation for UniquePtr removal.

Test: mmma system/core/trusty/keymaster
Change-Id: I42ca2b0d30d87e838d35a82e7ccea4e784acb2f6
2017-10-02 11:53:22 -07:00
Dan Willemsen
4852933707 Rename target.linux[_x86[_64]] to target.linux_glibc[_x86[_64]]
In the future, target.linux will apply to all targets running a linux kernel
(android, linux_glibc, linux_bionic). So move all current users to the specific
linux_glibc.

There will be another cleanup pass later that will move some instances back to
target.linux if the properties should be shared with target.android and
target.linux_bionic, but target.linux needs to be removed first.

Test: out/soong/build.ninja identical before/after
Change-Id: I72ef34689c60ce547cab2898e354b027e335f6a1
Exempt-From-Owner-Approval: build system cleanup
2017-10-02 10:44:29 -07:00
Dan Willemsen
cd58088ccf Move host flags from linux -> host
There will be a second linux host config (linux_bionic), so move this to
apply to all supported host configs instead of just linux_glibc.

Test: out/soong/build.ninja is the same before/after
Change-Id: Id8db10e0a3db889736070eea16f387785c913179
2017-10-02 10:44:28 -07:00
Mark Salyzyn
b825faeed7 CtsLogdTestCases#sepolicy_rate_limiter failure
Cts tests can run in appdomain, which have access to /data/backup/
which leads to zero injection of sepolicy signal to check the logd
and kernel rate limiter.  Switch to /data/drm/ as a better choice
to inject a sepolicy denial either due to dac_override or
dac_read_search because owned by the drm uid and gid, or due to
create sepolicy denial to u:object_r:drm_data_file:s0 to all but
select services.

Test: gTest
Bug: 65843095
Change-Id: I2d72b1407a930c270636a206066d2d15fdec2f77
2017-10-02 10:38:35 -07:00
Treehugger Robot
8b7feee38f Merge "Remove default libraries" 2017-09-30 23:27:15 +00:00
Elliott Hughes
e80beca255 Merge "run-as: Keep supplementary groups." 2017-09-29 22:42:10 +00:00
Treehugger Robot
e808f9213c Merge "reboot: only pause indefinitely for non-shutdown operations" 2017-09-29 20:53:33 +00:00
Dan Willemsen
1e45d533b3 Remove default libraries
libdl is part of system_shared_libs now. -ldl -lpthread -lm are now defaults
for host_ldlibs on Linux and Darwin. -lrt is a default for host_ldlibs on
Linux.

Test: m host
Change-Id: I0b3c147b00a8ab6ff289b85db55b88836c905f5c
Exempt-From-Owner-Approval: build system cleanup
2017-09-29 13:17:06 -07:00