Commit graph

38975 commits

Author SHA1 Message Date
Treehugger Robot
50d874b873 Merge "bootstat: kpdpwr actually means reboot,longkey" 2018-07-02 18:03:49 +00:00
Treehugger Robot
8b80960417 Merge "rootdir: access to pstore denied to bootstat" 2018-06-29 22:03:20 +00:00
Mark Salyzyn
7ab805ea1d rootdir: access to pstore denied to bootstat
Test: boot_reason_test.sh
Bug: 110925971
Change-Id: Iba7b7325fe8c9ad18a7f8dbda550d6008400693e
2018-06-29 13:10:08 -07:00
Treehugger Robot
384a6820cb Merge "Fix misleading comments" 2018-06-29 16:08:46 +00:00
Inseob Kim
ad9f6b12e2 Fix misleading comments
Bug: N/A
Test: N/A
Change-Id: I714a0f523eb803cb619acaddff4f769622cfc8b6
2018-06-29 18:09:55 +09:00
Christopher Ferris
f9b879fd05 Merge "Refactor the DwarfSection classes." 2018-06-29 02:01:12 +00:00
Mark Salyzyn
88d1b4a326 bootstat: kpdpwr actually means reboot,longkey
Test: compile
Bug: 71809701
Change-Id: I812777645b988f9627bcf62e7ef70cc2085d9106
2018-06-28 17:40:26 +00:00
Treehugger Robot
2bbbd06a8a Merge "fs_mgr: fs_mgr_update_verity_state take std::function" 2018-06-28 17:26:34 +00:00
Treehugger Robot
d2f93b17a0 Merge "fs_mgr: Add support in fs_mgr_read_fstab_file for /proc/mounts" 2018-06-28 16:32:03 +00:00
Mark Salyzyn
b5065fcb28 fs_mgr: fs_mgr_update_verity_state take std::function
By changing to a std:function from a plain function pointer as an
argument to fs_mgr_update_verity_state(), a lambda with captured
objects can be executed providing thread safety.

Test: compile and boot
Bug: 109821005
Change-Id: I2699a08cc2c5216625dcbf84eeac0c460f4ae36a
2018-06-28 08:43:35 -07:00
Treehugger Robot
5f70ed6ee1 Merge "libcutils: Simplify android_get_control_socket()" 2018-06-28 11:01:44 +00:00
Tom Cherry
749ee86faf Merge "init: add unit tests for tokenizer.cpp" 2018-06-27 23:01:27 +00:00
Christopher Ferris
92acaac8c7 Refactor the DwarfSection classes.
Modify the code for the no header sections because it turns out that
it is not okay to assume that the fdes are non-overlapping. It's necessary
to read the fdes in order and match as you go.

Modify the code so that it only reads until it finds the given pc rather than
reading all of the cie/fde entries at once.

Rewrote the tests to verify the new behavior.

Bug: 68998033
Bug: 110235461

Test: Ran libbacktrace/libunwindstack unit tests.
Test: Unwind the mediaserver process on a walleye and verify it
Test: unwinds properly.

Change-Id: I7bb59d1db72c13fa34caa9735ec34c1a60e20ed2
2018-06-27 14:52:21 -07:00
Mark Salyzyn
eba4706a2e fs_mgr: Add support in fs_mgr_read_fstab_file for /proc/mounts
Generate fstab from /proc/mounts.  Basically like any regular fstab
minus the requirement for the Android fs_mgr_flags.  Added a unit
test to confirm that fs_mgr_read_fstab("/proc/mounts") matches the
setmntent("/proc/mounts")+getmntent() content.

As a result, discovered a bug in parse_flags that would report "ro"
if the "rootcontext=..." flag was referenced.

Test: fs_mgr_unit_test
Bug: 109821005
Change-Id: I635ee979e11ee089b09adbedb5f42b6ba78026de
2018-06-27 14:49:06 -07:00
Tom Cherry
78ea17a641 Merge "init: fix the parse error when meeting escape characters" 2018-06-27 20:41:21 +00:00
Tom Cherry
2a5a4e72f3 init: add unit tests for tokenizer.cpp
Test: this unit test
Change-Id: Iae24f3bf7850dd4b298281f6608bce195096d60a
2018-06-27 13:22:16 -07:00
Treehugger Robot
78522d3676 Merge changes I2157efc5,Iaf1d6f9c
* changes:
  run-as: Migrate to blueprint
  Add a way to disable run-as at runtime
2018-06-27 20:10:45 +00:00
Treehugger Robot
b27d572d21 Merge changes Ia35a4541,Iaf13450d
* changes:
  fs_mgr: remove fs_mgr_dm_ioctl
  fs_mgr: replace DM_TABLE_STATUS use with libdm.
