Commit graph

59494 commits

Author SHA1 Message Date
Tom Cherry
e6e125eef8 Merge "ueventd: bump UEVENT_MSG_LEN to 8192" into rvc-qpr-dev 2020-07-23 19:35:51 +00:00
Tom Cherry
fd9e6e1472 ueventd: bump UEVENT_MSG_LEN to 8192
The previous size, 2048, is only the size of the 'environment' for the
uevent message, but doesn't include the <action>@<dev path> portion.
The <action> portion has a max length < 10, but the <dev path> portion
is unbounded.

8192 should be plenty to capture all of these parameters.

Bug: 161580785
Test: ueventd still works
Merged-In: I6de6fd3a444ac91b3b4df154097abde3696e21b3
Change-Id: I6de6fd3a444ac91b3b4df154097abde3696e21b3
(cherry picked from commit 939b41c79b)
2020-07-23 15:58:09 +00:00
P.Adarsh Reddy
eb568b5582 Ueventd: Fix a corner case in ReadUevent() that triggers duplicate firmware loading.
Presently, within ReadUevent(), true is returned for a successful case
as well as for the case where we read an invalid uevent (overflowed
buffer)where the Uevent object is not cleared, and the caller calls the
callback (with the earlier stored uevent object),leading to duplicate
firmware loading.

Uevent uevent;
while (ReadUevent(&uevent)) {
  if (callback(uevent) == ListenerAction::kStop) return;
}

Scenario:
1. Proper Uevent received and callback is called (firmware loading
   is triggered).
2. Overflowed uevent is received as part of the same ReadUevent session,
   ReadUevent() returns true, but the uevent object is not cleared and
   still has earlier event values.
3. Callback is called again, leading to duplicate firmware load.

Handle it by adding explicit return codes to let the caller know if the
uevent read is invalid, and the caller can ignore it and read
further pending uevents.

Bug: 161580785
Test: in AOSP
Merged-In: I09e80052337fd1495b968dc02ecff5ceb683da18
Change-Id: I09e80052337fd1495b968dc02ecff5ceb683da18
(cherry picked from commit a86bf05a01)
2020-07-23 15:57:52 +00:00
Victor Khimenko
cef328b5da Merge "Make libbacktrace buildable for native_bridge" into rvc-dev am: add3b3a137 am: 7f594d4fc0
Original change: https://googleplex-android-review.googlesource.com/c/platform/system/core/+/12128244

Change-Id: I8ddcd1e23d9401695d37bc648c31b11340d88bb7
2020-07-14 17:53:07 +00:00
Steven Moreland
f106b04519 String16::remove - avoid overflow am: 4048e49956 am: 107f18cb61 am: 9be245c3f0 am: 64fb5012b8 am: 4e27b6992b am: 26b81f59d2 am: 8367a666b5 am: bd6ac4c32c
Original change: https://googleplex-android-review.googlesource.com/c/platform/system/core/+/11619802

Change-Id: I681004c35195b47f0efa30b3cc73c6faeb2467ed
2020-07-14 17:51:44 +00:00
Victor Khimenko
7f594d4fc0 Merge "Make libbacktrace buildable for native_bridge" into rvc-dev am: add3b3a137
Original change: https://googleplex-android-review.googlesource.com/c/platform/system/core/+/12128244

Change-Id: Ibcc0ad2e00559fafdc59abb03caf03edd2ed9bc8
2020-07-14 17:29:53 +00:00
Steven Moreland
bd6ac4c32c String16::remove - avoid overflow am: 4048e49956 am: 107f18cb61 am: 9be245c3f0 am: 64fb5012b8 am: 4e27b6992b am: 26b81f59d2 am: 8367a666b5
Original change: https://googleplex-android-review.googlesource.com/c/platform/system/core/+/11619802

