Commit Graph

30831 Commits

Author SHA1 Message Date
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
Badhri Jagan Sridharan eab4c62e22 Merge "adb: Do not signal gaget stack unless descriptors are written" 2017-03-08 19:33:10 +00:00
David Lin ae31fd48b0 Merge "init.rc: remove duplicated chown entry for timed_output" am: e88882e16e am: 9c23fcbcd9
am: 197b3f736c

Change-Id: I4a87933290c31305b03fbcaa5c719503d8928b32
2017-03-08 18:50:09 +00:00
David Lin 197b3f736c Merge "init.rc: remove duplicated chown entry for timed_output" am: e88882e16e
am: 9c23fcbcd9

Change-Id: Ic49ddfe13a7d0c0d56fe6b39c9cd882da740ce27
2017-03-08 18:47:39 +00:00
David Lin 9c23fcbcd9 Merge "init.rc: remove duplicated chown entry for timed_output"
am: e88882e16e

Change-Id: I2ba4ad3c1dd4ce0b4fd5f16d16b986d70b73985d
2017-03-08 18:44:39 +00:00
Treehugger Robot e88882e16e Merge "init.rc: remove duplicated chown entry for timed_output" 2017-03-08 18:39:49 +00:00
Mark Salyzyn 43c1d5c4e3 Merge "liblog: add LOGGER_STDERR frontend" am: 6471b85143 am: af4e750023
am: 5d55e7c8b3

Change-Id: I6b84784997e555b6070b2b2d68e74a4581cab542
2017-03-08 17:13:04 +00:00
Mark Salyzyn 5d55e7c8b3 Merge "liblog: add LOGGER_STDERR frontend" am: 6471b85143
am: af4e750023

Change-Id: I3a9749a5700a6512a200c75ab99ad1f2ec35bed9
2017-03-08 17:10:34 +00:00
Mark Salyzyn af4e750023 Merge "liblog: add LOGGER_STDERR frontend"
am: 6471b85143

Change-Id: I5098977938e0daae2300ba00d4ac786d51ccf580
2017-03-08 17:08:02 +00:00
Mark Salyzyn 6471b85143 Merge "liblog: add LOGGER_STDERR frontend" 2017-03-08 17:03:44 +00:00
Mark Salyzyn 4f5fa378c7 Merge "liblogcat: free up log_device_t structures" am: e1bfafd241 am: 3f09ed635b
am: f8b695d051

Change-Id: I0a9bb1b65ff711a69d326e242315e7d40a258302
2017-03-08 15:20:57 +00:00
Mark Salyzyn f8b695d051 Merge "liblogcat: free up log_device_t structures" am: e1bfafd241
am: 3f09ed635b

Change-Id: I529f252d6c43359c042d7f234e1fb04dc0b970ef
2017-03-08 15:18:27 +00:00
Mark Salyzyn 4d99c986d9 liblog: add LOGGER_STDERR frontend
Standalone, this logger provides no end-to-end capability.  Only
provides a writer, no reader transport.  All output goes, logcat-like,
into the stderr stream.  Output can be adjusted with environment
variables ANDROID_PRINTF_LOG and ANDROID_LOG_TAGS.

liblog_*.__android_log_bswrite_and_print___max print fails if a string
member is truncated with "Binary log entry conversion failed" and -1.
We expose the truncated content in the tests and in LOGGER_STDERR.

The purpose of this transport selection is for command-line tools,
providing a means to shunt the logs to be mixed in with the tool's
error stream.

Test: gTest liblog-unit-tests
Bug: 27405083
Change-Id: If344b6e3e67df2dc86ce317cfad8af8e857727b7
2017-03-08 07:17:31 -08:00
Mark Salyzyn 3f09ed635b Merge "liblogcat: free up log_device_t structures"
am: e1bfafd241

Change-Id: I93377527aae460aec9d02f13c868d7998d182693
2017-03-08 15:15:57 +00:00
Treehugger Robot e1bfafd241 Merge "liblogcat: free up log_device_t structures" 2017-03-08 15:11:28 +00:00
Bowgo Tsai 1aeb8d2107 Add a PREUPLOAD.cfg file to run git-clang-format on every commit
The style file .clang-format is copied from adb/.clang-format.
Each sub folders still can have different style by adding their own
.clang-format because git-clang-format uses the style file located
in one of the parent directories of the *source file*.

Also see the following link for previous discussions:

  https://android-review.googlesource.com/#/c/340106

Bug: 36046320
Test: repo upload, checks pre-submit fails when the uploading commit
      doesn't meet the style

Change-Id: I94369af197da1ccce581bbd861c8737f6a197429
2017-03-08 16:51:26 +08:00
David Lin 489450abe3 init.rc: remove duplicated chown entry for timed_output
Test: build

Change-Id: Ib15be4188cdce270a15bd90304be0704d9e54cbf
Signed-off-by: David Lin <dtwlin@google.com>
2017-03-07 21:31:42 -08:00
Badhri Jagan Sridharan 43fd1a4ea7 adb: Do not signal gaget stack unless descriptors are written
While recovering from endpoint errors, the gadget stack was being
signalled even when desriptors were NOT being rewritten. Avoid this
as this might cause enumeration loops.