2018-06-27 19:53:00 +00:00
David Anderson
b5acb1ac4a fs_mgr: remove fs_mgr_dm_ioctl
Bug: 110035986
Test: N/A
Change-Id: Ia35a45415f1b2bc476784890d838b44e6854d5b9
2018-06-27 12:48:29 -07:00
David Anderson
40b594827f fs_mgr: replace DM_TABLE_STATUS use with libdm.
This change introduces a new GetTableStatus method on DeviceMapper,
which returns a vector of information about each target in a device's
table. Some target types (such as verity) can also return additional
information as a string.

Support for this call has also been added to the "dmctl" tool via a
"table" command. Examples:

    $ dmctl create blah zero 0 8000 linear 8000 1000 /dev/block/sdd1 0
    $ dmctl table blah
    Targets in the device-mapper table for blah:
    0-8000: zero
    8000-9000: linear

    For verity:
    sailfish:/ # dmctl table system
    Targets in the device-mapper table for system:
    0-4128792: android-verity, V

Bug: 110035986
Test: libdm_test gtest; AVB1 device still boots
Change-Id: Iaf13450d3b32e2264c7c399a8af8d6bade260592
2018-06-27 12:48:28 -07:00
Luis Hector Chavez
5417bcb5bd run-as: Migrate to blueprint
This change removes the old Makefile and adds a new blueprint file

Bug: None
Test: m
Change-Id: I2157efc51320f64db53e61cfa669268cfca52ec3
2018-06-27 11:15:23 -07:00
Luis Hector Chavez
ef62f3fcbb Add a way to disable run-as at runtime
This change adds the ro.boot.disable_runas system property, that when
set, disables the run-as command. This is done to reduce the surface
area of programs that have file based capabilities in Chrome OS, and
what they can do when running in non-developer mode.

Bug: 31630024
Test: run-as still works in aosp_sailfish
Test: run-as still works in Android in Chrome OS (in developer mode)
Change-Id: Iaf1d6f9ceb65081b7a9e17b9b91d8855e4080133
2018-06-27 11:09:28 -07:00
Rubin Xu
6effd4d6a3 Merge "Parse IfIndex for Netlink RTM_NEWADDR / RTM_DELADDR event" 2018-06-27 16:27:26 +00:00
Treehugger Robot
f5aaa81d75 Merge "libbase: switch to #pragma once." 2018-06-27 02:22:50 +00:00
Treehugger Robot
b4a2f5797c Merge "fs_mgr: Use libdm for fs_mgr_verity." 2018-06-27 01:36:18 +00:00
Elliott Hughes
4d8bbc6f8b libbase: switch to #pragma once.
Bug: N/A
Test: builds
Change-Id: I125498ac4257ac4e901c6f2a5f1bfac1432d859d
2018-06-26 17:17:41 -07:00
Treehugger Robot
2aa50ff56d Merge "Simplify __attribute__((__printf__)) use." 2018-06-26 23:58:09 +00:00
Elliott Hughes
d8a4c60276 Simplify __attribute__((__printf__)) use.
We don't need this now everyone's using clang...

Bug: http://b/69933068
Test: ran tests
Change-Id: I88f0cf03981ade47e210387fd6f3a2706dfeb9b8
2018-06-26 13:07:21 -07:00
Treehugger Robot
b8f4fe4fd4 Merge changes from topic "mingw-clang"
* changes:
  Do not customize __format__ for Windows/MinGW to gnu_printf
  Adapt to switch to Clang for Windows host builds
  Update cflags for building Windows modules with Clang
2018-06-26 19:47:53 +00:00
Treehugger Robot
b0ea3d38b4 Merge "libdm: Add DmTargetVerity and use it in fs_mgr_avb." 2018-06-26 19:42:26 +00:00
David Anderson
9803fbf30b fs_mgr: Use libdm for fs_mgr_verity.
This change uses libdm to replace the hand-coded ioctl code in fs_mgr_verity.
Since AVB2 is now preferred to AVB1, this is a surgical change to allow
us to remove fs_mgr_dm_ioctl. Rather than refactor the target string
construction code, we instead provide a DmTargetVerityString class which
passes a raw parameter string directly to DmTable.

Bug: 110035986
Test: AVB1 device still boots
Change-Id: Iad88993a98abb388a12cec9e6d4543dfb4157414
2018-06-26 12:41:47 -07:00
Treehugger Robot
855a643d3a Merge "Fix memory leak when GateKeeperProxy.verify() returns" 2018-06-26 15:23:20 +00:00
liwugang
332afef5f4 init: fix the parse error when meeting escape characters
After dealing with some specical escape characters('\n','\r','\t','\\',"\r\n")
it doesn't goto the next position in the next loop, so it process the current
character twice.

For example, when parsing the string "test\ntoken" we expect the
"test'\n'token" but actually we got the "test'\n'ntoken"

Test: have espace characters in init .rc files
Change-Id: I015c087a5c6e5ee9c490f29a83b15b89443f7f81
Signed-off-by: liwugang <liwugang@xiaomi.com>
2018-06-26 13:30:54 +08:00
David Anderson
1d17339560 libdm: Add DmTargetVerity and use it in fs_mgr_avb.
This change adds a DmTargetVerity class and replaces the existing verity
table builder in fs_mgr_avb.cpp. DmTargetVerity must be constructed with
all the required parameters for dm-verity. Additional arguments can be
appended via helper methods.

