Commit Graph

55342 Commits

Author SHA1 Message Date
Wenhao Wang ce2f1a4761 Add storageproxyd UFS support
This CL enables storageproxyd to run on UFS device.
The proxy prepares and sends SECURITY PROTOCOL IN/OUT commands to UFS
device.

Bug: 143636526
Test: Trusty storage tests
Change-Id: Ibe16578c12b978c9a95deccfb1873081e8d0e994
2019-12-20 15:44:51 -08:00
Nikita Ioffe 018ddd7a6f Unify logic for resetting properties before userspace reboot
Since I was there, added two more properties to reset, and switched
ordering of sys.init.updatable_crashing and
sys.init.updatable_crashing_process_name setprops to make sure that
process name is already set when apexd/PackageWatchdog get's notified
about sys.init.updatable_crashing.

Also fixed a typo in what HandleUserspaceReboot function.

Test: adb reboot userspace
Bug: 135984674
Change-Id: I954ec49aae0734cda1bd833ad68f386ecd808f73
2019-12-20 17:55:13 +00:00
Steven Moreland 0b955f333d Merge "libutils: sp/wp: undef #defines"
am: d5c3fe6952

Change-Id: I7316502cc50efd08247d8f6f5a0b2ba16bbb3a48
2019-12-20 09:09:24 -08:00
Steven Moreland d5c3fe6952 Merge "libutils: sp/wp: undef #defines" 2019-12-20 16:53:28 +00:00
Kiyoung Kim da084f96a5 Merge "Remove ld.config.recovery.txt build"
am: 5bc7941be3

Change-Id: Iacc863f17ab40a829cbef33655e7fd0f3458319d
2019-12-19 23:13:42 -08:00
Kiyoung Kim 5bc7941be3 Merge "Remove ld.config.recovery.txt build" 2019-12-20 07:10:29 +00:00
Jooyung Han 69aa1e0b2c Merge "Add system_ext/apex/*/bin to fs_config"
am: d4502115ad

Change-Id: I53a33754367c0d4d11fbdc62fe83f2d9995d0bca
2019-12-19 21:01:52 -08:00
Treehugger Robot d4502115ad Merge "Add system_ext/apex/*/bin to fs_config" 2019-12-20 04:45:40 +00:00
Kiyoung Kim 9fa9bf4556 Merge "Generate linkerconfig per mount namespaces"
am: 80416f7a80

Change-Id: I1a8b0a9fb4ed9036299efbb985c484ef2dbb5b1d
2019-12-19 19:33:23 -08:00
Kiyoung Kim 80416f7a80 Merge "Generate linkerconfig per mount namespaces" 2019-12-20 03:30:33 +00:00
Christopher Ferris 8726d3a448 Fix handling of possible bad gnu_debugdata_size.
Rather than use a std::vector for backing memory, allocate the memory
using a new with nothrow, and in MemoryBuffer use realloc. Since
the size field is coming from the elf, it could be corrupted or
intentionally crafted to cause problems.

In addition, add some other protections to make sure that overflows
don't occur.

Bug: 146215949

Test: Ran unit tests with jemalloc and scudo to verify that they
Test: both behave the same way.
Change-Id: If14243ce382ba5403a6bacd0ec673452c6b7c3be
2019-12-19 16:48:15 -08:00
Kiyoung Kim e4d3f2123f Generate linkerconfig per mount namespaces
There are two namespaces from init - bootstrap and default - and those
will have different set of APEX modules. To support difference between
two namespaces, linker config should be generated per namespace and each
namespace should use its own linker configuration. As a first step of
the work, this change will create different mount point for each
namespace, and re-generate linker config after APEX mount from each
namespaces.

Bug: 144664390
Test: m -j passed & tested from cuttlefish
Change-Id: Iac2e222376ec4b0ced6c29eed18b21d39ff0b1ba
2019-12-20 09:46:59 +09:00
Steve Muckle af71c45e9a Merge "TEST_MAPPING: add libmodprobe_tests to presubmit"
am: e8537ccfa2