Bug: 36036550
Change-Id: Iff2b2fc8cded001ef3c77dc170dce3b96848970c
2017-03-07 19:20:54 -08:00
Casey Dahlin 304150a521 Enable mDNS on Darwin
We have to disable IPv6 to get this going, but nobody was yet using
IPv6, so that should be fine for now.

Test: Verified mDNS discovery on a MacBook
Bug: 31042497
(cherry picked from 9ae65de087171072f3890a81b074ae27db319508)

Change-Id: I628f0a1e9c4784db42fa56f5faf2904b6e1cf548
2017-03-07 14:45:52 -08:00
Casey Dahlin d6c8091e9f Don't include mDNS support on platforms other than Linux
Test: Shamu build now passes
Bug: None
(cherry picked from 122a7738606d854d6dc10fa361c1d7296cc9670a)

Change-Id: I650adf0bca96fb655163f5e9b27d9995ae448ec2
2017-03-07 14:45:52 -08:00
Casey Dahlin 2fe9b60475 Make ADB over mDNS work on Windows
Test: Verified ADB over mDNS on a Windows machine
Bug: 30482671
(cherry picked from 9fdd77101f49d03ff29342e12e23edf241f68522)

Change-Id: If955ca304db71a5b08c5a9654f1e27ab74af9af8
2017-03-07 14:45:52 -08:00
Casey Dahlin 13a269ea24 Add mDNS device discovery for adb client
Test: Was able to discover a raspberry pi.
Bug: 28074466
(cherry picked from e292cd16760321fccc99c8c261cb92fa4b6462ab)

Change-Id: Id9571576457a4a0a078e48a274a4e8eac78bfe2b
2017-03-07 14:45:51 -08:00
Casey Dahlin 1fe3cae67e adb: Set a hostname for mDNS
Now all devices won't appear as "Android." Should make it easier to
multiplex.

Test: Verified locally on a raspberry pi 3
Bug: 28887278
(cherry picked from 815b23319635d264ae0ce2c8c29a5776a57b8051)

Change-Id: Icfd0116477543af6a3049c14d818c1cff7fc3b93
2017-03-07 14:44:38 -08:00
Casey Dahlin 6cd5e0b4ef Make ADBD announce its presence over mDNS
We now request mdnsd from adb and register a service of type _adb._tcp
for clients to connect to.

Test: Verified service appears in avahi-browse
Bug: 28074466
(cherry picked from 379ac414e4d9f53388d903913022a55695292775)

Change-Id: Ie871b9c8b40e86063cc1e68e8f3e4290ead2d279
2017-03-07 14:42:06 -08:00
Mark Salyzyn 13e4735526 liblogcat: free up log_device_t structures
Was leaking log_device_t in command path.  Cleanup leak in command
path and add thorough clean up on destroy for insurance.

Start grouping related like-type variables in the context structure
for more effective layout.

Test: gTest logcat-unit-tests
Bug: 35326290
Change-Id: Ibfbddec2d0e1bce24b87b035d67726cac1395574
2017-03-07 14:23:43 -08:00
GuangHui Liu c937c77e04 Merge "Create command to run adb tests and output results" 2017-03-07 21:42:35 +00:00
TreeHugger Robot d96cfde400 Merge "port metrics_logger to v2 format" 2017-03-07 21:26:53 +00:00
Keun-young Park 19761b8ea7 Merge "collect fs stat for ext4" am: 5811a434fc am: f3fcb883b2
am: 820d28b3e2

Change-Id: I90f95321b133305a16e3abe0fc3885992e99d890
2017-03-07 19:37:40 +00:00
Keun-young Park 820d28b3e2 Merge "collect fs stat for ext4" am: 5811a434fc
am: f3fcb883b2

Change-Id: I96f2438120754f07b0ca6218278bb580d95be229
2017-03-07 19:35:10 +00:00
Keun-young Park f3fcb883b2 Merge "collect fs stat for ext4"
am: 5811a434fc

Change-Id: I7dafd4b35ac3efcf59bb940fb582694144056f2b
2017-03-07 19:32:40 +00:00
Keun-young Park 5811a434fc Merge "collect fs stat for ext4" 2017-03-07 19:30:54 +00:00
Keun-young Park 3fbf94e19a collect fs stat for ext4
- This is to collect data to understand if e2fsck -f option
  can be dropped wholly based on information from fs.
- Ideally e2fsck should not fix fs if it was clean shutdown
  or if it is not enabling quota.
- The log is added to /dev/fscklogs/log and other system components
  can collect it later.

TODO: add mechanism to distinguish old vs new fs generation tool.

bug: 32246772
Test: reboot and check saved logs under different shutdown conditions (clean, non-clean)

Change-Id: Id00fad4c5f8ebbb9f9908164a1026e415df06721
2017-03-06 19:39:58 -08:00
Chenjie Luo 9d75a6bb42 Merge "Define _LOG as a weak symbol." am: 6684ec8d97 am: 00c9fcdca9
am: f44debfc03

Change-Id: Ibbcc0ea47ff4aef54801b14df4cacfa8927d4775
2017-03-07 03:10:59 +00:00
bohu 56dc72ea32 Merge changes If9782396,If033c815 am: 5e148a58b8 am: 8e0c8c0dec
am: ec20cd61f6

Change-Id: I6fb101489a8f553b3d49d9757c73532d36a20974
2017-03-07 03:10:38 +00:00