Commit graph

31650 commits

Author SHA1 Message Date
TreeHugger Robot
bf6e949727 Merge "Change the CHECK failure into function failure." into oc-dev 2017-05-17 03:22:27 +00:00
TreeHugger Robot
165dad791d Merge "Use SO_SNDBUFFORCE instead of SO_SNDBUF" into oc-dev 2017-05-17 02:26:01 +00:00
TreeHugger Robot
fbe9427241 Merge changes from topic 'synchronize_vndk-sp' into oc-dev
* changes:
  add libvndksupport.so to ll-ndk
  libbacktrace is VNDK-SP
  add libvndksupport
2017-05-17 01:53:56 +00:00
Daichi Hirono
3df060d6d0 Change the CHECK failure into function failure.
Previously we have CHECK in WriteInternal function to observe short
writing. However it turns out short write can happen according to the
bug report.

To prevent app from crashing due to CHECK failure, the CL removes the
CHECK and let WriteInternal return a failure value.

Bug: 37561460
Test: libappfuse_tests, manually re-wrote the return value of write()
      and checked logcat.
Change-Id: I6a1e233c3ddb8eb68f59e7c606ad0459b5ca2c6e
2017-05-17 10:30:02 +09:00
Vijay Venkatraman
15042c1e5e Add vendor_available:true to libcrypto_utils
Bug: 38244611
Test: build sailfish
Change-Id: Ieaaf9e03a63124cd1bb79d4c8f6e5d5d4cc7d94b
2017-05-16 11:51:09 -07:00
Bowgo Tsai
d7846a2c53 first stage mount: removing the requirement of by-name prefix for AVB
Current first stage mount for AVB requires specifying a common prefix of
by-name symlink for all AVB partitions. It limits all AVB partitions to be on
the same block device.

firmware {
    android {
        compatible = "android,firmware";
        vbmeta {
            compatible = "android,vbmeta";
            parts = "vbmeta,boot,system,vendor";
            by_name_prefix="/dev/block/platform/soc.0/f9824900.sdhci/by-name"  <-- *removing this*
        };
        fstab {
            compatible = "android,fstab";
            vendor {
                compatible = "android,vendor";
                dev = "/dev/block/platform/soc.0/f9824900.sdhci/by-name/vendor";
                type = "ext4";
                mnt_flags = "ro,barrier=1,inode_readahead_blks=8";
                fsmgr_flags = "wait,avb";
            };
        };
    };
};

For normal mount with AVB, it extracts the by-name prefix of /misc
partition and use it as the prefix for all other partitions:
    - /dev/block/platform/soc.0/f9824900.sdhci/by-name/misc ->
    - /dev/block/platform/soc.0/f9824900.sdhci/by-name/vendor_a

Fix this by adding an internal map in FsManagerAvbOps to record the mapping
from partition name to its by-name symlink:

    ByNameSymlinkMap["vendor_a"] = "/dev/block/platform/soc.0/f9824900.sdhci/by-name/vendor_a"

Two overloaded factory methods are then provided for FsManagerAvbUniquePtr:
    - FsManagerAvbUniquePtr Open(ByNameSymlinkMap&& by_name_symlink_map):
      for first stage mount, where the by-name symlink map will be
      constructed externally, from the uevents processed by init, before
      invoking this factory method.

    - FsManagerAvbUniquePtr Open(const fstab& fstab): for normal mount,
      where the by-name symlink map will be constructed from the input fstab
      internally.

Bug: 37552224
Test: first stage mount /vendor with vboot 1.0
Test: first stage mount /vendor with vboot 2.0 (AVB)
Test: normal mount /vendor with vboot 2.0 (AVB)
Change-Id: Id17e8566da87ea22b8923fcd6e47db8d45bc7d6a
Merged-In: Id17e8566da87ea22b8923fcd6e47db8d45bc7d6a
(cherry picked from commit 20651f62d0)
2017-05-15 16:49:37 +08:00
Bowgo Tsai
1fa0251930 init: moving get_block_device_symlinks() to public API
This is required for init to get by-name symlinks in the first stage
mount with AVB.

