Commit graph

44726 commits

Author SHA1 Message Date
Josh Gao
965d0c38c8 Merge "debuggerd_handler: demote abort on exec failure to log." 2019-03-19 19:44:43 +00:00
Josh Gao
affe351420 Merge "adbd: support ro.adb.nonblocking_ffs." 2019-03-19 19:44:00 +00:00
Treehugger Robot
0eadef4076 Merge "fs_mgr: overlay: suppress noise associated with test mounting scratch partition" 2019-03-19 18:58:41 +00:00
Yi Kong
63c89a37fd Merge "Suppress -Wstring-plus-int warning" 2019-03-19 18:37:43 +00:00
Treehugger Robot
aaee497db2 Merge "Enable fsverity signature checking" 2019-03-19 16:40:48 +00:00
Roland Levillain
d503239292 Merge "Include tests directories in the linker legacy configuration." 2019-03-19 10:17:10 +00:00
Neil Fuller
ed6b5177e2 Merge "Address syntax / error case nits" 2019-03-19 09:37:55 +00:00
Yi Kong
dd2ea5fd68 Suppress -Wstring-plus-int warning
The code section is already marked as to be removed, simply suppress
the -Wstring-plus-int warning.

Test: m checkbuild
Bug: 128878287
Change-Id: I95a03aca90dbb5d27db49f5baf534cbaacf9b830
2019-03-18 22:16:14 -07:00
Treehugger Robot
588a87d68e Merge "adb: fix uninitialized variable." 2019-03-19 03:14:17 +00:00
Josh Gao
8038e35fdf adbd: support ro.adb.nonblocking_ffs.
Allow disabling ro.adb.nonblocking_ffs via an ro system property, which
gets overridden by the currently supported persist.adb.nonblocking_ffs.

Bug: http://b/128679787
Test: mma
Change-Id: I28891d2da129e9654bf63ab8a4c330c4d2f5b336
2019-03-18 17:59:24 -07:00
Treehugger Robot
8aa059438d Merge "mini-keyctl: use ParseInt to parse keys" 2019-03-19 00:25:52 +00:00
Josh Gao
b019574476 adb: fix uninitialized variable.
Previously, we were initializing IoBlock::pending when submitting a read,
but leaving it uninitialized when doing a write, which would sometimes
result in an assertion firing when we received a previously allocated
block of memory that happened to have a nonzero value in pending.

Test: treehugger
Change-Id: I434c65f554ceed313fea9cfcc98788908f3ca8bc
2019-03-18 17:12:19 -07:00
Treehugger Robot
e16a253cb0 Merge "mini-keyctl cleanup: keep local funcitons static" 2019-03-18 22:08:46 +00:00
Josh Gao
5e8d68c2b2 debuggerd_handler: demote abort on exec failure to log.
If a process is ptraced already, we might not be able to exec crash_dump
due to selinux. Since we can be called for non-fatal events, we
shouldn't abort in that case.

Bug: http://b/128054996
Test: treehugger
Change-Id: I1442041caa7af908df2ab87b9e010c44082e7587
2019-03-18 14:39:47 -07:00
Xiaoyong Zhou
66fc7eb195 Enable fsverity signature checking
This CL enable fsverity signature checking.

Bug: 112038861
Test: cat /proc/sys/fs/verity/require_signatures -> 1
Change-Id: I57aaf6094aa503bdcac93306cafd7f71f202e711
2019-03-18 14:28:18 -07:00
Treehugger Robot
06e6b8551a Merge "Check if we need to Poll for devices after RegenerateUevents" 2019-03-18 21:03:11 +00:00
Victor Hsieh
0fb290bb8a mini-keyctl: use ParseInt to parse keys
- Valid ID format examples: 0x90a, 123
 - ID like 90a will not work now.

Bug: None
Test: mini-keyctl unlink 0x11d25c86 0x2873c96d