Change-Id: I089a82a0c027667f5eefe769fa73c6a93ebcc532
2020-07-14 17:24:42 +00:00
Victor Khimenko
add3b3a137 Merge "Make libbacktrace buildable for native_bridge" into rvc-dev 2020-07-14 17:18:34 +00:00
Steven Moreland
8367a666b5 String16::remove - avoid overflow am: 4048e49956 am: 107f18cb61 am: 9be245c3f0 am: 64fb5012b8 am: 4e27b6992b am: 26b81f59d2
Original change: https://googleplex-android-review.googlesource.com/c/platform/system/core/+/11619802

Change-Id: Ib4704bc8a733ace56e7998b7bad5a6c5638900ad
2020-07-14 17:03:30 +00:00
Steven Moreland
26b81f59d2 String16::remove - avoid overflow am: 4048e49956 am: 107f18cb61 am: 9be245c3f0 am: 64fb5012b8 am: 4e27b6992b
Original change: https://googleplex-android-review.googlesource.com/c/platform/system/core/+/11619802

Change-Id: Id47901d6e4247aafb9f666ba505ab966d3adefed
2020-07-14 16:45:16 +00:00
Steven Moreland
4e27b6992b String16::remove - avoid overflow am: 4048e49956 am: 107f18cb61 am: 9be245c3f0 am: 64fb5012b8
Original change: https://googleplex-android-review.googlesource.com/c/platform/system/core/+/11619802

Change-Id: I03057c052a24f205c78ee600178d45e0cd51a3c1
2020-07-14 16:29:09 +00:00
Steven Moreland
64fb5012b8 String16::remove - avoid overflow am: 4048e49956 am: 107f18cb61 am: 9be245c3f0
Original change: https://googleplex-android-review.googlesource.com/c/platform/system/core/+/11619802

Change-Id: I3ab9771d898eea0158acfd07fbe5a2f4b7dad883
2020-07-14 16:12:53 +00:00
Steven Moreland
9be245c3f0 String16::remove - avoid overflow am: 4048e49956 am: 107f18cb61
Original change: https://googleplex-android-review.googlesource.com/c/platform/system/core/+/11619802

Change-Id: I22f6b8299b4b77be31859a10b14efe01b297d531
2020-07-14 15:51:29 +00:00
Steven Moreland
107f18cb61 String16::remove - avoid overflow am: 4048e49956
Original change: https://googleplex-android-review.googlesource.com/c/platform/system/core/+/11619802

Change-Id: I4dedf81e3471473e589a858e14d7a9ae5f91b3d9
2020-07-14 15:37:25 +00:00
Ray Essick
2a73835704 extend syscall minijail for clang code coverage am: c8766043aa am: 8ae969d240
Original change: https://googleplex-android-review.googlesource.com/c/platform/system/core/+/12137689

Change-Id: Icdd314fa6d57361aafc49f7a79e0f60808d8bef8
2020-07-13 18:53:04 +00:00
Ray Essick
8ae969d240 extend syscall minijail for clang code coverage am: c8766043aa
Original change: https://googleplex-android-review.googlesource.com/c/platform/system/core/+/12137689

Change-Id: Ibacceb9054ebf91809a8bb05c243d2835be1b77d
2020-07-13 18:43:04 +00:00
Ray Essick
c8766043aa extend syscall minijail for clang code coverage
cutover to clang-based code coverage uses extra system call (ftruncate)
when writing coverage data. exposed while generating coverage for media.extractor.

Bug: 160917521
Test: build, boot, kill -37 extractors for {arm,x86}x{32,64}
Change-Id: I555b168c7aab43caa590df951861b92e8fa14bc3
2020-07-13 08:45:22 -07:00
Victor Khimenko
fb60e6c9ae Make libbacktrace buildable for native_bridge
Bug: http://b/153609531

Test: m -j64 libbacktrace.native_bridge

Change-Id: I2b8a881b4e952f3b68dbcaeb14f147a6d955b406
Merged-In: I2b8a881b4e952f3b68dbcaeb14f147a6d955b406
2020-07-10 20:13:23 +02:00
Tom Cherry
4b125626b5 Merge "init: skip RejectsCriticalAndOneshotService for devices launched before R" into rvc-dev am: 8272339d93 am: 62de73aeb0
Original change: https://googleplex-android-review.googlesource.com/c/platform/system/core/+/12121904

