Commit graph

24438 commits

Author SHA1 Message Date
Nick Kralevich
c4084c6694 change /data/bugreports to /bugreports
It's 5 characters shorter, has no runtime costs, can be stored on a
read-only partition, and avoids problems like b/27262109 and b/27204904.
It allows makes some security hardening easier.

Bug: 27262109
Bug: 27204904
Bug: 32799236
Test: verified new symlink created and old one not present
Change-Id: Ief362e13569ad9c868a7f0f9c4dbd6a328c96c6b
2016-11-22 08:57:25 -08:00
Treehugger Robot
636c851f8d Merge "liblog: add private android_log_write_list_buffer()" 2016-11-22 15:53:32 +00:00
Treehugger Robot
418558f8af Merge "liblog: move android_log_event_context class to log/log_event_list.h" 2016-11-22 15:51:38 +00:00
Josh Gao
79ce3fe7db adb: be more permissive in test_push_error_reporting.
Be agnostic to whether /system is writable when testing push error
reporting.

Test: python test_device.py
Change-Id: I1d03564fa35442c20e2c96a7f5b56d39868efc52
2016-11-21 18:39:21 -08:00
Josh Gao
05a3abfef3 adb: make sure that file mode macros match linux.
We use <sys/stat.h> mode macros on the host to parse modes sent over
from the device, so they had better match. Add static_asserts to ensure
this.

