Commit Graph

30916 Commits

Author SHA1 Message Date
Alex Klyubin 9f71f9f91c Merge "Remove hard-coded policy version from secilc step" am: df2ad0b4ab am: f7fd531a75
am: 33153c6c0d

Change-Id: I7d5075855823d64ea38c970f2e30dff9152a7391
2017-03-09 21:17:07 +00:00
Alex Klyubin 33153c6c0d Merge "Remove hard-coded policy version from secilc step" am: df2ad0b4ab
am: f7fd531a75

Change-Id: If28e0ea58ef447c3eda58ef3f5900251eabf8001
2017-03-09 21:09:50 +00:00
Alex Klyubin f7fd531a75 Merge "Remove hard-coded policy version from secilc step"
am: df2ad0b4ab

Change-Id: Id306db22e2bc02518389314ed377d424ce2fc22a
2017-03-09 21:07:21 +00:00
Treehugger Robot df2ad0b4ab Merge "Remove hard-coded policy version from secilc step" 2017-03-09 21:03:44 +00:00
Josh Gao 9eb4eb1811 libdebuggerd: add compatibility shim.
Avoid breaking internal code when AOSP automerges to internal.

This will be reverted after fixing up the uses on the other end.

Bug: http://b/35858739
Test: treehugger
Change-Id: If1ee03d8d7c218d3ad9f451cfe9a9077753dda02
2017-03-09 12:13:16 -08:00
GuangHui Liu b31151967d Merge "Revert "Create command to run adb tests and output results"" 2017-03-09 19:48:59 +00:00
Josh Gao e1aa0ca58a debuggerd_handler: implement missing fallback functionality.
Allow the fallback implementation to dump traces and create tombstones
in seccomped processes.

Bug: http://b/35858739
Test: debuggerd -b `pidof media.codec`; killall -ABRT media.codec
Change-Id: I381b283de39a66d8900f1c320d32497d6f2b4ec4
2017-03-09 11:26:05 -08:00
Alex Klyubin a71dfec4c2 Remove hard-coded policy version from secilc step
This change makes init's SELinux policy compilation step target the
highest SELinux policy language version supported by the kernel.
Prior to this change the version was simply hard-coded in init.

P. S. clang-format (part of presubmit for this change) is being
counter-productive trying to format the section with secilc
parameters. The resulting layout is harder to read. This commit thus
disables clang-format for this section of code and formats the code
for improved readability.

Test: Remove precompiled policy, device boots up, no new denials.
      Added log statement to print out the policy version passed
      into secilc -- it printed 30, as expected.
Bug: 31363362

Change-Id: I151017b5211712861bafb662525e794a44026dd2
2017-03-09 11:11:23 -08:00
David Lin 27b2c1e678 init.rc: enable ledtrig-transient support for vibrator
This change makes the init process to always attempts to enable
transient trigger for vibrator. This allows the exported properties to
change the ownership later at the on boot stage.

Test: device vibrates with the driver supports ledtrig-transient

Change-Id: If5eb7b7feaefe803f2ead634fbe4fc7b48da84ea
Signed-off-by: David Lin <dtwlin@google.com>
2017-03-09 18:42:33 +00:00
GuangHui Liu 72825be9a8 Revert "Create command to run adb tests and output results"
This reverts commit f583429468.

Change-Id: I7dc694e4b9d89f9530b83fae6343e8b5ff076859
2017-03-09 17:41:48 +00:00
Mark Salyzyn 81321a7980 liblog: replace "frontend" with "transport"
We still do not have any users of the 'frontend' interface, let's
right a wrong and rename it to 'transport' as it makes more sense.
Renames android_log_set_frontend, android_log_get_frontend and
include/log/log_frontend.h.

SideEffects: None
Test: gTest liblog-unit-tests
Bug: 27405083
Change-Id: I7c1c0f3dfdc7cf047285403e306edbd16ad1324d
2017-03-09 09:36:34 -08:00
Mark Salyzyn 04bbc8ea45 liblog: stay away from C++ keyword private
Replace with void* private with priv in context structure.

SideEffects: None
Test: gTest liblog-unit-tests
Bug: 27405083
Change-Id: I670cb0b7fb2f3085ea13b4ac836d84239a3c8572
2017-03-09 09:36:34 -08:00
Mark Salyzyn 2ed51d708e liblog: specify clang format
Switch coding style to match

