Commit Graph

30146 Commits

Author SHA1 Message Date
Josh Gao d3f512ebe3 Merge "adb: enable -Wthread-safety on linux/darwin." am: 2983d2710e
am: 0c91897714

Change-Id: I8d08f4bd3533942533e8e070ae0d6439bd1eb622
2017-05-03 23:46:55 +00:00
Josh Gao 0c91897714 Merge "adb: enable -Wthread-safety on linux/darwin."
am: 2983d2710e

Change-Id: I0fcbadd46a16028b2e69cba1f82975e4e50fd4cf
2017-05-03 23:44:00 +00:00
Josh Gao 2983d2710e Merge "adb: enable -Wthread-safety on linux/darwin." 2017-05-03 23:38:59 +00:00
Mark Salyzyn b519cb5e14 Merge changes Ieb44fa8f,I01b26fe5 am: e1e3e20337
am: d8dc29df8e

Change-Id: I71734f488e286aeeafb5f514c3eebd246f3ce5c1
2017-05-03 23:36:08 +00:00
Mark Salyzyn d8dc29df8e Merge changes Ieb44fa8f,I01b26fe5
am: e1e3e20337

Change-Id: I6181e1d699dd721030c2a9080b89b51ab441d185
2017-05-03 23:33:08 +00:00
Treehugger Robot e1e3e20337 Merge changes Ieb44fa8f,I01b26fe5
* changes:
  init: setup keyring before ueventd starts
  logd: refine permissions to access /data/system/packages.list
2017-05-03 23:24:14 +00:00
Tom Cherry bc8a4ad7aa Merge "init: use do_exec() for init_user0" am: 5ad06cbb1c
am: 577c75e78c

Change-Id: I1a148c39f4f87df388641367bdec6b187723db9e
2017-05-03 22:28:06 +00:00
Tom Cherry 577c75e78c Merge "init: use do_exec() for init_user0"
am: 5ad06cbb1c

Change-Id: Id75cd629df7c73bdc2c7fe4fd8438f44a8c811b7
2017-05-03 22:25:36 +00:00
Treehugger Robot 5ad06cbb1c Merge "init: use do_exec() for init_user0" 2017-05-03 22:11:06 +00:00
Mark Salyzyn 4599627492 init: setup keyring before ueventd starts
Invent keyutils.h to supply capability to set session keyring.
The keyring will hold things like the FBE encryption keys.

Test: gTest logd-unit-tests --gtest_filter=logd.statistics
Bug: 37751120
Bug: 36645158
Change-Id: Ieb44fa8f53dda6cf506a6243498c72d7f7f3cde7
2017-05-03 21:51:04 +00:00
Mark Salyzyn d392ac160c logd: refine permissions to access /data/system/packages.list
Refine DAC security surrounding logd.daemon worker thread and add a
positive test for logd failure to access /data/system/packages.list.

- Add AID_PACKAGE_INFO to groups of worker thread.
- Move AID_SYSTEM to groups, setgid to AID_LOGD.
- Do not drop capabilities until after setting the uid and gids.
- Add a test that is part of logd.statistics test to check when
  packagelistparser appears broken.
- If /data/system/packages.list is encrypted, ensure we do not pick
  up the existing inode to ensure strong positive when finding access
  problems.
- Replace all occurrences of NULL with nullptr in gTest code for
  compliance with best practices.

Test: gTest logd-unit-tests --gtest_filter=logd.statistics
      (expect consistent failure, later CLs fix)
Bug: 37751120
Bug: 36645158
Change-Id: I01b26fe5e25203246ae432d272c8daa9c07cab54
2017-05-03 14:35:14 -07:00
Josh Gao 68f679c35b adb: enable -Wthread-safety on linux/darwin.
Delete the sysdeps/mutex tests that -Wthread-safety complains about.
We're using the standard library's std::mutex on all platforms now,
anyway.