Change-Id: I057bce0a49a60f475d54b23e28dc18db25124466
2019-03-18 13:57:05 -07:00
Treehugger Robot
2925a580e9 Merge "adb: Fix return value in error case" 2019-03-18 20:32:46 +00:00
David Anderson
e2d977bffd Merge changes I88689889,Ibfd66734
* changes:
  liblp: Reclaim wasted space from unaligned partitions, v2.
  Revert "liblp: Reclaim wasted space from unaligned partitions."
2019-03-18 20:09:44 +00:00
Mark Salyzyn
60a76f330c fs_mgr: overlay: suppress noise associated with test mounting scratch partition
Add internal fs_mgr_is_ext4 and fs_mgr_is_f2fs to get heads up on
mount failures and thus bypass trying.

Test: adb-remount-test.sh
Bug: 109821005
Change-Id: Ieb1f8c19ced930b6fe2d1791ef710ce528da7e37
2019-03-18 12:50:00 -07:00
Roland Levillain
5c99a0c067 Include tests directories in the linker legacy configuration.
Make ld.config.legacy.txt similar to other linker configurations with
respect to tests in /data/{nativetest,benchmarktest}{,64}.

Note: The linker legacy configuration is used by the ART generic build
targets, defined in project device/generic/art.

Test: ART chroot-based on-device testing using the master-art
Bug: 121117762
Change-Id: I6c8fafa2568862e450aa7b9fea1177a184cb9705
2019-03-18 19:07:32 +00:00
Mark Salyzyn
cdb825e461 Check if we need to Poll for devices after RegenerateUevents
If the required_devices_partition_names is cleared, no need to Poll.

Test: manual check boot time, and adb-remount-test.sh
Bug: 128834849
Change-Id: I044ee2752a7f32b084ff6e88b4b586accdfb78f0
2019-03-18 10:29:48 -07:00
Yifan Hong
830f837231 Merge changes from topic "libprocessgroup"
* changes:
  libprocessgroup: Add VTS tests for vendor JSON files
  libprocessgroup_proto_test split into multiple files
2019-03-18 16:53:47 +00:00
Victor Hsieh
582c7b9b82 mini-keyctl cleanup: keep local funcitons static
Test: build
Bug: None
Change-Id: If58f496173d8afff9eb81ff7f5975ddaac765d18
2019-03-18 09:45:12 -07:00
Treehugger Robot
9555bd40ce Merge "mini-keyctl: support printing security label" 2019-03-18 15:52:28 +00:00
Greg Kaiser
5fe40a66b2 adb: Fix return value in error case
When we introduced __adb_check_server_version() as a function
returning a 'bool', we missed missed converting once instance
of "return -1;" to "return false;".  Thus, we're returning 'true'
in this case as our non-zero value gets implicitly converted to
'true'.

We fix this case as well with this CL.

Test: TreeHugger
Change-Id: I90b01567d927f36d2d963561b676b3bfabfcee49
2019-03-18 07:00:00 -07:00
Dongwon Kang
fc0f79f8a8 Merge "List stable libraries media apex relies on." 2019-03-16 05:34:09 +00:00
Treehugger Robot
b5ac15a936 Merge "adb: avoid sign extension of shell return code." 2019-03-16 04:07:20 +00:00
Treehugger Robot
f09ef56056 Merge "Init: Load fsverity keys earlier" 2019-03-16 02:05:33 +00:00
Treehugger Robot
f2dadd019d Merge "init: add MountHandler property handler" 2019-03-16 01:15:18 +00:00
Dongwon Kang
a013e3d53d List stable libraries media apex relies on.
With allow_all_shared_libs, the libs under /system/lib may be used
instead of libs included in the apex. This change adds stable libraries
the media apex relies on to prevent this case.

Test: dumpsys media.extractor, atest MediaPlayer2Test
Bug: 127791685

