Commit Graph

28569 Commits

Author SHA1 Message Date
Bowgo Tsai 0d0519c98c Merge "init: early_mount: removing hard-coded paths"
am: f719c255fa

Change-Id: I411e9fde0f78ad42386ab80506f40a30f7ba0848
2017-02-28 01:34:23 +00:00
Treehugger Robot f719c255fa Merge "init: early_mount: removing hard-coded paths" 2017-02-28 01:29:13 +00:00
Greg Hackmann c2e2f36f63 Merge changes Iede18a00,Ib0fa24fb,Ic4c8a137
am: dfbae6ddbb

Change-Id: Ie64621b4538ca8fd798056e4970241ca0c5ba2ea
2017-02-28 00:14:49 +00:00
Treehugger Robot dfbae6ddbb Merge changes Iede18a00,Ib0fa24fb,Ic4c8a137
* changes:
  libcutils: build tests with -Wall -Wextra -Werror
  libcutils: fix socket type in SocketsTest.TestGetLocalPort
  libcutils: fix Wsign-compare warnings in multiuser_test
2017-02-28 00:11:07 +00:00
Greg Hackmann 5fb6ef6b7a Merge changes Ie9dd5d5d,Ifc6038c1
am: 0cde0eae09

Change-Id: Ie402e720388b35daed0f704992686f4b84bc5736
2017-02-28 00:10:47 +00:00
Treehugger Robot 0cde0eae09 Merge changes Ie9dd5d5d,Ifc6038c1
* changes:
  libadf: convert to C++
  libadf: adf_test: fix crash on adf.devices failure
2017-02-28 00:07:52 +00:00
Alex Klyubin 94259da99f Merge "Make secilc accessible by root only"
am: e803818832

Change-Id: I66c3bcf5f853ba90f1edcb6fb68d8d643cd25acf
2017-02-27 23:23:50 +00:00
Treehugger Robot e803818832 Merge "Make secilc accessible by root only" 2017-02-27 23:20:59 +00:00
Sandeep Patil 5cdbcbbcbf Merge "fs_mgr: make is_device_secure() work even in the absence of properties."
am: 0026f1e693

Change-Id: I9646c86bbed9a4da3b976d319549621fb7a16974
2017-02-27 22:45:10 +00:00
Treehugger Robot 0026f1e693 Merge "fs_mgr: make is_device_secure() work even in the absence of properties." 2017-02-27 22:42:33 +00:00
Alex Klyubin 3380927e71 Make secilc accessible by root only
There's no reason for SELinux policy compiler to be accessible by
anybode other than root.

Test: Device boots -- secilc isn't used yet anyway
Bug: 31363362
Change-Id: I26cf34f1412b8dd471f79271c491b473617a6df6
2017-02-27 13:27:58 -08:00
Sandeep Patil e7a1b3757f fs_mgr: make is_device_secure() work even in the absence of properties.
During early mount property area is not initialized, and as a result an
'eng' build will always incorrectly be detected as a 'secure' build by
early mount code path resulting into verity error and consequent boot
loop.

The change here makes sure the is_device_secure() check works with /
without properties based on the 'eng' build based build flag so the
early mount code works fine both ways.

Bug: 35791581
Bug: 27805372

Test: Boot sailfish-{eng,userdebug} builds successfully w/ early
mount enabled

Change-Id: Icd101ccad56b669f49b60bbb3005d5be9f53b02b
Signed-off-by: Sandeep Patil <sspatil@google.com>
2017-02-27 12:46:18 -08:00
Bowgo Tsai d4beed22e8 init: early_mount: removing hard-coded paths
Current early mount has some hard-coded paths that are not easy to extend
when we switch verified boot to AVB (external/avb/libavb). This CL uses some
C++ containers to replace those fixed paths.

Bug: 33254008
Test: early mount /vendor with dm-verity on sailfish
Test: early mount /vendor without dm-verity on sailfish
Test: early mount /vendor with dm-verity on bullhead

Change-Id: I32a22fe486d7649e33bb23c9018ddc0428df6069
2017-02-27 13:09:06 +08:00
Wei Wang be838ae027 Merge "fs_mgr: fix const parameter in fs_mgr_do_tmpfs_mount"
am: 7a5d535cd2