Test: mma
Change-Id: I3bf958c72604b29dfb1d9c898d3c9aa34aed2685
2017-05-03 14:28:21 -07:00
Tom Cherry 5a86cb7694 init: use do_exec() for init_user0
Similar to what installkey used to do, init_user0 forks and
synchronously waits for vdc to return.  This is dangerous to do in
init however as init also processes properties from a single thread.

I'm not aware of any specific issues that this is currently causing,
but it's a good preventative measure to match what installkey does and
use do_exec().

Test: Boot bullhead, see that init_user0 still happens
Change-Id: I853c61594fe3d97e91bbb2319ebddf2bbe80d457
2017-05-03 13:25:08 -07:00
Tom Cherry 4c664d8c5c Merge "ueventd: do not reference init's sehandle" am: 672dd970f4
am: e4988c9a34

Change-Id: I3b33dea59f54f3807f2d1e1e7872f79f1dbada70
2017-05-03 18:23:15 +00:00
Tom Cherry e4988c9a34 Merge "ueventd: do not reference init's sehandle"
am: 672dd970f4

Change-Id: I12378e6f1917cd31b42db6cde78d2f959bb6e4f5
2017-05-03 18:20:46 +00:00
Tom Cherry 672dd970f4 Merge "ueventd: do not reference init's sehandle" 2017-05-03 18:14:38 +00:00
Christopher Ferris 8d9825533b Merge "Move libc_logging to libasync_safe." am: deb19a631f
am: 1e3dea0034

Change-Id: I836179aa5e5b805017a0393d231fe9005259b013
2017-05-03 17:56:11 +00:00
Christopher Ferris 1e3dea0034 Merge "Move libc_logging to libasync_safe."
am: deb19a631f

Change-Id: Ia1ebf75cd3c0a9640fa5f2367fb40d00ffeca2ad
2017-05-03 17:52:01 +00:00
Christopher Ferris deb19a631f Merge "Move libc_logging to libasync_safe." 2017-05-03 17:43:35 +00:00
Mark Salyzyn 5f82055a2e Merge "libcutils: convert fs_config.cpp" am: c50245e43e
am: a255ab0cb0

Change-Id: Ife5d12b9f4d3924b3903d91cd09e6592f4ee08b8
2017-05-03 16:54:40 +00:00
Mark Salyzyn a255ab0cb0 Merge "libcutils: convert fs_config.cpp"
am: c50245e43e

Change-Id: I0681d0477f9782b0616ee65d8996db716541caab
2017-05-03 16:52:39 +00:00
Treehugger Robot c50245e43e Merge "libcutils: convert fs_config.cpp" 2017-05-03 16:48:44 +00:00
Felipe Leme eed955d7c6 Merge "Don't display bugreport progress when it recedes, for real..." am: 499af38623
am: 35d7f65654

Change-Id: Idcd1af6a3f41b61cd4776ae326ecd2bc19a353a4
2017-05-03 15:30:04 +00:00
Felipe Leme 35d7f65654 Merge "Don't display bugreport progress when it recedes, for real..."
am: 499af38623

Change-Id: I823fc5af425ddd5edfa747929a62a4003fabacbc
2017-05-03 15:27:35 +00:00
Treehugger Robot 499af38623 Merge "Don't display bugreport progress when it recedes, for real..." 2017-05-03 15:21:26 +00:00
Mark Salyzyn 163ecc68c7 libcutils: convert fs_config.cpp
C++ify fs_config.c

Test: gTest libcutils-test
Bug: 37703469
Change-Id: Id48ae22f203ed923942257575296c69b32345ae6
2017-05-03 08:04:35 -07:00
Christopher Ferris ac225780dd Move libc_logging to libasync_safe.
Move the name of the "private/libc_logging.h" header to <async_safe/log.h>.

For use of libc_malloc_debug_backtrace, remove the libc_logging library.
The library now includes the async safe log functions.

Remove the references to libc_logging.cpp in liblog, it isn't needed because
the code is already protected by a check of the __ANDROID__ define.