Bug: 37552224
Test: first stage mount /vendor with vboot 2.0 (AVB)
Change-Id: Ib067753f651ecea4d4d26215da9294f1c607d95e
Merged-In: Ia0f290542eb1cffce5ae876dfedb453dde960253
2017-05-15 16:49:08 +08:00
Jiyong Park
15d7483bb7 add libvndksupport.so to ll-ndk
libvndksupport.so is a new member of ll-ndk.

Bug: 37323945
Test: sailfish builds and boots

Merged-In: Ic5db48292a30a6face7f263d939f27a0760240b1
Change-Id: Ic5db48292a30a6face7f263d939f27a0760240b1
(cherry picked from commit 7000859b7c)
2017-05-15 11:35:34 +09:00
Jiyong Park
abaab6ff03 libbacktrace is VNDK-SP
libbacktrace and its dependents are now VNDK-SP. Since they are in
/vendor/lib/vndk-sp directory, they are accessible directly from the
vndk namespace. Therefore, libbacktrace is removed from the exported
shared libs list of the default namespace.

Bug: 37413104
Test: sailfish builds and boots
Merged-In: I137c17d55940b783eab6d0125bc4d26b96bcc2f2
Change-Id: I137c17d55940b783eab6d0125bc4d26b96bcc2f2
(cherry picked from commit b2a4b8cd18)
2017-05-15 11:35:34 +09:00
Jiyong Park
8902f7571a add libvndksupport
libvndksupport is a new LL-NDK library that provides vendor-visible APIs
for platform-only functionalities of other LL-NDK libraries. Currently,
it provides android_(load|unload)_sphal_library which abstracts the
platform-only APIs of libdl (android_get_exported_namespace, etc.)

Bug: 37323945
Test: sailfish builds and boots
Test: libvndksupport-tests passes

Merged-In: I6d2911b57e009d0c842554933aac87d6573ffcbf
Change-Id: I6d2911b57e009d0c842554933aac87d6573ffcbf
(cherry picked from commit 7130e13262)
2017-05-15 11:35:30 +09:00
TreeHugger Robot
a7172f41b8 Merge changes I0ff1fc5c,I7a23d3bf into oc-dev
* changes:
  libdebuggerd: print the build fingerprint in fallback.
  libdebuggerd: implement fallback register dumping on arm/aarch64.
2017-05-13 02:25:34 +00:00
Josh Gao
f9b9802ce9 Merge "debuggerd_handler: use syscall(__NR_get[pt]id) instead of get[pt]id." into oc-dev 2017-05-13 00:23:27 +00:00
Josh Gao
a02d0eeb39 libdebuggerd: print the build fingerprint in fallback.
Bug: http://b/37798209
Test: killall -ABRT media.codec on internal
Change-Id: I0ff1fc5ca1e0bcec2c1b2553d6af7099deebfeda
(cherry picked from commit 62f5977d4a)
2017-05-10 17:30:00 -07:00
Josh Gao
92abfb41f3 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
(cherry picked from commit 2e7b8e2d1a)
2017-05-10 17:30:00 -07:00
Josh Gao
8d21697d5c libdebuggerd: implement fallback register dumping on arm/aarch64.
Bug: http://b/35439781
Test: killall -ABRT media.codec on internal
Change-Id: I7a23d3bfcf07ad584e677b2ef5fff28436ef0972
(cherry picked from commit 77b00ed429)
2017-05-10 17:30:00 -07:00
Steve Muckle
f59c55aa7a Revert "disable module loading after BOOT_COMPLETED broadcast"
This reverts commit 6ed19d1675.

Allow devices to decide for themselves whether to allow
module loading after boot.