Change-Id: I13b2cc4c792f8165d81d503eefc9d86e93ba7903
2017-02-25 05:14:55 +00:00
Treehugger Robot 7a5d535cd2 Merge "fs_mgr: fix const parameter in fs_mgr_do_tmpfs_mount" 2017-02-25 05:11:04 +00:00
Wei Wang 4d71bc5350 fs_mgr: fix const parameter in fs_mgr_do_tmpfs_mount
Bug: 35425974
Test: mma, marlin/angler boot
Change-Id: Ibadd04ad3a7c4ea184a6344d566302d577d8fee3
2017-02-24 19:33:53 -08:00
Jaekyun Seok 9afcdc825d Merge "Treblize init.rc location"
am: 76e9a180a8

Change-Id: I8415b555308b8ad489413f9e99f6e73ee9caa17e
2017-02-25 02:50:32 +00:00
Treehugger Robot 76e9a180a8 Merge "Treblize init.rc location" 2017-02-25 02:41:29 +00:00
Elliott Hughes 5498d39b84 Merge "Add cross-platform <android-base/endian.h>."
am: 8a16081fa1

Change-Id: I6306de56d135fbc8666648b919432abe5ad05006
2017-02-25 02:16:56 +00:00
Elliott Hughes 8a16081fa1 Merge "Add cross-platform <android-base/endian.h>." 2017-02-25 02:07:05 +00:00
Jaekyun Seok 4ec72cc25f Treblize init.rc location
Treblization requires to locate partner-specific modules in its own
partition. So their own init.rc file could be located in /odm or
/vendor.
This CL is to support those locations for the init.rc.
Additionally thic CL modified import parser to support importing a
relative path.

Test: building succeeded and tested on sailfish with enabling early
mount.
Bug: 35269867

Change-Id: I1bce924a32c8a2b53fb5d981d35d758cf9ddd9a6
2017-02-25 08:06:12 +09:00
Sandeep Patil ad384fc992 Merge changes from topic 'fs_mgr_dt'
am: dbb40b64e9

Change-Id: I8e54aecb4825f4adc3fd92ceff1da76e1c4b227b
2017-02-24 23:05:00 +00:00
Treehugger Robot dbb40b64e9 Merge changes from topic 'fs_mgr_dt'
* changes:
  fs_mgr: refactor: consolidate device tree file reading in one place
  fs_mgr: consolidate DT compatible check
2017-02-24 23:01:08 +00:00
Elliott Hughes 1dbd976200 Add cross-platform <android-base/endian.h>.
Bionic has <sys/endian.h>, glibc <endian.h>, and macOS and Windows have
nothing. This has often been annoying.

Bug: N/A
Test: new tests
Change-Id: I2a40c570df6a9bb30607ace1af653265938cc4b8
2017-02-24 14:03:36 -08:00
Sandeep Patil 4cd9a46916 fs_mgr: refactor: consolidate device tree file reading in one place
If Device tree values are read for comparison, they produce false
negatives with std::strings due to trailing '\0'. This change
consolidates the triming of trailing null into a single helper function
to be used everywhere fs_mgr reads DT values for comparison or other
reasons where it wishes to have the trailing null trimmed.

b/27805372

Test: Boot sailfish w/ early mount /vendor

Change-Id: If71efc830dc440323df764c7461867e71ed6515b
Signed-off-by: Sandeep Patil <sspatil@google.com>
2017-02-24 13:29:33 -08:00
Sandeep Patil e396c607ff fs_mgr: consolidate DT compatible check
Fixes the compatible check in fs_mgr_boot_config by consolidating the
check in a single privately exported function within fs_mgr (i.e.
is_dt_compatible()).

b/27805372

Test: Boot sailfish w/ early mount

Change-Id: Ie2d1646b81cf9eba8d16828ca8cf2c75156c294c
Signed-off-by: Sandeep Patil <sspatil@google.com>
2017-02-24 13:29:26 -08:00
Colin Cross a05a666c01 Merge "Make libutils test compile on the host"
am: f5fd4888ce