Change-Id: Ie0ce12f2b586e1028b4608da1ee222cba3ec696f
2019-12-19 16:42:08 -08:00
Ruchir Rastogi 33e2002540 Merge "Fix error checking in append_string"
am: e2e2b2d3d3

Change-Id: Ica7e466b74db7f7927ec9855b8a119b454cbc996
2019-12-19 16:41:42 -08:00
Treehugger Robot e8537ccfa2 Merge "TEST_MAPPING: add libmodprobe_tests to presubmit" 2019-12-20 00:38:44 +00:00
Treehugger Robot e2e2b2d3d3 Merge "Fix error checking in append_string" 2019-12-20 00:38:25 +00:00
Nikita Ioffe 36f1dfa144 Merge "Now for real unmount bind-mounts on top of /data"
am: ee08c978d2

Change-Id: Ib5a3d90e8d4e58f6812e9481577e11e6e9aa1ccc
2019-12-19 16:31:51 -08:00
Steven Moreland 243f57bb82 libutils: sp/wp: undef #defines
Seems these undefs are slightly out of sync/out of date.

Bug: N/A
Test: libutils_test
Change-Id: I884ae1ca97754a6459a2c7844264f513eecddaba
2019-12-19 16:17:33 -08:00
Nikita Ioffe 8dbc97f257 Merge "Don't proceed with userspace reboot if device doesn't support it"
am: c9d8d2b7aa

Change-Id: I4cc84170808dc0061016ee405178975f5f075d84
2019-12-19 16:12:07 -08:00
Ruchir Rastogi 3ef6f2e806 Merge "Merge libstatspush_compat and libstatssocket_q"
am: a275bc4b6a

Change-Id: I40fa4a751b11849696729f84f0e510c0bdeb6006
2019-12-19 16:11:43 -08:00
Ruchir Rastogi 1b7d460990 Merge changes from topic "StatsEvent JNI"
am: 0a31673879

Change-Id: I0525a19b92ab2e7d6900d9e8a07f1f02b28c6336
2019-12-19 16:07:17 -08:00
Ruchir Rastogi 5ad4ecbc17 StatsEventCompat
am: 926fa88c35

Change-Id: I12dd19476925ff0dbf91078fa493e29351fd3939
2019-12-19 16:06:48 -08:00
Muhammad Qureshi ba8835c858 Remove libstats/Android.bp
am: a33f81bff5

Change-Id: I4b0886f59dfe6c773662c1dafe4190a8785e21a7
2019-12-19 16:06:13 -08:00
Muhammad Qureshi bf9e1fcf1d Make stats_event write function parameters const
am: 6d5a2fc44d

Change-Id: I05f926f13476b8c87a46f945d3d2d7e7e9dc7aef
2019-12-19 16:05:38 -08:00
Muhammad Qureshi bd0c0b9d63 Create stats_buffer_writer
am: 962cc23b9f

Change-Id: Ie46fc58097da952e0e26bb27f13880c3498b5411
2019-12-19 16:05:11 -08:00
Nikita Ioffe ee08c978d2 Merge "Now for real unmount bind-mounts on top of /data" 2019-12-20 00:01:28 +00:00
Nikita Ioffe c9d8d2b7aa Merge "Don't proceed with userspace reboot if device doesn't support it" 2019-12-19 23:44:06 +00:00
Treehugger Robot a275bc4b6a Merge "Merge libstatspush_compat and libstatssocket_q" 2019-12-19 23:31:55 +00:00
Treehugger Robot 0a31673879 Merge changes from topic "StatsEvent JNI"
* changes:
  Improve stats_event memory usage
  StatsEventCompat
  Remove libstats/Android.bp
  Make stats_event write function parameters const
  Create stats_buffer_writer
