Commit graph

32992 commits

Author SHA1 Message Date
Yi Kong
475a448cf8 Merge "Remove unused lambda captures" am: 5b8a92af5d
am: 26f71e6a5a

Change-Id: I0efa39264550dd7b8b741e788729fefc3de427fb
2017-05-06 01:21:00 +00:00
Yi Kong
26f71e6a5a Merge "Remove unused lambda captures"
am: 5b8a92af5d

Change-Id: I3630eb3c17ac328c63a8675eb83893edcd196fb8
2017-05-06 01:18:31 +00:00
Elliott Hughes
4db76b1d69 Merge "Fix macOS build." am: 71feb7b321 am: dcbd2a1501
am: 666b616592

Change-Id: I1dc2a1c18566d89a996020cfafc184da0ff1b65d
2017-05-06 01:15:59 +00:00
Elliott Hughes
666b616592 Merge "Fix macOS build." am: 71feb7b321
am: dcbd2a1501

Change-Id: I544e40b7c09f1c0bfc4bebf986bcd7ea34330163
2017-05-06 01:14:06 +00:00
Treehugger Robot
5b8a92af5d Merge "Remove unused lambda captures" 2017-05-06 01:12:57 +00:00
Elliott Hughes
dcbd2a1501 Merge "Fix macOS build."
am: 71feb7b321

Change-Id: I2d5929947753795593088f3e18f20dc6c071e1a0
2017-05-06 01:11:58 +00:00
Treehugger Robot
71feb7b321 Merge "Fix macOS build." 2017-05-06 01:07:46 +00:00
Bowgo Tsai
a0aaf24d62 fs_mgr_avb: allow verification error when the device is unlocked
Current AVB flow in fs_mgr doesn't allow verification error even if the
device is unlocked. This makes first stage mount fail when the device
is flashed with a different-sized boot.img because there is verification
error (HASH_MISMATCH) for the boot partition.

Fix this by allowing verification error only when the device is
unlocked. Whether to enable dm-verity for HASHTREE partitions is still
controlled by the HASHTREE_DISABLED flag in the top-level vbmeta.

Bug: 37985430
Test: First stage mount /vendor with AVB on a device.
      Check dm-verity is enabled on /vendor.
Test: Unlock device, flash a different-sized boot.img. Boot device and check
      dm-verity is still enabled on /vendor.
Test: First stage mount /vendor with AVB on a device with HASHTREE_DISABLED
      is set on the top-level vbmeta, check dm-verity is not enable on /vendor.

Change-Id: I709431bc1c37e4f86133d171cee8e90621cdb857
Merged-In: I709431bc1c37e4f86133d171cee8e90621cdb857
(cherry picked from commit 1140954877)
2017-05-06 09:02:25 +08:00
Christopher Ferris
47e02f429d Small test fixes.
Bug: 31919199

Test: Ran the unit tests.
Change-Id: I62bdb007f9cfa57e3faaa05993fd6e23ce32b82f
2017-05-05 17:09:49 -07:00
Elliott Hughes
2708a953d2 Give slightly less useless versions to adb and fastboot.
This will let us see (a) whether the user has a legit build or something they
built themselves and (b) what Android release it corresponds to.

This isn't as useful as showing what Platform Tools release we correspond to,
but I'm planning on doing that as a separate line.