Change-Id: Id45309c93a25cba0aa632757eebee341d2dc8d98
2017-02-24 21:19:52 +00:00
Colin Cross f5fd4888ce Merge "Make libutils test compile on the host" 2017-02-24 21:16:01 +00:00
Josh Gao 00613c52ca Merge "Revert "adb: remove win32 dependency on libwinpthread-1.dll.""
am: 87eb0fc3d0

Change-Id: I58794c4e5325a2f1bd0812bed2d451c82ba97056
2017-02-24 21:09:05 +00:00
Josh Gao 87eb0fc3d0 Merge "Revert "adb: remove win32 dependency on libwinpthread-1.dll."" 2017-02-24 21:02:25 +00:00
Colin Cross 155c983ad1 Make libutils test compile on the host
Reapply of Icd5f39ae71b57167e9b2fe7ec09c5400bcb90e78 with
RefBase_test.cpp and Looper_test.cpp removed from mac builds.

Test: out/host/linux-x86/nativetest64/libutils_tests/libutils_tests
Test: out/host/darwin-x86/nativetest64/libutils_tests/libutils_tests
Change-Id: I5979b296a8500b5697d94d64fc441363047adcea
2017-02-24 08:10:06 -08:00
Richard Uhler 5682e001e9 Merge "Revert "Make libutils test compile on the host""
am: 16f4fb9c4e

Change-Id: I855db58666f2a2b2dda4bb9bb36d7c4df44a3903
2017-02-24 11:14:43 +00:00
Richard Uhler 16f4fb9c4e Merge "Revert "Make libutils test compile on the host"" 2017-02-24 11:10:43 +00:00
Richard Uhler 26bfee52b3 Revert "Make libutils test compile on the host"
Fails mac build: "system/core/include/utils/Looper.h:25:10: fatal error: 'sys/epoll.h' file not found"

This reverts commit afa891e85e.

Change-Id: Ib558b8f5a303b55ab32a399d338d8aac0fae32b2
2017-02-24 09:36:13 +00:00
Colin Cross 92466ff6ea Merge changes Icd5f39ae,I2a4e956c
am: 6d795c2883

Change-Id: Iada421394365a767712b553706a5897b21b2ae5a
2017-02-24 07:04:39 +00:00
Treehugger Robot 6d795c2883 Merge changes Icd5f39ae,I2a4e956c
* changes:
  Make libutils test compile on the host
  Fix ODR issue in StrongPointer_test.cpp
2017-02-24 06:59:11 +00:00
Colin Cross afa891e85e Make libutils test compile on the host
Test: out/host/linux-x86/nativetest64/libutils_tests/libutils_tests
Change-Id: Icd5f39ae71b57167e9b2fe7ec09c5400bcb90e78
2017-02-23 21:25:19 -08:00
Colin Cross fe06c63301 Fix ODR issue in StrongPointer_test.cpp
StrongPointer_test.cpp's Foo was colliding with RefBase_test.cpp's
Foo.

Test: out/host/linux-x86/nativetest64/libutils_tests/libutils_tests
      from later CL
Change-Id: I2a4e956c88a07cec72d7ce734cf06c58134a4235
2017-02-23 21:25:18 -08:00
Colin Cross 6d7751a13b Merge "Fix multiton issue"
am: 78b285b367

Change-Id: I56c87e6d4d8b5f5364d2c37c95cf0097d6071985
2017-02-24 04:07:49 +00:00
Treehugger Robot 78b285b367 Merge "Fix multiton issue" 2017-02-24 04:03:11 +00:00
Colin Cross b0145091a7 Fix multiton issue
I385a05a3ca01258e44fe3b37ef77e4aaff547b26 broke Singleton in the
same way that 544e3e3606 had already
fixed once.  Fix it again, the next CL will add tests.

This affected cases where two libraries referenced the same singleton,
the one that was supposed to define the singleton was already loaded,
and then the second library was dlopen'd.

Bug: 35674422
Test: out/host/linux-x86/nativetest64/libutils_tests/libutils_tests
      from later CL
Change-Id: I87c64f95ed294a887e67a6c11be3072299789f01
2017-02-23 18:22:46 -08:00
Sandeep Patil 2eb715d866 Merge changes from topic 'early-mount-verity'
am: 93072f2ce3