Bug: 38204366
Test: boot sailfish, load a kernel module
Change-Id: Ib9e77381de9003fb5160463664015a95316ddfc5
2017-05-10 13:39:28 -07:00
TreeHugger Robot
5f68b422bd Merge "fs_mgr_verity: fix androidboot.veritymode=enforcing doesn't work" into oc-dev 2017-05-10 02:22:41 +00:00
Dimitry Ivanov
058b2ea8c5 Explicitly enable greylist for classloader-namespaces
The linker no longer enables greylist by default, it
needs to be explicitly enabled by specifying corresponding
flag.

Bug: https://issuetracker.google.com/38146125
Test: builds
Change-Id: Ib593f2d9a35dbadffb436f5fbc9a2a7a8f64ada0
2017-05-08 22:44:07 -07:00
Bowgo Tsai
87a5b1f992 fs_mgr_verity: fix androidboot.veritymode=enforcing doesn't work
Should set verity mode to VERITY_MODE_DEFAULT when
androidboot.veritymode=enforcing.

Bug: 38103331
Test: `adb shell getprop partition.system.verified` returns 2 when veritymode=enforcing
Test: `adb shell getprop partition.vendor.verified` returns 2 when veritymode=enforcing

(cherry picked from commit 77cbfd6341)

Merged-Id: I2f34eb6509f91989ce726e540cf2c0d353347ede
Change-Id: I2f34eb6509f91989ce726e540cf2c0d353347ede
2017-05-09 09:02:55 +08: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
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
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
Chris Forbes
ba73a138e0 Merge "libutils: Make LightFlattenablePod safe for unaligned ptr" into oc-dev 2017-05-04 20:19:06 +00:00
Chris Forbes
c46cbcbbf9 libutils: Make LightFlattenablePod safe for unaligned ptr
`buffer` may not be correctly aligned here. Assignment assumes correct
alignment and so then blows up on arm32.

Bug: b/37920153
Test: build, boot device
Change-Id: I23ef7c7f1d1511fd912b9485bba955db59e33832
2017-05-04 10:18:26 -07:00
Mark Salyzyn
2350391b8d init: setup keyring before ueventd starts
(cherry pick from commit 4599627492)

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 (from master)
Bug: 37751120
Bug: 36645158
Change-Id: Ieb44fa8f53dda6cf506a6243498c72d7f7f3cde7
2017-05-04 07:13:09 -07:00
TreeHugger Robot
d5398bf97d Merge "update /vendor/*/vndk-sp to /system/*/vndk-sp" into oc-dev 2017-05-04 04:19:33 +00:00
TreeHugger Robot
22d73dd093 Merge "init: fix first stage mount failure due to /dev/device-mapper not found" into oc-dev 2017-05-04 01:00:51 +00:00
Bowgo Tsai
bfc9b6380d 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
Merged-In: I4a77093ec8f90a5ca981a088f34d082d0270533b
(cherry picked from commit ea5fca4cd0)
2017-05-04 08:58:22 +08:00
Daniel Cardenas
6db432daf7 Partial revert of
"libcutils: fs_config.c mark vendor, odm and oem partitions in duplicate"
Revert just the wifi hardware part.

This partially wqreverts commit fde19425f3.
b/37921982

Test: netflix, play movies, youtube
Change-Id: I1a47b66dbc2a74270eb4ef75c3a5b55624c2013d
2017-05-03 12:11:27 -07:00
Felipe Leme
53fd1730b6 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
(cherry picked from commit 4cc03611cd)
2017-05-03 08:22:02 -07:00
Bowgo Tsai
a0c7ee0e76 fs_mgr: set "partition.system.verified" when AVB is used in a A/B device
In a A/B device, system partition is mounted by kernel as root.
In vboot 1.0, the dm device name of system partition is "system" with
the following configuration in kernel command line:
    - dm="system none ro,0 1 android-verity /dev/sda34"

In AVB, the dm device name is switched to vroot as:
    - dm="1 vroot none ro 1,0 5201456 verity 1 ..."