Change-Id: I6a0419e6da9e9f48a394257b1e8f977ec2dfa9a1
2019-03-15 17:23:03 -07:00
Yifan Hong
e8e2756f93 libprocessgroup: Add VTS tests for vendor JSON files
Test: vts_processgroup_validate_test
Bug: 123664216
Change-Id: I5518e34cde6fc30195fc99133f86cb23ae3be92f
2019-03-15 16:28:42 -07:00
Victor Hsieh
327037f063 mini-keyctl: support printing security label
Test: mini-keyctl security <key_id>
Bug: 128607724
Change-Id: If92b41d0aa96d626933546391b964ca2a8a48703
2019-03-15 16:01:01 -07:00
Andreas Gampe
e8565ac94a Init: Load fsverity keys earlier
Keys may be required for apex updates (post-installs), so load them
before starting apexd.

Bug: 125474642
Test: m
Test: manual
Change-Id: I32ddb6ae6854334e8ee7e195173ecfaed565d783
2019-03-15 15:14:35 -07:00
Josh Gao
1e1ae45a8c adb: avoid sign extension of shell return code.
Windows has int32_t return codes, which results in return codes 128-255
being sign extended into a negative number. Manually truncate the return
codes we get to preserve their values.

Test: test_device.py on windows
Change-Id: If41d6d469350301704f6ecff72ad17b412db3e04
2019-03-15 14:54:32 -07:00
Josh Gao
eecd5cc532 Merge "adb: attempt to exec newer adb servers on Linux." 2019-03-15 21:54:10 +00:00
Yifan Hong
28a44eb6f6 libprocessgroup_proto_test split into multiple files
... so that they can be reused later.

Also, removed test to strull and inline static constexpr variable.

Bug: 123664216
Test: libprocessgroup_proto_test
Change-Id: Ia6b93c6689d7531e6f597d1387434aed1b3efb0a
2019-03-15 12:34:42 -07:00
Neil Fuller
3b0da85b22 Address syntax / error case nits
Observe some best practices in the APEX symlink
shell commands. No functional changes intended except with error
handling.

Bug: 128687472
Bug: 124106384
Bug: 122985829
Bug: 128249030
Test: make installclean / make droid / inspect one symlink
Change-Id: I099fed5ac8f25cc3911ce0e7ea2b9f74c2172193
2019-03-15 19:05:05 +00:00
Mark Salyzyn
a73ed22cb7 init: add MountHandler property handler
Set properties dev.mnt.blk.<mount_point>=<device_block_class> for mount
and umount operations by setting up an Epoll handler to catch
EPOLLERR or EPOLLPRI signals when /proc/mounts is changed.  Only
update properties associated with block devices.  For the mount
point of /, use the designation of /root instead.

Can use the properties in init rc expansion like:

on property dev.mnt.blk.root=*
    write /sys/block/${dev.mnt.blk.root}/queue/read_ahead_kb ${boot_read_ahead_kb:-2048}

on property dev.mnt.blk.data=*
    write /sys/block/${dev.mnt.blk.data}/queue/read_ahead_kb ${boot_read_ahead_kb:-2048}

on late-fs
    setprop boot_read_ahead_kb 128
    write /sys/block/${dev.mnt.blk.root}/queue/read_ahead_kb ${boot_read_ahead_kb}
    write /sys/block/${dev.mnt.blk.data}/queue/read_ahead_kb ${boot_read_ahead_kb}

Test: boot and inspect getprop results.
Bug: 124072565
Change-Id: I1b8aff44f922ba372cd926de2919c215c40ee874
2019-03-15 11:54:38 -07:00
Elliott Hughes
0e5b74deff Merge "libprocessgroup: PLOG already includes strerror(errno)." 2019-03-15 15:19:22 +00:00
Treehugger Robot
4cd0914048 Merge changes from topic "apex_earlymount_no_bionic_bindmount"
* changes:
  /bionic path is gone
  Revert "Handle adb sync with Bionic under /bionic"
  Don't bind-mount bionic files
