Commit graph

44977 commits

Author SHA1 Message Date
Josh Gao
770a6a4d46 adbd: reduce the USB buffer sizes to 16k.
Some USB controllers only support 16k writes, so drop down to that.

Bug: http://b/130622010
Test: treehugger
Change-Id: I836d5b2d0d6fcae05f290af11a6a19c6e8d7c1ba
2019-04-16 15:14:24 -07:00
Christopher Ferris
a853a2f8ec Merge "Fix pc/function name for signal handler frame." 2019-04-15 20:29:40 +00:00
David Anderson
2c561d18d8 Merge "liblp: Use ro.boot.slot_suffix rather than ro.build.ab_update." 2019-04-15 18:55:51 +00:00
David Anderson
fcb8b96145 Merge "Handle empty strings in GetPartitionAbsolutePath." 2019-04-15 18:49:56 +00:00
Christopher Ferris
d11ed86d65 Fix pc/function name for signal handler frame.
This refactors the step function slightly to split it up into
distinct pieces since the code needs to handle a signal handler
versus normal step slightly differently.

Add a new error for an invalid elf.

Modify libbacktrace code to handle new error code.

Bug: 130302288

Test: libbacktrace/libunwindstack unit tests.
Change-Id: I3fb9b00c02d2cf2cc5911541bba0346c6f39b8e6
2019-04-12 17:23:18 -07:00
David Anderson
82dee3ea69 liblp: Use ro.boot.slot_suffix rather than ro.build.ab_update.
Bug: 130433329
Test: liblp_test gtests
Change-Id: I229f582dc829884e4e90187981902cd4d45637c6
2019-04-12 16:59:31 -07:00
David Anderson
243887b1e1 Handle empty strings in GetPartitionAbsolutePath.
Bug: N/A
Test: liblp_test gtests
Change-Id: I2440da17aa842d996a37d27b4bfba89ce71321d8
2019-04-12 16:59:30 -07:00
Martin Stjernholm
8a9a1c5056 Merge "Describe the reason for the allow_all_shared_libs from the runtime namespace better." 2019-04-12 15:42:11 +00:00
Treehugger Robot
3569a8817d Merge "fs_mgr: overlay check shared blocks for / if /system is not" 2019-04-12 05:38:03 +00:00
Treehugger Robot
543fdbefe6 Merge "avb_ops: support reading from a logical partition" 2019-04-12 00:04:49 +00:00
Mark Salyzyn
d6ef9d2411 fs_mgr: overlay check shared blocks for / if /system is not
For bringup devices that do not have right-sized partition, and if
/system is now root, check / to be sure.

Consider unshare blocks for ext4 as dead code, provide a strong
message to caller to provide all the dependencies to overlayfs.

Test: adb-remount-test.sh
Bug: 130327601
Change-Id: Iffa7c5f24d8f409e71f89fe9ece274d8c476f6fc
2019-04-11 16:04:54 -07:00
Treehugger Robot
1a17b09174 Merge "Allow fuzzy_fastboot number to run for a specific device serial number" 2019-04-11 22:33:22 +00:00
Treehugger Robot
1af42f6473 Merge "fs_mgr: overlay: only use system_<other> if other slot suffix not blank" 2019-04-11 20:32:32 +00:00
Hridya Valsaraju
b9051a3e65 Allow fuzzy_fastboot number to run for a specific device serial number
Test: ./fuzzy_fastboot --serial=826X003L --gtest_filter=*Logical*
Bug: 117181762
Change-Id: I9dec510aa604b7994f25ce26edb87d7f6ec3e875
2019-04-11 09:52:09 -07:00
Mark Salyzyn
38af717a83 fs_mgr: overlay: only use system_<other> if other slot suffix not blank
Test: adb-remount-test.sh
Bug: 129988285
Change-Id: Ib929d242e7cc4953096eb6300bcf7888ce2259ab
2019-04-11 09:48:45 -07:00
Martin Stjernholm
609236f66c Describe the reason for the allow_all_shared_libs from the runtime namespace
better.

Test: N/A - comment change only
Bug: 119867084
Change-Id: I80743236f95cedc43b8f80ac32a09ac0094f779e
2019-04-11 13:54:44 +01:00
Bowgo Tsai
84d4933686 avb_ops: support reading from a logical partition
On some devices (e.g., emulator), init needs to read AVB footer from
a logical partition because:

   1) Dynamic/logical partition is enabled
   2) The partition is AVB chained, i.e., need to locate footer from the end
   3) Logical partition is not understandable by bootloader,
      but there is no bootloader in this case

Bug: 125540538
Bug: 128434470
Test: boot and force the fallback path, to check it can get logical path
Change-Id: Ie304bce234cbf0f938f386f7ce59235c851e0e2d
2019-04-11 10:58:30 +08:00
Yifan Hong
8bb464c2b4 Merge "charger: Allow to rw /sys/power/[state,wakeup_count]" 2019-04-10 18:34:18 +00:00
Maciej Żenczykowski
c620463f77 Merge "Make the SocketListener control pipe O_CLOEXEC." 2019-04-10 17:49:38 +00:00
Treehugger Robot
54785507f0 Merge "first-stage mount: support using other avb_keys" 2019-04-10 15:29:21 +00:00
David Anderson
ca66aac289 Merge "Fix ART build bustage." 2019-04-10 04:43:48 +00:00
Lorenzo Colitti
dae0195380 Make the SocketListener control pipe O_CLOEXEC.
Children of processes that use SocketListener should not be able
to stop the SocketListener.