Bug: 110035986
Test: libdm_test gtest; boots with verity on AVB devices
Change-Id: I4fc2f7ef122c841e8b4ec4156177a6224ffbac30
2018-06-25 17:56:12 -07:00
Treehugger Robot
7a8bed30dd Merge "fs_mgr: Use libdm for dm-linear devices." 2018-06-26 00:00:10 +00:00
Treehugger Robot
9d254f0dac Merge "libdm: Add unit tests for dm-linear." 2018-06-25 22:28:10 +00:00
Treehugger Robot
516ec4c257 Merge "libdm: Add helper classes for loop control." 2018-06-25 21:24:07 +00:00
David Anderson
4b52440812 fs_mgr: Use libdm for dm-linear devices.
This removes the custom ioctl code in fs_mgr_dm_linear.cpp in favor of
using libdm.

Bug: 110035986
Test: logical partitions are still created in first-stage init
Change-Id: I941a27ce865aa1bc712b91d8d4c874462e0d11df
2018-06-25 12:56:15 -07:00
David Anderson
2d3e79f5d5 libdm: Add unit tests for dm-linear.
Bug: 110035986
Test: libdm_test gtest
Change-Id: I83fb978931aa36b83880c4d44745cc45ee516fc4
2018-06-25 12:56:14 -07:00
Pirama Arumuga Nainar
a2df1ef441 Do not customize __format__ for Windows/MinGW to gnu_printf
Bug: http://b/69933090
Bug: http://b/69933068

MinGW uses gnu_printf to force C99 printf analysis with GCC, but clang
does not support gnu_printf.  So just use the default that's used for
other platforms.  This also mirrors upstream commit
015e637b4b/.

Test: m native-host-cross with Clang.
Change-Id: I3deb266d70e25296c4ae1d58637afbabc3d949c1
2018-06-25 11:52:54 -07:00
Pirama Arumuga Nainar
8e52362e45 Adapt to switch to Clang for Windows host builds
Bug: http://b/69933068

Bug: http://b/91353691: std::chrono_utils is not available in the
libstdc++ in the mingw/gcc prebuilts.  They can be used once we switch
to using libc++ for Windows host.

Test: m native-host-cross with Clang
Change-Id: If9f0f1f201d5e4e445890075ad64c2d6086b0491
2018-06-25 11:47:52 -07:00
David Anderson
1f428ea054 libdm: Add helper classes for loop control.
This change adds a LoopControl class for interacting with the loop
control device. In addition it provides a LoopDevice class for creating
temporary loop devices. This is aimed at being a building block for libdm
tests, so the current functionality is limited to attaching and
detaching file descriptors and finding free loop devices.

Bug: 110035986
Test: libdm_test gtest
Change-Id: Ice2891e3a44a037aff7b81c63ac793815640d582
2018-06-25 11:37:51 -07:00
Christopher Ferris
fc1cf90741 Merge "Fix ARM program header values used for exidx." 2018-06-23 23:26:57 +00:00
Treehugger Robot
409465a241 Merge "adb: fix obsolete documentation." 2018-06-23 00:57:20 +00:00
Treehugger Robot
b8f4f1422f Merge "Revert "adb: detect some spin loops and abort."" 2018-06-23 00:06:38 +00:00
Treehugger Robot
a67b00a322 Merge "libdm: Implement GetDmDevicePathByName()." 2018-06-23 00:00:51 +00:00
Christopher Ferris
f882a38864 Fix ARM program header values used for exidx.
Before, I was using p_vaddr to get the offset into the elf file where
the exidx frame starts. I changed that to use p_offset since this already
has the load bias offset in it and some elf files do not set p_vaddr
properly.

Also, use p_filesz instead of p_memsz, since again, some elf files do
not set p_memsz to the same as p_filesz.

Bug: 110704153

Test: All libbacktrace/libunwindstack unit tests pass.
Test: Randomly unwind process on a walleye.
Test: Verified that this properly dumps and unwinds the shared
Test: library that sets p_vaddr and p_memsz differently.
Change-Id: Ic7b1e5d07439f4636fa02cd884a8727a5737372b
2018-06-22 16:48:02 -07:00
Treehugger Robot
245b03248f Merge "liblp: Add unit tests for flashing and readback." 2018-06-22 23:28:02 +00:00
David Anderson
5e9e74be61 libdm: Implement GetDmDevicePathByName().
This change implements the ability to get the path of a block device
given a device-mapper device name. In addition, dmctl now has a
"getpath" command to perform this query, as a shortcut for searching
through /sys/block/*/dm/name.

Bug: 110035986
Test: N/A
Change-Id: I9ebd824fa800004f591fc02fc1b1950e0c7fba65
2018-06-22 14:23:31 -07:00
Treehugger Robot
8ddd105545 Merge "liblp: Add unit tests." 2018-06-22 20:47:18 +00:00