When sending ioctl DM_TABLE_STATUS to query status, we should use "vroot" as the
dm device name for AVB. But still pass "system" for the callback function to set
property [partition.system.verified] instead of [partition.vroot.verified].

Bug: 36900078
Test: Use AVB to mount system in a A/B device, checks the property exists
      [partition.system.verified]
Test: Use vboot 1.0 to mount system in a A/B device, checks the property exists
      [partition.system.verified]
Test: Checks 'adb remount' will output warning message:
        - dm_verity is enabled on the system and vendor partitions.
        - Use "adb disable-verity" to disable verity.

Change-Id: Iaee7eb2b00b03729bc07fa24f1b449488716d2ea
Merged-In: Iaee7eb2b00b03729bc07fa24f1b449488716d2ea
(cherry picked from commit 48fdc292f9)
2017-05-03 12:32:19 +08:00
Jiyong Park
c641e19c7e update /vendor/*/vndk-sp to /system/*/vndk-sp
Some paths weren't updated.

Bug: 37522144
Test: sailfish builds and boots
Change-Id: I7aeb5d6e0d61bbc6bde4e6f221e90b21ca422622
2017-05-03 11:53:03 +09:00
Nick Kralevich
39225a131b Merge "Stop writing NUL bytes in adbkey.pub." into oc-dev 2017-05-02 22:56:55 +00:00
TreeHugger Robot
178b0492ba Merge "Convert libnetutils to Android.bp" into oc-dev 2017-05-02 22:09:25 +00:00
Elliott Hughes
a761231b96 Stop writing NUL bytes in adbkey.pub.
In N we moved some code from C to C++ without realizing that EVP_EncodedLength
includes space for a terminating NUL and EVP_EncodeBlock writes one. Because
our key reading code copes with the NUL, we never noticed.

Distinguish between the required space returned by EVP_EncodedLength and the
actual number of bytes (not including NUL) used return by EVP_EncodeBlock.

Bug: http://b/36187819
Test: hexdump of ~/.android/adbkey.pub

(cherry picked from commit 0b771b33fd)

Change-Id: I6e16b8d48d097b4054417c1d1a225bf7ece985b9
2017-05-02 14:11:49 -07:00
Mark Salyzyn
fde19425f3 libcutils: fs_config.c mark vendor, odm and oem partitions in duplicate
(cherry picked from commit f0b53d0726)
(added "system/vendor/bin/hostapd" to list)

Cover both direct and symlink indirect paths to the referenced
files in the vendor, odm and oem partitions.

Test: compile and hand-verify properties
Bug: 37703469
Change-Id: I5b3a887e904baee2ac193ac4a73aaaee0bbfdb9f
2017-05-02 11:17:54 -07:00
Jiwen Cai
6399d45725 Merge "Add NATIVE_WINDOW_CONSUMER_IS_PROTECTED enum" into oc-dev 2017-05-02 15:59:26 +00:00
TreeHugger Robot
d512ac99d9 Merge "libsysutils: Android.mk -> Android.bp" into oc-dev 2017-05-02 15:36:34 +00:00
Tom Cherry
3ac3c02b25 init: add an initializer for keychord_id_
Add unit test to ensure all POD types of Service are initialized.

Bug: 37855222
Test: Ensure bugreport is triggered via keychord properly.
Test: New unit tests
Merged-In: If2cfea15a74ab417a7b909a60c264cb8eb990de7
Change-Id: If2cfea15a74ab417a7b909a60c264cb8eb990de7
(cherry picked from commit 7da548578c)
2017-05-01 17:32:30 -07:00
Jiwen 'Steve' Cai
faa4c188d0 Add NATIVE_WINDOW_CONSUMER_IS_PROTECTED enum
The enum is being introduced into libnativewindow, but back ported here
since window-deprecated.h is still being depended by other system
componenets.