Test: builds, boots
Test: atest libsysutils_tests
Test: atest --test-mapping system/netd
Change-Id: I64898d9966f62004468b8e8a43b59be4a81a8cc4
2019-04-10 12:11:42 +09:00
Treehugger Robot
3458bb6ce1 Merge "introduce auditctl and use it to configure SELinux throttling" 2019-04-10 02:29:24 +00:00
Treehugger Robot
15074de25c Merge "fs_mgr: overlay: wait for logical partition to be created" 2019-04-10 02:04:37 +00:00
Treehugger Robot
8b39c113f9 Merge "libmeminfo/procrank: Ignore failures when process disappears." 2019-04-09 23:53:23 +00:00
David Anderson
569bff76fe Fix ART build bustage.
Bug: 130244092
Test: builds
Change-Id: I1e3f7e167716101809d788e5aa41c672046569e0
2019-04-09 23:50:11 +00:00
Mark Salyzyn
4c5d1f8245 fs_mgr: overlay: wait for logical partition to be created
Test: adb-remount-test.sh
Bug: 130238923
Change-Id: Iaff01565d6df5c4434e66f742ed0939f61f6005a
2019-04-09 14:13:48 -07:00
Yifan Hong
122e78248e charger: Allow to rw /sys/power/[state,wakeup_count]
charger needs to suspend the device when the power goes away
when it doesn't have root. These two files are marked with
group system, user system, mode 0600 in 'on boot', but
it is not executed in charger. Hence, move these actions
to 'on init'.

Test: no failure in libsuspend in charger

Bug: 129138950

Change-Id: I787b935b4ff6177601329aeedccdac361b119ca3
Merged-In: I787b935b4ff6177601329aeedccdac361b119ca3
2019-04-09 13:35:07 -07:00
Nick Kralevich
be5e446791 introduce auditctl and use it to configure SELinux throttling
In an effort to ensure that our development community does not
introduce new code without corresponding SELinux changes, Android
closely monitors the number of SELinux denials which occur during
boot. This monitoring occurs both in treehugger, as well as various
dashboards. If SELinux denials are dropped during early boot, this
could result in non-determinism for the various SELinux treehugger
tests.

Introduce /system/bin/auditctl. This tool, model after
https://linux.die.net/man/8/auditctl , allows for configuring the
throttling rate for the kernel auditing system.

Remove any throttling from early boot. This will hopefully reduce
treehugger flakiness by making denial generation more predictible
during early boot.

Reapply the throttling at boot complete, to avoid denial of service
attacks against the auditing subsystem.

Delete pre-existing unittests for logd / SELinux integration. It's
intended that all throttling decisions be made in the kernel, and
shouldn't be a concern of logd.

Bug: 118815957
Test: Perform an operation which generates lots of SELinux denials,
      and count how many occur before and after the time period.
Change-Id: I6c787dbdd4a28208dc854b543e1727ae92e5eeed
2019-04-09 13:19:08 -07:00
Sandeep Patil
ba98e0e857 libmeminfo/procrank: Ignore failures when process disappears.
procrank currently fails if a process gets killed while it is reading
the stats. This behavior is a regression from the previous version of
procrank and is often undesired.

Change procrank to silently ignore the process if it detects that it had
been killed while reading the stats. If the process is still around,
then print a warning about it and continue to read stats for other
processes in the system.

Bug: 130177765
Test: Tested by deliberately killing specific process in ProcessRecord()
      constructor

Change-Id: I701808c3226bb9b3a350ccf8e67fb29b59b0d4e0
Signed-off-by: Sandeep Patil <sspatil@google.com>
2019-04-09 12:31:36 -07:00
David Anderson
9a62481fc7 Merge "Add fiemap_writer_test to VTS." 2019-04-09 18:53:22 +00:00
Treehugger Robot
c5c79d1921 Merge "unzip: support shell globs in include/exclude lists." 2019-04-09 18:53:09 +00:00
Treehugger Robot
265af10e6e Merge "Binding err to inout for raw protocol for in-process execute." 2019-04-09 18:19:23 +00:00
Yifan Hong
b142458ab3 Merge "healthd: charger: shutdown timer configurable" 2019-04-09 16:55:45 +00:00
Christopher Ferris
e9cef73e17 Merge "Remove include of backtrace/Backtrace.h." 2019-04-09 15:59:10 +00:00
Bowgo Tsai
a0f8b05d91 first-stage mount: support using other avb_keys
This change allows specifying additional avb keys to verify a fstab
entry. It can be used together with the original 'avb' flag. When both
'avb' and 'avb_keys' are present, it will try to use avb_keys to verify
this partition and extract the AVB descriptor from the end of it first.
When avb_key fails, it falls back to searching the AVB descriptor in the
built-in /vbmeta (and its chained partitions) with the matched partition
name.