Change-Id: Idf13b00a6e69f96d8496377ec2ce58944599666e
2017-02-24 02:18:54 +00:00
Treehugger Robot 93072f2ce3 Merge changes from topic 'early-mount-verity'
* changes:
  adb: early-mount: fix verity toggle through adb for early mount
  early_mount: fs_mgr: move all fstab logic into fs_mgr
2017-02-24 02:13:50 +00:00
Tom Cherry fb13dab611 Merge "Check setegid() return values"
am: 0d24c8f852

Change-Id: I4642339cbd5f03113994a9f2042dca8dc645e209
2017-02-24 00:59:53 +00:00
Elliott Hughes 8d8c3026a8 Merge "Add some basic docs for <android-base/logging.h>"
am: 3b5089371b

Change-Id: I5bc37c1c113f2448954d15ec7f635e7dba56f21c
2017-02-24 00:59:42 +00:00
Treehugger Robot 0d24c8f852 Merge "Check setegid() return values" 2017-02-24 00:55:36 +00:00
Elliott Hughes 3b5089371b Merge "Add some basic docs for <android-base/logging.h>" 2017-02-24 00:55:17 +00:00
Sandeep Patil f134fe07b8 adb: early-mount: fix verity toggle through adb for early mount
verity toggle through adb failed to work for early mount due to fstab
entries being moved into kernel/dt. This change fixes that by using the
new fs_mgr_read_fstab_default() api that will make sure all fstab
entries (from dt as well as from /fstab.{ro.hardware}) are combined
before returning the fstab object.

b/27805372

Test: early mount /system and /vendor on angler.
- test adb disable-verity && adb root to ensure rebooted instance
doesn't have 'partition.system.verified' property set. i.e. verity is
indeed disabled.

- test adb enable-verity && adb root to ensure rebooted instance does
have 'partition.system.verified' property set, i.e. verity is enabled.
also verified by trying to do 'adb remount' which correctly warns about
verity

Change-Id: Iffdcc0a0b959a65c326219bd4e9e41cba9ec7c88
Signed-off-by: Sandeep Patil <sspatil@google.com>
2017-02-23 16:48:52 -08:00
Sandeep Patil c20c0c2cdd early_mount: fs_mgr: move all fstab logic into fs_mgr
With init parsing fstab fragments from kernel separately, the fs_mgr
would completely miss the device tree entries. That leads to things like
'adb remount' to go through without warning for verity even if /system
is verified. This happens because 'verity_update_state' completely
misses the partitions passed to android through the device tree.

solution is to teach fs_mgr about device tree fstab entries and add 2
new public APIs.

1. fs_mgr_read_fstab_dt() - reads device tree and returns fstab
generated from it.

2. fs_mgr_read_fstab_default() - reads both device tree fstab and
/fstab.{ro.hardware} and returns the combined table.

This also reduces the hardcoded /fstab.{ro.hardware} occurence only to
fs_mgr and for eveyone who wants to read the "default" fstab must be
changed to call fs_mgr_read_fstab_default() instead. e.g. adb.

b/27805372

Test: Angler was used since it has 2 early mounted partitions instead of
one. 1 verified and 1 unverified.
- Boot angler successfully without early mount
- Boot angler successfully with /vendor early mount and test if 'adb
remount' warns us about verity
- Boot angler successfully with both /system and /vendor early mounted
and ensure 'adb remount' warns us about verity.
- check partitions.system.verified status after /system early mount ot
ensure it is set to VERITY_MODE_DEFAULT.
- 'adb disable-verity' with early mounted /system doesn't work due to
missing changes in adb

TODO:
change adb to use the new fs_mgr_read_fstab_default() API

Change-Id: I82038d87c7a44488e938acce2cc1082c08f6f73a
Signed-off-by: Sandeep Patil <sspatil@google.com>
2017-02-23 16:48:43 -08:00
Tom Cherry 36ba2fbef7 Merge "Make Condition use CLOCK_MONOTONIC"
am: 7f932afefc

Change-Id: I755d45661ad5575db6dbd3e86f2860e718a6ff0c
2017-02-23 22:05:38 +00:00