SideEffects: None
Test: compile
Bug: 27405083
Change-Id: Id426d5c5e3b18f2ceec22b31bbc9781aabf6bcca
2017-03-09 09:36:19 -08:00
Bowgo Tsai c9a1842d31 init: replacing fs_mgr_read_fstab() with fs_mgr_read_fstab_default()
The original default /fstab.{ro.hardware} might be moved to
/vendor/etc/. or /odm/etc/. Use the new API to get the default
fstab instead of using the hard-coded /fstab.{ro.hardware}.

Bug: 35811655
Test: boot marlin with /vendor/etc/fstab.marlin

Change-Id: I8a9c70eda7f68b174ec355910d0fa1eb18a46e21
2017-03-09 23:26:31 +08:00
Bowgo Tsai 46c6dc1a6f fs_mgr: support reading fstab file from /odm or /vendor partition
fstab contains device- and soc- specific content that should reside in
/odm or /vendor partition. This change searches the fstab.${ro.hardware}
file from /odm/etc, /vendor/etc and /, then use the first one found.

Bug: 35811655
Test: boot sailfish
Change-Id: I82f89b41a849faedb64072a7cfc52d7424e1aaa1
2017-03-09 22:35:54 +08:00
Bowgo Tsai 47d342739a fs_mgr: add fs_mgr_read_fstab_with_dt() API
With the early mount support in init, fstab entries of verified partitions
(e.g., /system, /vendor) will be moved into device tree in kernel image.

Those early mount fstab entries will be removed from the fstab file to
prevent duplicated and/or inconsistent settings.

This change adds a new function: fs_mgr_read_fstab_with_dt(), to return
the combined results from both places. It also removes
fs_mgr_read_fstab_file() from the public APIs and makes it as an
internal function.

Bug: 35811655
Test: early mount /vendor with dm-verity on sailfish

Change-Id: I2fba3614685bf9f852a789cda6f53013e2164e60
2017-03-09 21:15:08 +08:00
Josh Gao 76842e8151 Merge "adb: append the libwinpthread COPYING to adb's NOTICE." am: c1b3c8ef26 am: 9d13bc2160
am: b880c671f6

Change-Id: I0f2e8b5855734140354d9eb3180520172da02e32
2017-03-09 07:54:33 +00:00
Josh Gao b880c671f6 Merge "adb: append the libwinpthread COPYING to adb's NOTICE." am: c1b3c8ef26
am: 9d13bc2160

Change-Id: Icc6f177ecf40435e0cef354832152aec3169173f
2017-03-09 07:51:02 +00:00
Josh Gao 9d13bc2160 Merge "adb: append the libwinpthread COPYING to adb's NOTICE."
am: c1b3c8ef26

Change-Id: I4de6f83ea394635710b4e89cc1818233b6605eca
2017-03-09 07:48:01 +00:00
Treehugger Robot c1b3c8ef26 Merge "adb: append the libwinpthread COPYING to adb's NOTICE." 2017-03-09 07:43:56 +00:00
Wei Wang 36baabf07b Merge "init.rc: start netd and zygote early for file based encryption devices" am: 4bf2bc078f am: 1a65e43878
am: 3b272c7bf8

Change-Id: Ie44f4fd8a04b1fa1d0a5c6f7e01410246589c9d9
2017-03-09 06:24:27 +00:00
Wei Wang 3b272c7bf8 Merge "init.rc: start netd and zygote early for file based encryption devices" am: 4bf2bc078f
am: 1a65e43878

Change-Id: I2d2aabda97c7a650aa9812a2d84d60db8ced9d2a
2017-03-09 06:20:56 +00:00
Wei Wang 1a65e43878 Merge "init.rc: start netd and zygote early for file based encryption devices"
am: 4bf2bc078f

Change-Id: I2fad834e5a2daa2823838caff0322b4b43fce47d
2017-03-09 06:17:56 +00:00
Treehugger Robot 4bf2bc078f Merge "init.rc: start netd and zygote early for file based encryption devices" 2017-03-09 06:12:33 +00:00
Jesse Hall 576b773834 Merge "Add NDK libsync to linker whitelists" 2017-03-09 05:55:20 +00:00
Jesse Hall d08467f341 Add NDK libsync to linker whitelists
Test: make
Change-Id: Idb9ddfce7032a3faef7213327d3160968d4a80ba
2017-03-08 21:51:39 -08:00
Bowgo Tsai feb488b7c2 Merge "Add a PREUPLOAD.cfg file to run git-clang-format on every commit" am: 59aea45254 am: 5f3e037e60
am: 1323b630b0