Change-Id: Iaee85692e46ae3d5576ac2cf3ccc1e0c54237778
2020-07-09 23:15:51 +00:00
Tom Cherry
62de73aeb0 Merge "init: skip RejectsCriticalAndOneshotService for devices launched before R" into rvc-dev am: 8272339d93
Original change: https://googleplex-android-review.googlesource.com/c/platform/system/core/+/12121904

Change-Id: I29fbf50c75b2622f95d272b7a76a9ce3a276f6ad
2020-07-09 23:03:50 +00:00
Tom Cherry
8272339d93 Merge "init: skip RejectsCriticalAndOneshotService for devices launched before R" into rvc-dev 2020-07-09 22:53:44 +00:00
Tom Cherry
5c8457ef9a init: skip RejectsCriticalAndOneshotService for devices launched before R
This restriction is only added for devices launching with R or later.

Bug: 160663765
Test: this test runs when appropriate
Merged-In: I2353bfa7f598bd19ba57498cc5bbad7a3ed34707
Change-Id: I2353bfa7f598bd19ba57498cc5bbad7a3ed34707
(cherry picked from commit 0e40ba3183)
2020-07-09 14:36:12 -07:00
Yifan Hong
b69532763d Merge changes I51628abe,I412d62b7 into rvc-dev am: 82e0c384f3 am: 9d3c9c5bfb
Original change: https://googleplex-android-review.googlesource.com/c/platform/system/core/+/12100252

Change-Id: I2fa13d496607793c58b88f46e02495ac8cc8d574
2020-07-08 19:24:58 +00:00
Yifan Hong
9d3c9c5bfb Merge changes I51628abe,I412d62b7 into rvc-dev am: 82e0c384f3
Original change: https://googleplex-android-review.googlesource.com/c/platform/system/core/+/12100252

Change-Id: I7d39ed1dd8e0ab8a153a6e78d71ed818dbbeab1c
2020-07-08 19:11:35 +00:00
Yifan Hong
82e0c384f3 Merge changes I51628abe,I412d62b7 into rvc-dev
* changes:
  Wrap flock with TEMP_FAILURE_RETRY.
  Try locking after mounting metadata
2020-07-08 18:57:30 +00:00
Yifan Hong
bd6d2cded8 Wrap flock with TEMP_FAILURE_RETRY.
flock may return EINTR. There are code using LockShared() to test
existance of the directory. Don't fail spuriously.

Test: pass
Bug: 160457903
Change-Id: I51628abe05599422eb3f344781d8f3acd653c822
2020-07-08 18:57:24 +00:00
Yifan Hong
44033e75cc Try locking after mounting metadata
In rescue mode, if /metadata is mounted but /metadata/ota does
not exist, immediately unmount /metadata and fallback to the code
path when /metadata is not mounted; that is, old partitions are
overwritten.

Test: in recovery, select wipe then immediately sideload
Bug: 160457903
Change-Id: I412d62b7005c81a7126106edc471622e6a7ef813
2020-07-08 11:00:10 +00:00
TreeHugger Robot
f0b6ef433c Merge "Remove SkipMountingPartitions from vendor libfstab" into rvc-dev am: 46a58a5925 am: a54f950e89
Original change: https://googleplex-android-review.googlesource.com/c/platform/system/core/+/12075405

Change-Id: Icd27a5d237831570c36c41a4e9d62a876028998b
2020-07-07 02:43:54 +00:00
TreeHugger Robot
a54f950e89 Merge "Remove SkipMountingPartitions from vendor libfstab" into rvc-dev am: 46a58a5925
Original change: https://googleplex-android-review.googlesource.com/c/platform/system/core/+/12075405

Change-Id: Ie6935fc6c19689dbd6a82c032b9b4ef21eb41bdf
2020-07-07 02:15:46 +00:00
TreeHugger Robot
46a58a5925 Merge "Remove SkipMountingPartitions from vendor libfstab" into rvc-dev 2020-07-07 02:01:59 +00:00
Yifan Hong
d393657b85 Merge "liblp: Force 10.0 metadata on downgrade to Q." into rvc-dev am: 2ce3ddfee1 am: 91033bdb76
Original change: https://googleplex-android-review.googlesource.com/c/platform/system/core/+/12087943