An example of a fstab file:

system  /system  ext4  ro,barrier=1  wait,slotselect,avb=vbmeta,logical,first_stage_mount,avb_keys=/avb/gsi.avbpubkey
vendor  /vendor  ext4  ro,barrier=1  wait,slotselect,avb,logical,first_stage_mount

The overhead of adding an additional 'avb_keys' should not be significant,
as the typical size of a AVB Hashtree descriptor for /system is usually
less than 1000 bytes. e.g., on crosshatch, it's about 600 bytes, which
takes less than 1 millisecond for the following call to return failure.

   auto avb_standalone_handle = AvbHandle::LoadAndVerifyVbmeta(*fstab_entry);

We also checked the time spent on init's first stage on crosshatch, with the
following CL to set ro.boottime.init.first_stage. The testing result
shows no significant difference between them as well.

https://android-review.googlesource.com/c/platform/system/core/+/934536

With an additional avb_keys entry for /system
    [ro.boottime.init.first_stage]: [728]
    [ro.boottime.init.first_stage]: [720]
    [ro.boottime.init.first_stage]: [722]

Without an additional avb_keys entry for /system
    [ro.boottime.init.first_stage]: [730]
    [ro.boottime.init.first_stage]: [728]
    [ro.boottime.init.first_stage]: [725]

Bug: 124491153
Test: boot a device with above fstab settings

Change-Id: I0c81f816efb0dd40c93da2df304f2e215df9d105
2019-04-09 13:38:05 +00:00
Alex Buynytskyy
704c97d6c2 Binding err to inout for raw protocol for in-process execute.
As raw protocol does not allow for splitting err - it has to be redirected to inout.
Before this change it was not done for in-process and all err data was lost.

Bug: 130086616
Test: manual + atest adbd_test
Change-Id: I6cd11c940673d73e2993a6eb23c46d31bd8bf504
2019-04-08 19:16:05 -07:00
Christopher Ferris
3336c7bce0 Remove include of backtrace/Backtrace.h.
Somehow the code was still including this include from libbacktrace.
I think the libbacktrace include directory was coming from some
transitive includes. I verified that nothing in debuggerd is using
the libbacktace.so shared library.

Bug: 120606663

Test: Builds, unit tests pass.
Change-Id: I85c2837c5a539ccefc5a7140949988058d21697a
2019-04-08 17:18:24 -07:00
Treehugger Robot
f4ccb804b6 Merge "Test is-logical command for vendor and boot partitions." 2019-04-08 22:27:13 +00:00
Treehugger Robot
198536e321 Merge "mini-keyctl: move logs to stdout" 2019-04-08 21:34:24 +00:00
Elliott Hughes
5f8b309883 unzip: support shell globs in include/exclude lists.
Bug: http://b/113928508
Test: manual
Change-Id: Ic9b11486ce07bf3b385e0c1180c4d1bde61d1628
2019-04-08 12:46:56 -07:00
John Zhao
5cac100e3d healthd: charger: shutdown timer configurable
config the shutdown timer via the property system
for vendor customize.

Bug: 129599884
Test: setprop ro.product.charger.unplugged_shutdown_time 5000
      getprop ro.product.charger.unplugged_shutdown_time
      5000
      dmesg:
          charger: [371812] device unplugged:
                   shutting down in [5000] (@ 421812)

Change-Id: Ifa377cdb8e100c453346522a3eb93379fd7e2567
Signed-off-by: John Zhao <yuankuiz@qualcomm.corp-partner.google.com>
2019-04-08 12:46:47 -07:00
Victor Hsieh
b20e062ff9 mini-keyctl: move logs to stdout
Also, print key id in padd/add like keyctl(1).  This makes local
debugging and integration test easier.

Test: run all commands manually in shell, see expected output
Bug: None
Change-Id: I6be6ea9e273e80e7d5848da5cf348da8308a62c1
2019-04-08 10:59:54 -07:00
Mark Salyzyn
f14652c30b Merge "init: fixes to README.mk" 2019-04-08 17:10:25 +00:00
Mark Salyzyn
b833d17de2 init: fixes to README.mk
Corrected a few technical, spelling and grammar errors.

Test: none
Bug: 129780532
Change-Id: Ia05f44c782d94a3bb4224fc6929ac325852e0c41
2019-04-08 10:06:49 -07:00
Nick Kralevich
ba80ab1373 Merge "zip_archive.cc: Use static cast instead of masking" 2019-04-08 16:23:51 +00:00
Nick Kralevich
9780fc3511 Merge "zip_writer_test.cc: fix implicit integer truncation" 2019-04-08 16:23:20 +00:00
Treehugger Robot
66b0c31f60 Merge "Increase adb-remount timeout" 2019-04-08 15:13:47 +00:00
Treehugger Robot
8e5bd5a247 Merge "Update GSI keys for dynamic system image" 2019-04-08 13:41:47 +00:00
Treehugger Robot
b626177d63 Merge "Revert "Check for data races when reading JIT/DEX entries."" 2019-04-06 17:09:10 +00:00