Bug: 35726763
Test: videoplayer-nodrm-protected.apk and videoplayer-drm-protected.apk
both works.

Change-Id: I9298ff9b1ddd7f868e59db41e1a84e2cdd3d02b5
2017-05-01 16:41:26 -07:00
Bowgo Tsai
e2e0d9cae2 Merge changes I017c8bd9,I262e75b8,I6584bdf7 into oc-dev
* changes:
  init: fix first stage mount failure when two fstab entries have verity_loc
  init: set ro.boot.avb_version in recovery mode
  init: moving early mount logic into init_first_stage.cpp
2017-05-01 15:49:54 +00:00
Colin Cross
56546c0b27 Convert libnetutils to Android.bp
See build/soong/README.md for more information.

Test: m -j checkbuild
Bug: 37567578

cherry picked from cafe889aa8

Merged-In: Ia11dffde6fc4d89be6ee651be06b48131c877dc0
Change-Id: Ia11dffde6fc4d89be6ee651be06b48131c877dc0
2017-04-28 22:22:16 +00:00
Steven Moreland
d303fc62a6 libsysutils: Android.mk -> Android.bp
Test: links
Bug: 37567578
Change-Id: If1d034ecb880e8c41d58b14ebebcda5b72e88424
2017-04-28 14:44:12 -07:00
Keun-young Park
6e53199191 combine wait for exec log with service exit log
- allows easier tracking of wait time from monitoring tools
- this change also reduces unnecessary log spam
- service exit log looks like this:
  init: Service 'exec 4 (/system/bin/otapreopt_slot)' (pid 611) exited with status 0 waiting took 0.060771 seconds

bug: 37752410
Test: reboot and check log

(cherry picked from commit 4de31e1481)

Change-Id: Icb83a6a23b45ebd9b4c9d86ee37df8ee3d6e790a
2017-04-28 14:15:32 -07:00
Abodunrinwa Toki
49f9b4c0d0 Merge "Initialize textclassifier model update directory" into oc-dev 2017-04-28 15:31:05 +00:00
Daichi Hirono
287776ddf4 Use SO_SNDBUFFORCE instead of SO_SNDBUF
When /proc/sys/net/core/wmem_max is smaller than kMaxMessageSize, we
need to override the limitation.

Bug: 37561460
Test: libappfuse_tests

Change-Id: Ibaac8db61290d661459fdc46f0ae8416f7db1d9e
2017-04-28 17:03:06 +09:00
Abodunrinwa Toki
d6ab6456c5 Initialize textclassifier model update directory
Test: Builds successfully. Directory is initialized on install. Tests pass.
bit FrameworksCoreTests:android.view.textclassifier.TextClassificationManagerTest
Bug: 34780396

Merged-In: Icbf7962f11b66579931f48053132da6e03e62c61
Change-Id: Icbf7962f11b66579931f48053132da6e03e62c61
2017-04-28 04:15:57 +01:00
Josh Gao
5fd02a8dbc debuggerd_handler: don't assume that abort message implies fatal.
Applications can set abort messages via android_set_abort_message
without actually aborting. This leads to following non-fatal dumps
printing their output to logcat in the same format as a regular crash.

Bug: http://b/37754992
Test: debuggerd_test
Change-Id: I9c5e942984dfda36448860202b0ff1c2950bdd07
(cherry picked from commit e06f2a4886)
2017-04-27 19:58:47 -07:00
Tom Cherry
704b27bd85 init: fix last_reboot_reason string
This got moved when refactoring the reboot commands.

Bug: 37540660
Test: verify bullhead's last_reboot_reason is correct
Change-Id: I3b86496fc469ca41645df7e7ba8bb51dd25b6b38
(cherry picked from commit 47336cebc3)
2017-04-27 12:52:37 -07:00
TreeHugger Robot
df54d0efc3 Merge "Revert "Remove capability setting for legacy_wifi_hal"" into oc-dev 2017-04-27 03:44:55 +00:00