Change-Id: I13c6de8ce398db3963d1ce9df3d90d5798b4c7be
2017-03-09 05:39:56 +00:00
Bowgo Tsai 1323b630b0 Merge "Add a PREUPLOAD.cfg file to run git-clang-format on every commit" am: 59aea45254
am: 5f3e037e60

Change-Id: Ib0ab3843465b3711f9601c75f496e737878c8f75
2017-03-09 05:36:54 +00:00
Bowgo Tsai 5f3e037e60 Merge "Add a PREUPLOAD.cfg file to run git-clang-format on every commit"
am: 59aea45254

Change-Id: Ibfb57f2d8f273c513e7f7fdef97676683a1c6ca9
2017-03-09 05:33:54 +00:00
Treehugger Robot 59aea45254 Merge "Add a PREUPLOAD.cfg file to run git-clang-format on every commit" 2017-03-09 05:30:19 +00:00
Josh Gao d3bf1a8d7e adb: append the libwinpthread COPYING to adb's NOTICE.
We statically link libwinpthread into Windows binaries, but soong
currently can't specify notice files for toolchain_libraries. Add
libwinpthread's COPYING info directly to adb's as a hack.

Bug: http://b/36073965
Test: `make PRODUCT-sdk-win_sdk` + manual inspection of NOTICE.txt
Change-Id: I58d6be0ecf5626b67308f7e94128a2cd44dab161
2017-03-08 21:27:59 -08:00
Mathias Agopian a126305b75 Merge "Add an “is valid” query to ANativeWindow" 2017-03-09 02:28:56 +00:00
Jesse Hall 6cd0fc56c0 sync: Cache knowledge of kernel uapi version
Previously all libsync calls would try first the modern/mainline uapi
and if that failed try the legacy uapi, or vice versa. This is
inefficient, and confusing when looking at strace. With this change,
after the first successful syscall, libsync know's what uapi version
the kernel supports, and will only try that version in the future.

Test: sync-unit-tests on bullhead
Change-Id: I8b5de0194da0cfc6c080c0180318e16bb673d3c9
2017-03-08 17:34:14 -08:00
Jeff Vander Stoep 0cbbb8381e Build split file_contexts on TREBLE builds
Build file_contexts.bin on legacy builds.
Test: Marlin and Bullhead build and boot with no new denials.
Test: Marlin and Bullhead recovery boots with no new denials.
Test: Bullhead boots with file_contexts.bin in /
Test: Marlin boot with /system/etc/selinux/plat_file_contexts and
      /vendor/etc/selinux/nonplat_file_contexts.
Bug: 36002414

Change-Id: I66f138fc3ad808df0480e0467cee03fd40177f31
2017-03-08 15:28:06 -08:00
Alex Klyubin dec150ff58 Merge "Use precompiled sepolicy when available" am: dda9cbb350 am: f9ac2fa7b2
am: 7945bfb062

Change-Id: I244e63496bfe105600008924dba14868bf657363
2017-03-08 23:18:30 +00:00
Alex Klyubin 7945bfb062 Merge "Use precompiled sepolicy when available" am: dda9cbb350
am: f9ac2fa7b2

Change-Id: I6a381f1c5ac7250c2d5de8fa082593f82e5834a9
2017-03-08 23:15:31 +00:00
Alex Klyubin f9ac2fa7b2 Merge "Use precompiled sepolicy when available"
am: dda9cbb350

Change-Id: I801189104c263b21d2252d957af25149cfbef648
2017-03-08 23:13:01 +00:00
Treehugger Robot dda9cbb350 Merge "Use precompiled sepolicy when available" 2017-03-08 23:09:08 +00:00
Mathias Agopian c1d77bedad Add an “is valid” query to ANativeWindow
This will help avoid certain crash (null dereference),
and return an error instead. This is useful for
app developers as java language apps are not
expected to crash when passed bad arguments

This doesn’t fix bug 36065206, but was prompted
by it.