(Also, fix the cases where they don't.)

Test: mma -j48, compiled the static_asserts on darwin manually
Change-Id: I883e4e6c7489ea64d3c02d26790ac8293366d989
2016-11-21 18:39:21 -08:00
Mark Salyzyn
1179eb8048 system/core: replace EVENT_TAG_MAP_FILE with NULL
NULL represents system default.  In the future, NULL could represent
static and dynamic tags, which can come from multiple files based on
implementation details in the liblog library.

Test: gTest logd-unit-tests & liblog-unit-tests
Bug: 31456426
Change-Id: I0e3d296de81ca299ae63d7b83781639ee67ec298
2016-11-21 11:13:02 -08:00
Mark Salyzyn
2ca4f49476 liblog: add private android_log_write_list_buffer()
Allows us to compose an event message for our own in-memory purposes.
Will be used to compose an event message in logd and directly write
it to just the pmsg buffer.  Provide an internal enhanced C++ wrapper
for event handling.

Test: gTest liblog-unit-tests --gtest_filter=liblog.android_log_write_list_buffer
Bug: 31456426
Change-Id: I98246898ba580f9e506baba8af2fd1b26a2a8aae
2016-11-21 09:46:39 -08:00
Mark Salyzyn
472245d962 liblog: move android_log_event_context class to log/log_event_list.h
rename class from android_log_event_context to android_log_event_list

Test: gTest logcat-unit-tests
Bug: 31992412
Bug: 31456426
Change-Id: Ib61cbca7d453837d64959c56b0e11f8c5edbfbdd
2016-11-21 09:46:34 -08:00
Richard Uhler
53fb32f05c debuggerd: Dump list of open files on process crash.
Test: Open a bunch of files, wait for the process to crash, verify dubuggerd
includes the list of open files the tombstone it generates.
Test: Added OpenFilesListTest to debuggerd_test.

Bug: 32013594

Change-Id: I6f939ae1d04dc58dc99abff0ed930da9e0ef0d1c
2016-11-21 11:40:42 +00:00
Treehugger Robot
b6552f376c Merge "Revert "Revert "init: create /dev/urandom, /dev/random in first stage.""" 2016-11-19 00:48:14 +00:00
Jin Qian
0067e03251 fs_mgr: change MF_MAX_COMP_STREAMS define to match internal master
Change-Id: I53a8c6158b4dd1bf5e14ef0a842b7f43ca8bae31
2016-11-18 16:38:40 -08:00
Treehugger Robot
a9ea1e4d99 Merge "Add support for max_comp_streams option for zram" 2016-11-18 23:09:44 +00:00
Evgenii Stepanov
102daa30a3 Revert "Revert "init: create /dev/urandom, /dev/random in first stage.""
This reverts commit 4c8a76e250.

Test: booted angler-userdebug

Change-Id: I2257a44b7cf624065e5653754062a117f3e44c98
2016-11-18 15:09:18 -08:00
Peter Enderborg
4d217f02d3 Add support for max_comp_streams option for zram
With this option the fstab can include a parameter for zram
the enables more streams for kernels that does not have
dynamic stream task handling.

Test: Made sure max_comp_streams is set according to fstab.
Change-Id: I22e158a075a8a86b4e80d3b13989896929c0d223
2016-11-18 21:19:25 +00:00
Mark Salyzyn
16300f192b Merge "logd: add EXIT command" 2016-11-18 16:06:08 +00:00
Treehugger Robot
453db013b0 Merge "adb: fix progress percentage when pulling symlinks." 2016-11-18 02:13:19 +00:00
Josh Gao
da1f279509 adb: fix progress percentage when pulling symlinks.
The adb protocol currently only supports lstat with no way of finding
the target of a symlink, so pulling a symlink that points to a file
looks like pulling a file with length equal to the length of path to
the symlink's target. Pulling a file that's sufficiently large can
overflow the int used to calculate percentage, and result in a bogus
completion percentage being displayed.

Bug: http://b/29277448
Test: adb pull /dev/block/platform/soc.0/f9824900.sdhci/by-name/system
Change-Id: I42d180550ac2aa9e4705676ccbb20f5db789fb8d
2016-11-17 16:17:07 -08:00
Mark Salyzyn
c8749d5108 logd: add EXIT command
Debugging aid. Allows us to run:

$ cat -n '<STUFF>\0EXIT\0' | nc -U /dev/socket/logd

and the pipeline will exit once done. Without the EXIT command
we will have to <CTRL+C> out to terminate the pipeline. This is
necessary since Android's netcat command does not support the -q
feature, and having the EXIT command is faster and cleaner anyways.

Test: manual as noted above.
Bug: 31456426
Change-Id: I65333358188db85e2eb1bb6a14deed1565826ac4
2016-11-17 14:42:33 -08:00
Treehugger Robot
3bde05d928 Merge "Remove dead code." 2016-11-17 20:29:10 +00:00
Wei Wang
9bf10ff61e Merge "init: move empty string check to InitTriggers" 2016-11-17 19:21:47 +00:00
Elliott Hughes
284f07bd9d Remove dead code.
At this point, we can't write to oom_score_adj anyway.

Bug: https://code.google.com/p/android/issues/detail?id=227721
Test: boots, adb shell still works
Change-Id: I07e6ad32765f6582f316973547a3a3d552808287
2016-11-17 10:32:16 -08:00
Treehugger Robot
5fbd1cfd34 Merge "Add flags to restorecon_recursive to traverse filesystems" 2016-11-17 17:39:53 +00:00
Mark Salyzyn
ed0a48c617 Merge "libcutils: sdk(mac) build error (part deux)" 2016-11-17 16:36:21 +00:00
Mark Salyzyn
0958b18da0 libcutils: sdk(mac) build error (part deux)
Test: Build
Bug: 32450474
Change-Id: I92cca30217715779a9db6a60e2e4831a20cec3d4
2016-11-17 08:33:26 -08:00
Mark Salyzyn
231d1ac640 Merge "libcutils: sdk(mac) build error" 2016-11-17 16:09:33 +00:00
Mark Salyzyn
6b652160d1 libcutils: sdk(mac) build error
Surprise surprise, MAC sdk build has F_GETFD & not TEMP_FAILURE_RETRY.
Revert code to original form with the three alternatives for all OSii.

Test: Build
Bug: 32450474
Change-Id: Ia7361d8107675a620968d8395c5e2351ad364d29
2016-11-17 08:05:16 -08:00
Treehugger Robot
c097c79b77 Merge "logcat: add hidden --debug flag and cleanup" 2016-11-17 15:23:05 +00:00
Mark Salyzyn
8c41e791ed Merge "libcutils: move cutils/files.h to cutils/android_get_control_file.h" 2016-11-17 15:22:14 +00:00
Wei Wang
93df4e18a2 init: move empty string check to InitTriggers
Test: mma
Bug: 32838381
Change-Id: I69203734ef7d3640da75f3e3cbe9254bf468d916
2016-11-16 22:24:43 -08:00
Treehugger Robot
5368723cf3 Merge "Remove FuseBridgeLoop class." 2016-11-17 04:22:27 +00:00
Wei Wang
2369b1eb80 Merge changes from topic 'slow_log'
* changes:
  init: fix undefined behavior in ExecuteCommand
  Revert "Revert "init: warn slow action""
2016-11-17 03:46:44 +00:00
Treehugger Robot
d8d7fc6717 Merge "Stops the loop when all files are closed." 2016-11-17 02:49:05 +00:00
Daichi Hirono
691739b334 Remove FuseBridgeLoop class.
Bug: 32779923
Test: libappfuse_test
Change-Id: I29a76701d141ae061ec1fe32993d27460a0c694a
2016-11-17 09:49:51 +09:00
Daichi Hirono
30e6808895 Stops the loop when all files are closed.
The CL changes FuseBridgeLoop so that it exits when all files opened on
the AppFuse mount point are closed. Note that the client code will
unmount the FUSE mount point after the loop exits.

Bug: 32260320
Test: libappfuse_test
Change-Id: I4965fbb48de8a280c6306e70757a07376b1956a7
2016-11-17 09:10:53 +09:00
Mark Salyzyn
52bd37e633 libcutils: move cutils/files.h to cutils/android_get_control_file.h
files.[h|cpp] is bound to be abused with junk, replace with
android_get_control_file.[h|cpp]. Plus some sundry cleanup.

Test: gTest libcutils-tests, logd-unit-tests, liblog-unit-tests,
      logcat-unit-tests and init_tests
Bug: 32450474
Change-Id: Ibd4a7aa4624ea19a43d1f98a3c71ac37805d36b5
2016-11-16 15:56:56 -08:00
Mark Salyzyn
538bc12c08 logcat: add hidden --debug flag and cleanup
Allow us to debug corrupted log messages. Fix liblog to propagate
errors correctly and repair a gtest that failed.

Test: liblog-unit-tests --gtest_filter=liblog.__android_log_bswrite_and_print___max
      logcat -b events --debug -t 50
Bug: 32903864
Change-Id: Ib4eb9f466777cd23b8b54728d36354590d07869a
2016-11-16 15:46:42 -08:00
Wei Wang
d67a4abc64 init: fix undefined behavior in ExecuteCommand
ExecuteCommand may change command_ vector which leads undefined behavior
This bug is found when adding logs in ExecuteCommand printing our Command class fields

Bug: 32838381
Test: on emulator
Change-Id: I96468bd2192ca80013871a3a6ac4132149363fff
2016-11-16 15:46:19 -08:00
Paul Lawrence
a8d8434c42 Add flags to restorecon_recursive to traverse filesystems
Use to solve the problem of tracefs conditionally being mounted
under debugfs and needing restorecon'd without boot performance
penalty.

Also move skip-ce to a flag for consistency.

Test: Check that trace_mount has correct attributes after boot
Bug: 32849675
Change-Id: Ib6731f502b6afc393ea5ada96fa95b339f14da49
2016-11-16 22:27:45 +00:00
Treehugger Robot
e631e470e0 Merge "adb: add sysdeps/chrono.h for chrono literals on Win32." 2016-11-16 22:21:41 +00:00
Treehugger Robot
cfd12251bd Merge "Only restorecon CE storage after unlocked." 2016-11-16 22:04:50 +00:00
Jeff Sharkey
d1d3bdd16f Only restorecon CE storage after unlocked.
On FBE devices, the filenames inside credential-encrypted directories
are mangled until the key is installed.  This means the initial
restorecon at boot needs to skip these directories until the keys
are installed.

This CL changes the implementation of the "restorecon_recursive"
built-in command to use the new SKIPCE flag to avoid labeling files
in CE directories.  vold will request a restorecon when the keys
are actually installed.

(cherrypicked from commit 1635afe83d)

Bug: 30126557
Test: Cherry-picked from master
Change-Id: I320584574a4d712c493b5bbd8a79b56c0c04aa58
2016-11-16 21:19:17 +00:00
Josh Gao
4602adbcd3 adb: add sysdeps/chrono.h for chrono literals on Win32.
Bug: http://b/32878766
Test: mma
Change-Id: Iaa89d4eadf07e63d6d7205057435a6c7fb5d4ec5
2016-11-16 12:14:59 -08:00
Treehugger Robot
59826ddee5 Merge "Switch adb over to <chrono>." 2016-11-16 20:05:52 +00:00
Elliott Hughes
dbe91eee26 Switch adb over to <chrono>.
Clearer code, and lets us lose some more portability cruft.

Bug: http://b/32878766
Test: manual
Change-Id: Ie44928bbf8d68a74127aaf76e7e0060e25fa2cc8
2016-11-16 09:12:12 -08:00
Wei Wang
8b1d526a72 Revert "Revert "init: warn slow action""
This reverts commit 1802d11cc7.

Test: grep init log
Bug: 32712851
2016-11-15 23:58:55 -08:00
Treehugger Robot
0673412bb9 Merge "Use FUSE_COMPAT_22_INIT_OUT_SIZE always as the resopnse size of FUSE_INIT." 2016-11-16 07:46:44 +00:00
Tao Bao
335502453d Merge "Update to new minui text API" 2016-11-16 05:52:18 +00:00
Treehugger Robot
c884f80755 Merge "Use FUSE_COMPAT_22_INIT_OUT_SIZE always if available." 2016-11-16 03:57:46 +00:00
Treehugger Robot
a73ba879b1 Merge "init: fix memory leaks" 2016-11-16 03:25:34 +00:00
Treehugger Robot
e3bd4a2fec Merge "toolbox: fix memory leak" 2016-11-16 03:10:38 +00:00