Bug: N/A
Test: adb --version ; fastboot --version
Change-Id: Idca489295e3c6f8571146f95822c08808e36b382
2017-05-05 16:29:19 -07:00
Elliott Hughes
4acb36020b Fix macOS build.
system/core/adb/client/usb_libusb.cpp:162:20: error: unused function 'get_device_serial_path' [-Werror,-Wunused-function]
  static std::string get_device_serial_path(libusb_device* device) {
                     ^

Bug: N/A
Test: no choice but to submit and see...
Change-Id: I0026d3273891588c27df5ccd71c41ad9907b038d
2017-05-05 16:26:30 -07:00
Josh Gao
2e7b8e2d1a debuggerd_handler: use syscall(__NR_get[pt]id) instead of get[pt]id.
bionic's cached values for getpid/gettid can be invalid if the crashing
process manually invoked clone to create a thread or process, which
will lead the crash_dump refusing to do anything, because it sees the
actual values.

Use the getpid/gettid syscalls directly to ensure correct values on
this end.

Bug: http://b/37769298
Test: debuggerd_test
Change-Id: I0b1e652beb1a66e564a48b88ed7fa971d61c6ff9
2017-05-05 14:58:12 -07:00
Greg Hackmann
d0307c25a7 Merge changes If7b13672,I96135a8c am: 484acce026 am: 4f152a5f50
am: 6aa8a19427

Change-Id: If4085e37140b25504f20f3363c63a7c95fb342ee
2017-05-05 21:51:45 +00:00
Greg Hackmann
6aa8a19427 Merge changes If7b13672,I96135a8c am: 484acce026
am: 4f152a5f50

Change-Id: I19040cce88d99b55ce2b580caa0086d740aa6a9c
2017-05-05 21:49:45 +00:00
Greg Hackmann
4f152a5f50 Merge changes If7b13672,I96135a8c
am: 484acce026

Change-Id: Ibca5e28523666185c2760dd3918fea674ac44a13
2017-05-05 21:47:53 +00:00
Elliott Hughes
9edecb4d62 Merge "Improve udev failure diagnostics." am: 5ad9ba12df am: 94202c2b9d
am: 1ad393daba

Change-Id: I82a25cd8b6c90730f8597d13fd9950a1b274c7f9
2017-05-05 21:46:01 +00:00
Treehugger Robot
484acce026 Merge changes If7b13672,I96135a8c
* changes:
  AshmemTest: expand ProtTest cases
  AshmemTest: test lseek() and read() on ashmem fds
2017-05-05 21:43:38 +00:00
Elliott Hughes
1ad393daba Merge "Improve udev failure diagnostics." am: 5ad9ba12df
am: 94202c2b9d

Change-Id: I23e5d2622f485f5248cd4d1426b8327b637be7a0
2017-05-05 21:39:14 +00:00
Elliott Hughes
94202c2b9d Merge "Improve udev failure diagnostics."
am: 5ad9ba12df

Change-Id: I6ef9050b822c63ab79fd93bfb86ef96837727904
2017-05-05 21:37:14 +00:00
Tom Cherry
2cbbe9f7a3 init: do not log directly from read_file() and write_file()
Their callers may be able to add more context, so use an error string
to record the error.

Bug: 38038887
Test: boot bullhead
Test: Init unit tests
Change-Id: I46690d1c66e00a4b15cadc6fd0d6b50e990388c3
2017-05-05 14:37:12 -07:00
Tom Cherry
517e1f17cf init: Check DecodeUid() result and use error string
Check the result of DecodeUid() and return failure when uids/gids are
unable to be decoded.

Also, use an error string instead of logging directly such that more
context can be added when decoding fails.

Bug: 38038887
Test: Boot bullhead
Test: Init unit tests
Change-Id: I84c11aa5a8041bf5d2f754ee9af748344b789b37
2017-05-05 14:37:01 -07:00
Elliott Hughes
5ad9ba12df Merge "Improve udev failure diagnostics." 2017-05-05 21:33:56 +00:00
Yi Kong
ae797ec305 Remove unused lambda captures
Test: build
Bug: 37752547
Change-Id: Id318f412ad81b6e7de3ad644cba4405bb04f2729
2017-05-05 14:09:10 -07:00
Greg Hackmann
4a9531d326 AshmemTest: expand ProtTest cases
ashmem buffers start with PROT_EXEC | PROT_READ | PROT_WRITE and can
have bits individually removed (but not added) through the
ASHMEM_SET_PROT_MASK ioctl.  Test that removing prot bits more than once
works, and that the kernel blocks adding prot bits.

Also test that the complementary ASHMEM_GET_PROT_MASK ioctl returns the
expected prot mask.

Test:  /data/nativetest64/libcutils_test/libcutils_test64 \
       --gtest_filter=AshmemTest.* (on hikey)
Test:  /data/nativetest/libcutils_test/libcutils_test32 \
       --gtest_filter=AshmemTest.* (on hikey)

Change-Id: If7b13672547ec4cf6dfd1886197f40f12b2f1c85
Signed-off-by: Greg Hackmann <ghackmann@google.com>
2017-05-05 20:04:12 +00:00
Greg Hackmann
be11d570ec AshmemTest: test lseek() and read() on ashmem fds
ashmem has in-kernel handlers for lseek() and read(), but they aren't
currently being tested.

Add tests for various seeks on a buffer containing holes.  If we land
inside data, then check that we read() the expected data at that offset.

Test:  /data/nativetest64/libcutils_test/libcutils_test64 \
       --gtest_filter=AshmemTest.* (on hikey)
Test:  /data/nativetest/libcutils_test/libcutils_test32 \
       --gtest_filter=AshmemTest.* (on hikey)

Bug: 37254818
Change-Id: I96135a8cea2ce99932e3bc97b5254c95ef6b264a
Signed-off-by: Greg Hackmann <ghackmann@google.com>
2017-05-05 19:58:09 +00:00
Elliott Hughes
cd35664cdc Improve udev failure diagnostics.
A couple of folks had trouble understanding the existing message.

Before:

  8XV7N15917000596	no permissions (udev requires plugdev group membership); see [http://developer.android.com/tools/device.html]

After:

  8XV7N15917000596	no permissions (user buttmunch is not in the plugdev group); see [http://developer.android.com/tools/device.html]

This also fixes a libusb regression where we wouldn't show anything for
devices where we don't have permissions.

Bug: http://b/37707122
Test: ran "adb devices" as user buttmunch
Change-Id: I2fcd735ff4178145432b532a6e4dc8c93b2743fd
2017-05-05 12:50:16 -07:00
Christopher Ferris
ee79c1279e Merge "Use async safe logging in signal handlers." am: fd8fab19df am: 497029004a
am: fc3a649137

Change-Id: I643ae152f2be5c2179df311b93129d9846bcc570
2017-05-05 18:00:59 +00:00
Christopher Ferris
fc3a649137 Merge "Use async safe logging in signal handlers." am: fd8fab19df
am: 497029004a

Change-Id: I57a6d090e10a29cbce035db32b319f70298504c9
2017-05-05 17:58:56 +00:00
Christopher Ferris
497029004a Merge "Use async safe logging in signal handlers."
am: fd8fab19df

Change-Id: I66b41a0d3035439f85acc52e98348de0bba56576
2017-05-05 17:56:59 +00:00
Christopher Ferris
fd8fab19df Merge "Use async safe logging in signal handlers." 2017-05-05 17:49:04 +00:00
Thierry Strudel
cd0ece0752 Merge "fs_mgr_avb: allow verification error when the device is unlocked" am: 7245ab6a11 am: 140d1f51a1
am: 5e953b0397

Change-Id: I50144f63c2f1b7c517f5cc7d9ac0d8b437f5848d
2017-05-05 16:51:21 +00:00
Thierry Strudel
5e953b0397 Merge "fs_mgr_avb: allow verification error when the device is unlocked" am: 7245ab6a11
am: 140d1f51a1

Change-Id: Ib5d33330f4bf4a7542df1f0e29fff8a9ed4fe2e2
2017-05-05 16:47:52 +00:00
Thierry Strudel
140d1f51a1 Merge "fs_mgr_avb: allow verification error when the device is unlocked"
am: 7245ab6a11

Change-Id: Ibdc7cd211aa89ba36735dec25cf8cd3d11fa4da0
2017-05-05 16:45:52 +00:00
Thierry Strudel
7245ab6a11 Merge "fs_mgr_avb: allow verification error when the device is unlocked" 2017-05-05 16:37:26 +00:00
Bowgo Tsai
1140954877 fs_mgr_avb: allow verification error when the device is unlocked
Current AVB flow in fs_mgr doesn't allow verification error even if the
device is unlocked. This makes first stage mount fail when the device
is flashed with a different-sized boot.img because there is verification
error (HASH_MISMATCH) for the boot partition.

Fix this by allowing verification error only when the device is
unlocked. Whether to enable dm-verity for HASHTREE partitions is still
controlled by the HASHTREE_DISABLED flag in the top-level vbmeta.

Bug: 37985430
Test: First stage mount /vendor with AVB on a device.
      Check dm-verity is enabled on /vendor.
Test: Unlock device, flash a different-sized boot.img. Boot device and check
      dm-verity is still enabled on /vendor.
Test: First stage mount /vendor with AVB on a device with HASHTREE_DISABLED
      is set on the top-level vbmeta, check dm-verity is not enable on /vendor.

Change-Id: I709431bc1c37e4f86133d171cee8e90621cdb857
2017-05-05 22:36:40 +08:00
Keun-young Park
ccdc10e371 use passed blk dev name for quota / super block check
am: 886b1b45d5

Change-Id: I8b88e7ca364c5b5fafb16bde116c814825b3d7ed
2017-05-05 06:22:10 +00:00
Keun-young Park
886b1b45d5 use passed blk dev name for quota / super block check
- It was using blk dev name from fstab and quota / super block check was always
  failing for FDE

bug: 37913441
Test: reboot and confirm quota

(cherry picked from commit 9519688411)

Change-Id: Id5613387924d3a8d9ed4486113654aed89184af9
2017-05-04 21:06:59 -07:00
Steven Moreland
bc7edfe56f Merge "trusty/storage/* to Android.bp" am: 1dcd257a21 am: 1561e34bf4
am: 9b7632ef8a

Change-Id: I0cd118b47b1b983012666bd2f79fc78cc1b5128c
2017-05-05 03:47:55 +00:00
Keun-young Park
f7aacf81fa Merge "use passed blk dev name for quota / super block check" am: 7b706c5b9e am: 2f3718c472
am: d31f3a0e9b

Change-Id: I0031690605466dcf7600c162565be5f6d6fd44cf
2017-05-05 03:47:34 +00:00
Steven Moreland
9b7632ef8a Merge "trusty/storage/* to Android.bp" am: 1dcd257a21
am: 1561e34bf4

Change-Id: I2f4ce6cdf6d40f4b31892bf40fed879b19726568
2017-05-05 03:45:55 +00:00
Keun-young Park
d31f3a0e9b Merge "use passed blk dev name for quota / super block check" am: 7b706c5b9e
am: 2f3718c472

Change-Id: Ibcfec15a4022a9639299756aa2fdcd6f03b532b5
2017-05-05 03:45:34 +00:00
Steven Moreland
1561e34bf4 Merge "trusty/storage/* to Android.bp"
am: 1dcd257a21

Change-Id: Ia4397b245c0f34e67f3c3d46193af6bf3331c29c
2017-05-05 03:44:02 +00:00
Keun-young Park
2f3718c472 Merge "use passed blk dev name for quota / super block check"
am: 7b706c5b9e

Change-Id: I24a1f92821c0bd204eb25f0aaa4e46a962565291
2017-05-05 03:40:32 +00:00
Treehugger Robot
1dcd257a21 Merge "trusty/storage/* to Android.bp" 2017-05-05 03:36:06 +00:00
Treehugger Robot
7b706c5b9e Merge "use passed blk dev name for quota / super block check" 2017-05-05 03:33:16 +00:00
Bowgo Tsai
9e6fba7575 Merge "fs_mgr: set "partition.system.verified" when AVB is used in a A/B device" into oc-dev
am: 3ffa3067e5  -s ours

Change-Id: I400e29f1bda4f991a5db30ed22a6bcbdbbc656a9
2017-05-05 02:26:04 +00:00
TreeHugger Robot
3ffa3067e5 Merge "fs_mgr: set "partition.system.verified" when AVB is used in a A/B device" into oc-dev 2017-05-05 02:19:17 +00:00
Keun-young Park
9519688411 use passed blk dev name for quota / super block check
- It was using blk dev name from fstab and quota / super block check was always
  failing for FDE

bug: 37913441
Test: reboot and confirm quota
Change-Id: I8a9e890ef2787f2959e6a0225c6b21d35602f19e
2017-05-04 18:31:06 -07:00
Elliott Hughes
7bf9722175 Merge "Clean up the partition name mapping in fastboot." am: bdbcdf3a16 am: e03caa00ef
am: ec31ac3056

Change-Id: I08b24378aa34c5061cb658c364f87f9cc230bb83
2017-05-05 00:15:19 +00:00
Christopher Ferris
f30a810bce Use async safe logging in signal handlers.
Test: Boot on bullhead.
Test: Ran the libbacktrace tests on bullhead.
Test: Added a temporary log message in the signal handler, and ran the
Test: backtrace tests.
Change-Id: I0a6888c9f311af2c8cc7fbb4929315911bd2bb3c
2017-05-04 17:15:17 -07:00