Test: compile / run
Bug: 36065206
Change-Id: I329874821f5cd780eeaacf8945859af5ab790cf4
2017-03-08 15:04:09 -08:00
Wei Wang 7f32aa4d04 init.rc: start netd and zygote early for file based encryption devices
Bug: 35110957
Test: marlin boots
Change-Id: Ibe4c413e41fcf25a68b50d99ee66d9b70706a6a1
2017-03-08 14:48:53 -08:00
Wei Wang 43a356d213 Merge "init.rc: add a new zygote-start trigger" am: 4e5e797d26 am: 0d9416ba2e
am: 2980bc1139

Change-Id: I56e6907db4063f6b527be710b00de9200aa8914a
2017-03-08 22:28:24 +00:00
Wei Wang 2980bc1139 Merge "init.rc: add a new zygote-start trigger" am: 4e5e797d26
am: 0d9416ba2e

Change-Id: Ibd8a768b0d76dcd71eb5f8c17528af78074c8ca3
2017-03-08 22:25:55 +00:00
Wei Wang 0d9416ba2e Merge "init.rc: add a new zygote-start trigger"
am: 4e5e797d26

Change-Id: Ic8e028c55fcca904c49814d1a3849ff8088f6458
2017-03-08 22:23:26 +00:00
Treehugger Robot 4e5e797d26 Merge "init.rc: add a new zygote-start trigger" 2017-03-08 22:18:11 +00:00
Wei Wang a2058036ed init.rc: add a new zygote-start trigger
Bug: 35110957
Test: marlin boots
Change-Id: I12b41588371486e79938df2f7a2152cda18530d1
2017-03-08 12:39:41 -08:00
Alex Klyubin 2d19aeb13a Use precompiled sepolicy when available
NOTE: This change affects only devices which use SELinux kernel policy
split over system and vendor directories/partitions.

Prior to this change, init compiled sepolicy from *.cil files on every
boot, thus slowing boot down by about 400 ms. This change enables init
to skip the step compilation and thus avoid spending the 400 ms. The
skipping occurs only if the device's vendor partition includes an
acceptable precompiled policy file. If no acceptable policy is found,
the compilation step takes place same as before.

Because such devices support updating system and vendor partitions
independently of each other, the vendor partition's precompiled policy
is only used if it was compiled against the system partition's policy.
The exact mechanism is that both partitions include a file containing
the SHA-256 digest of the system partition's policy
(plat_sepolicy.cil) and the precompiled policy is considered usable
only if the two digests are identical.

Test: Device with monolithic policy boots up just fine
Test: Device with split policy and with matching precompiled policy
      boots up just fine and getprop ro.boottime.init.selinux returns
      a number below 100 ms. No "Compiling SELinux policy" message in
      dmesg.
Test: Device with split policy and with non-matching precompiled
      policy boots up just fine and getpropr ro.boottime.init.selinux
      returns a number above 400 ms. There is a "Compiling SELinux
      policy" message in dmesg. The non-matching policy was obtained
      by adding an allow rule to system/sepolicy, building a new
      system image using make systemimage and then flashing it onto
      the device.
Bug: 31363362
Change-Id: Ic2e81a83051689b5cd5ef1299ba6aaa1b1df1bdc
2017-03-08 12:25:25 -08:00
TreeHugger Robot affc6cd0ed Merge "Fix heap-buffer-overflow detected by ASAN." 2017-03-08 20:24:58 +00:00
Badhri Jagan Sridharan f837af9807 Merge "adb: Do not signal gaget stack unless descriptors are written" am: eab4c62e22 am: a37bc179de
am: 796f76a534

Change-Id: I85e68bcca4081915616bc6673bf67ca8d78757e8
2017-03-08 19:49:57 +00:00
Badhri Jagan Sridharan 796f76a534 Merge "adb: Do not signal gaget stack unless descriptors are written" am: eab4c62e22
am: a37bc179de

Change-Id: Ia162d53d48eefb7171980a0c229d1b0601652d2f
2017-03-08 19:42:12 +00:00
Badhri Jagan Sridharan a37bc179de Merge "adb: Do not signal gaget stack unless descriptors are written"
am: eab4c62e22

Change-Id: Ia04e413a6f3a0e3fcb1e8e52aa822accb808f1fb
2017-03-08 19:39:43 +00:00