Test: Compiled and boot bullhead device.
Test: Run debuggerd unit tests.
Test: Run liblog unit tests on target and host.
Test: Run libmemunreachable unit tests (these tests are flaky though).
Change-Id: Ie79d7274febc31f210b610a2c4da958b5304e402
2017-05-02 18:38:46 -07:00
Bowgo Tsai fd13c70104 Merge "init: fix first stage mount failure due to /dev/device-mapper not found" am: 0447a3e5d1
am: ad7c7fe1aa

Change-Id: I50ffa8e1dd0da80e9adb20c072598069fde856ab
2017-05-03 01:38:42 +00:00
Bowgo Tsai ad7c7fe1aa Merge "init: fix first stage mount failure due to /dev/device-mapper not found"
am: 0447a3e5d1

Change-Id: Ie0ad21fc28ea7a692ef7b3dfbb663e8f6f3dfe93
2017-05-03 01:36:11 +00:00
Treehugger Robot 0447a3e5d1 Merge "init: fix first stage mount failure due to /dev/device-mapper not found" 2017-05-03 01:33:07 +00:00
Elliott Hughes d0c0d16b6a Merge "Preserve errno better in native_handle functions." am: dd6e73f432
am: 4b6b4e02ed

Change-Id: I878ed6ea39c72ac21522552ffc4af5210e83a7c1
2017-05-03 01:09:41 +00:00
Elliott Hughes 4b6b4e02ed Merge "Preserve errno better in native_handle functions."
am: dd6e73f432

Change-Id: Idbaadca2f8cdf450b47fc95a7a127e009a17740d
2017-05-03 01:07:09 +00:00
Elliott Hughes dd6e73f432 Merge "Preserve errno better in native_handle functions." 2017-05-03 01:02:21 +00:00
Elliott Hughes 2b0d807531 Merge "Improve "adb sideload" error reporting." am: 66b25eb810
am: f2fe436d32

Change-Id: I38f7972668504f902f3924a0c1872c6f2fad017b
2017-05-03 00:59:08 +00:00
Elliott Hughes f2fe436d32 Merge "Improve "adb sideload" error reporting."
am: 66b25eb810

Change-Id: I46c6ec422611f6f930aa8658f8a91ca41b3b1824
2017-05-03 00:56:08 +00:00
Elliott Hughes 66b25eb810 Merge "Improve "adb sideload" error reporting." 2017-05-03 00:51:09 +00:00
Elliott Hughes 09e794c05d Improve "adb sideload" error reporting.
Rather than quietly fall through to the legacy code with no explanation,
say why the first connection failed, and that the second attempt is only
going to be relevant for folks trying to sideload to a pre-KitKit device.

Before:

  $ adb sideload mysid-ota-424425.zip
  opening 'mysid-ota-424425.zip'...
  connecting...
  falling back to older sideload method...
  error: closed

After:

  $ adb sideload mysid-ota-424425.zip
  adb: sideload connection failed: no devices/emulators found
  adb: trying pre-KitKat sideload method...
  adb: pre-KitKat sideload connection failed: no devices/emulators found

Also switch the legacy code to just read+write blocks rather than trying to
load the whole OTA package into RAM (which is in short supply on Win32).
This is probably of no practical use other than that it lets us report a
better error message (better than "terminate called after throwing an
instance of 'std::bad_alloc'").

Bug: https://issuetracker.google.com/37139736
Test: "adb sideload" with no device/a mysid/an angler
Change-Id: Ia568044aac61bd054301ebfd7fcd5ad5d6f3147a
2017-05-02 14:41:04 -07:00
Felipe Leme 4cc03611cd Don't display bugreport progress when it recedes, for real...
The previous fix was taking account just the progress reported by dumpstate,
not progress/percentage. As such, it was not detecting the cases where the
percentage decreased but the progress didn't.

Bug: 37878670
Test: m -j32 adb_test && ./out/host/linux-x86/nativetest64/adb_test/adb_test --gtest_filter=BugreportTest.*

Change-Id: I5830028f3191a9b17f63aeed5c049b29fa7d1179
2017-05-02 10:08:39 -07:00
Bowgo Tsai ea5fca4cd0 init: fix first stage mount failure due to /dev/device-mapper not found
It has been reported that fs_mgr failed to open /dev/device-mapper
during the first stage mount. It's because other uevent (e.g., i2c
charger device) happens to be sent at the same time we're triggering
the device-mapper uevent to be sent. Current implementation returns
COLDBOOT_STOP unconditionally so it will only process the first received
uevent, leaving device-mapper uevent unhandled when the race happens.