2019-12-19 23:31:48 +00:00
Ruchir Rastogi 3bbc240263 Fix error checking in append_string
Test: m -j
Change-Id: Ifa806d5037acb17f83cbf45712e9795d6f56152f
2019-12-19 14:57:10 -08:00
Nikita Ioffe 3d6a5fcb87 Now for real unmount bind-mounts on top of /data
Approach in
https://android-review.googlesource.com/c/platform/system/core/+/1191457
depended on ordering of entries. Instead fs_mgr now tries to unmount
everything with the same block device as /data until timeout is reached.
This is very similar to what is done in UmountPartitions in reboot.cpp,
but I'm a little bit reluctant to merge them together, since the later
unmount all read-write partitions, while here we are only interested in
/data.

Test: on both coral and blueline:
Test: adb shell /system/bin/vdc checkpoint startCheckpoint 1
Test: adb shell setprop sys.init.userdata_remount.force_umount_f2fs 1
Test: adb reboot userspace
Test: verified that userdata was remounted
Bug: 135984674
Change-Id: I929a058fa2f9639f0a2b73e9ea269cf1e07db889
2019-12-19 21:18:42 +00:00
Josh Gao d0cc7eb1ad Merge "adb: use poll instead of select in shell_service."
am: 27fa358d41

Change-Id: Icba2b4ca0304e6808fd9c54215cb816e1ef51d58
2019-12-19 12:26:46 -08:00
Josh Gao 27fa358d41 Merge "adb: use poll instead of select in shell_service." 2019-12-19 20:22:13 +00:00
Steve Muckle e5b327385e TEST_MAPPING: add libmodprobe_tests to presubmit
Bug: 143884053
Test: atest libmodprobe_tests
Change-Id: I0050ebab3ff7c994bd7a67229db9b0a2c8ed8e09
2019-12-19 19:17:08 +00:00
Jooyung Han 08792eb5de Add system_ext/apex/*/bin to fs_config
Flattened APEXes can be installed in /system_ext.
Especially, GSI have both flattened/unflattened apexes so that it can
run with updatable devices and non-updatable devices as well.

Bug: 145963716
Test: flash GSI on P device and boot
Change-Id: I3a941672446a5353517243a851739a66f4252617
2019-12-20 03:54:57 +09:00
Yifan Hong be230af10b libsnapshot: no underscores in test names
This is required for gtest.
Test: run it

Change-Id: I9b0d7ee651c283c00035104d4257d8e8addf4db0
2019-12-19 10:45:54 -08:00
Songchun Fan 2d873010cf Merge "[incremental] create /data/incremental in init.rc"
am: a1344fa6d7

Change-Id: I785b99ca12cd04ef6220013596fed1273df8b86f
2019-12-19 10:18:59 -08:00
Songchun Fan a1344fa6d7 Merge "[incremental] create /data/incremental in init.rc" 2019-12-19 18:14:06 +00:00
Muhammad Qureshi 7da018252b Merge "Create libstatssocket_q"
am: 0ba7842577

Change-Id: Ibb745108290c67e97c2e766d7534bcc4de28c49d
2019-12-19 10:11:09 -08:00
Peter Collingbourne fac30bf6bf Merge "Stop using weak symbols in libvndksupport."
am: 1d789eb210

Change-Id: I774fed449cd64177fd8878b8d719733449e4e93d
2019-12-19 10:03:13 -08:00
Treehugger Robot 0ba7842577 Merge "Create libstatssocket_q" 2019-12-19 17:36:08 +00:00
Peter Collingbourne 1d789eb210 Merge "Stop using weak symbols in libvndksupport." 2019-12-19 17:27:37 +00:00
Kiyoung Kim 986e453d9c Remove ld.config.recovery.txt build
Remove ld.config.recovery.txt build as this will be replaced to be
generated from linkerconfig during build time.

Bug: 146414198
Test: m -j passed
Test: Checked linker config generated under recovery's system/etc
Change-Id: I0d2aa121973c4c99e68f44f4e76e4eab74dc2f95
2019-12-19 16:37:43 +09:00
Ruchir Rastogi 20516da9bc Merge libstatspush_compat and libstatssocket_q
This cleanup makes it clear that there are only two acceptable ways of
logging to the socket: either through libstatspush_compat or
libstatssocket (which will soon be renamed to libstatspush).

Test: m -j
Change-Id: I467b08bc300c2ef394b22422c6acf55a978a380a
Merged-In: I6a49b4995b56df462e1be901ea5e54acfe2e8bac
2019-12-18 17:48:28 -08:00
Ruchir Rastogi 79dd3eaa87 Improve stats_event memory usage
We now truncate the buffer to the appropriate length when clients call
stats_event_build().

Benchmarking tests indicate that truncating the buffer to the
appropriate length increases the cost clients pay to write to the socket
by 2%. This is negligible enough that I decided to truncate the buffer
for both pushed and pulled atoms in order to simplify the API.

Test: m libstatssocket
Test: bit libstatssocket_benchmark:*
Bug: 144126231
Change-Id: I35dec748ff87c0821d0d06779a406997e6e64966
Merged-In: Ife976bb383ecff8de5064730692a95e2a3a82c9d
2019-12-18 17:44:26 -08:00
Ruchir Rastogi 926fa88c35 StatsEventCompat
StatsEventCompat is a wrapper library that toggles between the old
logging scheme and the new logging scheme. It was designed particularly
for the DNS Resolver module and should not be used by others.

We will merge libstatspush_compat and libstatssocket_q in a future CL.

Test: m libstatspush_compat
Test: bit libstatspush_compat_test:* (passes on Q and R)
Bug: 145534143

Change-Id: Ib355031f3573101ea90bd8694861fbfc33b0c788
Merged-In: Idf35ccb6669798166475f08b2fbab40534b5db19
2019-12-18 17:21:27 -08:00
Muhammad Qureshi a33f81bff5 Remove libstats/Android.bp
subdirs is not needed

Test: m -j
Change-Id: Idc034571eadae9c3135324af45fb4cd404ba8dd2
Merged-In: Ia7675fdf2e9a3a19bc52396ccbcc551556958803
2019-12-18 15:26:02 -08:00
Muhammad Qureshi 6d5a2fc44d Make stats_event write function parameters const
Bug: 143968790
Test: bit statsd_test:*
Change-Id: I413accb10cf3de4c5c49eb06a472168b1171039b
Merged-In: I2660cad5400a0e819c60b9caa706bb66ca2eef4f
2019-12-18 15:20:59 -08:00
Muhammad Qureshi 962cc23b9f Create stats_buffer_writer
Move iovec* construction and noteLogLoss from stats_event_list to
stats_buffer_writer.h.
Expose write_buffer_to_statsd that takes in a byte array and writes
it to the statsd socket. Currently exposed for StatsLog.write JNI call.

This change also allows getting rid of stats_event_list once all clients
have migrated to stats_event

Bug: 145619049
Test: m -j libstatssocket
Change-Id: I73f914985421fc1a4f094982c826bf364604b788
Merged-In: I0048e392c2f5039eb70dacf4e91a43d3f32e8749
2019-12-18 15:15:43 -08:00
Muhammad Qureshi a3dcefc079 Create libstatssocket_q
Break up libstatssocket into libstatssocket_q and libstatssocket.
libstatssocket_q is for Q Mainline modules.

Bug: 145569088
Test: m -j
Test: bit statsd_test:*
Test: adb shell cmd stats print-logs && adb logcat "*:S statsd:*"
Change-Id: I2978dd544f4cb17714f3d14d5977cf6b46277ef9
Merged-In: I9d113b37640345ebad6aa269ab710db0d2179671
2019-12-18 15:11:53 -08:00