Change-Id: I77cb3fc13680a2abd10b9cf73b5456eba826c38c
2020-07-06 20:47:11 +00:00
Yifan Hong
91033bdb76 Merge "liblp: Force 10.0 metadata on downgrade to Q." into rvc-dev am: 2ce3ddfee1
Original change: https://googleplex-android-review.googlesource.com/c/platform/system/core/+/12087943

Change-Id: I3b3db23e9ab8e4195a47fe68800fdce9e40b769c
2020-07-06 20:32:51 +00:00
Yifan Hong
2ce3ddfee1 Merge "liblp: Force 10.0 metadata on downgrade to Q." into rvc-dev 2020-07-06 20:24:02 +00:00
Yifan Hong
ba5dfd76de liblp: Force 10.0 metadata on downgrade to Q.
Q liblp only supports 10.0 super partition metadata, so
forcefully downgrade the current metadata version too.

On retrofit Virtual A/B devices, the metadata version is
at most 10.1, because the new VIRTUAL_AB flag is not set
on retrofit devices.

In version 10.1, two per-partition flags: UPDATED and DISABLED
are introduced.
- The updated flag is set when the device undergoes a Virtual A/B
update before. Clear it.
- The disabled flag should only be set on metadata files used by
libfiemap ImageManager. It shouldn't be used on super partition metadata.

Hence, this CL should only clear UPDATED flag.

Test: R->R->Q OTA
Bug: 159590481
Change-Id: I8b548c8ce36a75197e7172a77f9207fd44fe4670
2020-07-06 10:06:36 -07:00
Hung-ying Tyan
0a0f4b163a Remove SkipMountingPartitions from vendor libfstab
SkipMountingPartitions() should only be called from a system process
as the config file is in /system_ext.
Remove it from the vendor variant of libfstab.

Bug: 158301941
Test: build hardware/interfaces/boot/1.1/default/boot_control and check symbol
Change-Id: I834183a623c0711dd79b89486fc3fc80f9710801
Merged-In: I834183a623c0711dd79b89486fc3fc80f9710801
(cherry picked from e7cb09d226)
2020-07-03 20:06:37 +08:00
Boleyn Su
419f1c5bbe ReadFileSymbolicLink checks /system/bin/ps am: 9285b496bd am: 7f5d723ead
Original change: https://googleplex-android-review.googlesource.com/c/platform/system/core/+/12066063

Change-Id: I84234b1f19c8ce491261689773630095c2605b85
2020-07-02 19:20:37 +00:00
Boleyn Su
7f5d723ead ReadFileSymbolicLink checks /system/bin/ps am: 9285b496bd
Original change: https://googleplex-android-review.googlesource.com/c/platform/system/core/+/12066063

Change-Id: I8937703c1bade83ca382acdc6f9dc09fff8c4100
2020-07-02 19:12:23 +00:00
Boleyn Su
9285b496bd ReadFileSymbolicLink checks /system/bin/ps
According to
https://android.googlesource.com/platform/build/+/refs/heads/android10-dev/core/Makefile#140,
/default.prop may not be a symbolic link.

Bug: 158552949
Test: atest CtsInitTestCases

Change-Id: I19bde577fa50280e1ed6fb8fdbe846655abb930b
Merged-In: I0d3f96c1656dfe02bfa0e801680f7fa887afd1d9
(cherry picked from commit 6f47feaccdbe849c982e0de9068e38be85006bfb)
(cherry picked from commit 755a3dd78d)
2020-07-02 04:22:10 +00:00
Suren Baghdasaryan
93082029a1 libprocessgroup: Allow vendor profile attributes to override system ones am: d4bc3f2adb am: ca6012a07d
Original change: https://googleplex-android-review.googlesource.com/c/platform/system/core/+/12062649