2019-03-15 09:02:18 +00:00
Treehugger Robot
da1251d6a5 Merge changes from topic "adb_root_in_user"
* changes:
  Allow overriding ro.debuggable to 1 on USER builds
  adbd: allowing adb root when the device is unlocked
2019-03-15 04:40:43 +00:00
Elliott Hughes
08b4d32139 libprocessgroup: PLOG already includes strerror(errno).
Test: builds
Change-Id: Ic1fe6b46144f7dbeb7ffba5534d94b4dae192d5c
2019-03-14 20:06:36 -07:00
Josh Gao
d10b7c4e02 adb: attempt to exec newer adb servers on Linux.
Test: manual
Change-Id: Iebdfa292f21b2871e6010ab6cc964134fec447e9
2019-03-14 15:41:41 -07:00
Bowgo Tsai
1dacd42ae1 Allow overriding ro.debuggable to 1 on USER builds
When init found "/force_debuggable" in the first-stage ramdisk, it will
do the following if the device is unlocked:
  1. load /system/etc/adb_debug.prop (with ro.debuggable=1)
  2 .load userdebug_plat_sepolicy.cil instead of original plat_sepolicy.cil from
    /system/etc/selinux/.

This make it possible to run VTS on a USER build GSI, by using a special
ramdisk containing "/force_debuggable".

Bug: 126493225
Test: unlock a USER build device, check 'adb root' can work
Change-Id: I9b4317bac1ce92f2c0baa67c83d4b12deba62c92
2019-03-15 06:12:00 +08:00
David Anderson
71fc3f358b liblp: Reclaim wasted space from unaligned partitions, v2.
When allocating a partition with a size that is unaligned (to the
optimal alignment), the remaining sectors are wasted since they are
never reallocated. This is because the free list is guaranteed to only
contain optimally-aligned regions. Unfortunately this means when a
partition is resized, we are wasting a small amount of space each time.
On a non-A/B device, this could wind up being significant.

For example, with an alignment of 512KiB, a 4KiB partition at offset 0
will waste 508KiB of space. The next extent to be allocated by any
partition will start at the next 512KiB.

To address this, we check if the last extent for a partition can be
extended to cover the difference between its last sector and the next
optimally aligned sector. We also verify that this region was not
allocated to any other partition, and does not appear in the free list,
to make sure we're not stealing space that will be used somewhere else.

Bug: 120434950
Test: liblp_test gtest
Change-Id: I88689889d44a4d2c51e659241918aaf2c064e049
2019-03-14 12:09:09 -07:00
Bowgo Tsai
9b30c0a7e6 adbd: allowing adb root when the device is unlocked
As there is no security guarantee when the device is unlocked,
allowing adb root gives us more rooms to debug a USER build images.

Also, this makes it possible to run VTS on a USER build GSI, with
setting ro.debuggable=1 and unlocking the device.

This basically re-lands a reverted change:
https://android-review.googlesource.com/c/platform/system/core/+/437815

Which isn't needed after we moved /sbin/adbd to /system/bin/adbd in
USERDEBUG GSI. But it's still needed for USER build GSI.

Bug: 126493225
Test: unlock a USER build device, check 'adb root' can work
Change-Id: I93f12c8a3fe65c96c947e4602795eadfe591c521
2019-03-15 03:04:46 +08:00
David Anderson
9d3310c019 Merge "libfiemap_writer: Calculate FIBMAP blocks correctly." 2019-03-14 17:08:19 +00:00
Tao Bao
74cece70bc Merge changes from topic "charger-shared-libs"
* changes:
  healthd: Add charger.recovery module.
  healthd: charger uses shared libraries.
2019-03-14 16:56:29 +00:00
Hans Boehm
bca89d7bbc Merge "Revert "Revert "Fix wp and sp comparison bugs""" 2019-03-14 16:55:49 +00:00