Fix this by only returning COLDBOOT_STOP when the received uevent->path
matches that of device mapper.

Bug: 37745254

Test: first stage mount /vendor with vboot 2.0 (avb) on bullhead
Test: first stage mount /vendor with vboot 1.0 on sailfish
Change-Id: I4a77093ec8f90a5ca981a088f34d082d0270533b
2017-05-03 00:38:43 +08:00
David Zeuthen 1855c98ac2 Merge "adb: Support 'adb enable/disable-verity' when using AVB." am: 8fc6cc8910
am: 2b3a568171

Change-Id: I59cbbdaf00664f17cf04ee56c10f836e8daff0ab
2017-05-02 15:32:28 +00:00
David Zeuthen 2b3a568171 Merge "adb: Support 'adb enable/disable-verity' when using AVB."
am: 8fc6cc8910

Change-Id: I00ac80a2b878525a543e5fe080a9c5b147b0b141
2017-05-02 15:29:57 +00:00
Treehugger Robot 8fc6cc8910 Merge "adb: Support 'adb enable/disable-verity' when using AVB." 2017-05-02 15:24:25 +00:00
David Zeuthen 86da4a42e8 Merge "fs_mgr: Clear AvbOps struct." am: 6ea4f213d8
am: 983d542d49

Change-Id: I77f3230373de0aff17fd66a784b7b25834b97f1b
2017-05-02 13:41:51 +00:00
David Zeuthen 1e033d6804 adb: Support 'adb enable/disable-verity' when using AVB.
Link with libavb_user and use this to enable/disable dm-verity if AVB
is in use.

Bug: 34124301
Test: Manually tested.
Change-Id: Ic03651312b955081cb3c126f6dafc46d6eeec0da
2017-05-02 09:39:55 -04:00
David Zeuthen 983d542d49 Merge "fs_mgr: Clear AvbOps struct."
am: 6ea4f213d8

Change-Id: Ie0e7ff7f1c2c0640912f10d4384f048a49820bea
2017-05-02 13:39:20 +00:00
Treehugger Robot 6ea4f213d8 Merge "fs_mgr: Clear AvbOps struct." 2017-05-02 13:35:58 +00:00
Elliott Hughes bf0492a9a1 Preserve errno better in native_handle functions.
So a caller of native_handle_clone can trust errno to be relevant.

Bug: http://b/37215366
Test: builds
Change-Id: I0992f38ad559db4a02fce07123842dbad8e3f473
2017-05-01 21:34:15 -07:00
Elliott Hughes a404e8ffe8 Merge "Stop writing NUL bytes in adbkey.pub." am: d340c1ebbe
am: 68c9642a9d

Change-Id: Ib0ebb4bd8a88437e221d448c545d7698634cd2ff
2017-05-02 00:56:59 +00:00
Elliott Hughes 68c9642a9d Merge "Stop writing NUL bytes in adbkey.pub."
am: d340c1ebbe

Change-Id: Ia0980152cdd937c440aa42c36577670d1e853eea
2017-05-02 00:55:01 +00:00
Chenjie Luo e49500a041 Merge "Modularize logd." am: ab28acef76
am: c955d890de

Change-Id: I2ab27da508f2a1212d3c0617bbf5037665cf3737
2017-05-02 00:55:00 +00:00