Change-Id: I5bdbbc95ff9b3b52863fdf0b02a478300b9a49c7
2020-07-02 01:08:15 +00:00
Suren Baghdasaryan
ca6012a07d libprocessgroup: Allow vendor profile attributes to override system ones am: d4bc3f2adb
Original change: https://googleplex-android-review.googlesource.com/c/platform/system/core/+/12062649

Change-Id: I0c0da7ec1fce768ab5f3a7afade66af82ffd85d1
2020-07-02 00:50:37 +00:00
Suren Baghdasaryan
d4bc3f2adb libprocessgroup: Allow vendor profile attributes to override system ones
In the current implementation vendor profile attributes do not override
system ones and instead generate a warning. Fix that by overriding existing
attribute if a new definition is found.

Bug: 160318642
Test: add vendor attributes and confirm no warnings
Signed-off-by: Suren Baghdasaryan <surenb@google.com>
Merged-In: I71a2ee4d4b3c585e7c9a01b791e973390d409cbc
Change-Id: I71a2ee4d4b3c585e7c9a01b791e973390d409cbc
2020-07-01 15:22:04 -07:00
Josh Gao
69556731e7 Merge "adbd: check auth id." into rvc-dev am: d389d983bc am: d477b94d83
Original change: https://googleplex-android-review.googlesource.com/c/platform/system/core/+/11988040

Change-Id: Idb73daae4cea2e6cc949b36aadd795a2118d779c
2020-06-25 23:24:36 +00:00
Josh Gao
d477b94d83 Merge "adbd: check auth id." into rvc-dev am: d389d983bc
Original change: https://googleplex-android-review.googlesource.com/c/platform/system/core/+/11988040

Change-Id: I0269ac16fd5ff35988f4d2f746e055f69ddba98a
2020-06-25 23:09:51 +00:00
Josh Gao
d389d983bc Merge "adbd: check auth id." into rvc-dev 2020-06-25 22:45:47 +00:00
Josh Gao
a5c24c323d adbd: check auth id.
When multiple auth requests come in (e.g. if someone connects over TCP
and USB, or if we send a USB request, and then kill adb and try again),
we need to disambiguate.

Bug: http://b/159061108
Test: manual
Change-Id: I0768dc3c1830456cb8cbd4395c23ef8f193cc420
2020-06-24 16:25:49 -07:00
Keun-young Park
611c753727 Merge "Start statsd before starting zygote" into rvc-dev am: 163548736a am: 544726ece9
Original change: https://googleplex-android-review.googlesource.com/c/platform/system/core/+/11975342

Change-Id: Ie64c81f7e9128a45ffcd653691cecd43ce90e0ad
2020-06-24 21:55:35 +00:00
Keun-young Park
544726ece9 Merge "Start statsd before starting zygote" into rvc-dev am: 163548736a
Original change: https://googleplex-android-review.googlesource.com/c/platform/system/core/+/11975342

Change-Id: I02070f2ced054a4ae75b641aa61d0e0e2213e569
2020-06-24 21:38:28 +00:00
Keun-young Park
163548736a Merge "Start statsd before starting zygote" into rvc-dev 2020-06-24 21:18:18 +00:00
Keun young Park
6423ccd96b Start statsd before starting zygote
- zygote needs statsd for logging boot time event.
- statsd starting later leads into stats logging failure which
  is reported by all child processes of zygote later.
  This brings lots of noise in statsd error.

Bug: 159664734
Test: reboot and check if error log does not show up
  E statsd  : Found dropped events: 1 error -19 last atom tag 240 from uid 10169
Change-Id: Ie585febb50a9668671c8fda41a872595baae8385
2020-06-23 20:40:19 -07:00
Maciej Zenczykowski
094eb1382d Merge "add a new trigger for launching the bpfloader" into rvc-dev am: 227635182f am: a55e0b8f9e
Original change: https://googleplex-android-review.googlesource.com/c/platform/system/core/+/11976442

Change-Id: Ib055da471e0b8f787edd29e41a76a9a790879eda
2020-06-24 03:26:20 +00:00