Commit graph

78411 commits

Author SHA1 Message Date
Christopher Ferris
4cea1cd5ce Merge "Fix thread unwind in CallStack." am: 16909c5fc7
Original change: https://android-review.googlesource.com/c/platform/system/core/+/2215567

Change-Id: I9b652f9d0e3b93b8fd0cf32aac641847977bf680
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-09-13 21:41:34 +00:00
Christopher Ferris
16909c5fc7 Merge "Fix thread unwind in CallStack." 2022-09-13 21:14:02 +00:00
Pete Bentley
fbf5cb06ba Merge "init: Add option to listen on sockets before starting service." am: 39fee4c4c0
Original change: https://android-review.googlesource.com/c/platform/system/core/+/2215044

Change-Id: I3172a5c089e86a4715ae60689bc980fd09271259
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-09-13 11:53:26 +00:00
Pete Bentley
39fee4c4c0 Merge "init: Add option to listen on sockets before starting service." 2022-09-13 11:32:27 +00:00
Treehugger Robot
4ab113b8fd Merge "Explain how to get a tombstone proto." am: 8c8df2284b
Original change: https://android-review.googlesource.com/c/platform/system/core/+/2215564

Change-Id: Id209c8e176cd89ea90b713a41d4fa6a3c69b1d69
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-09-13 02:15:10 +00:00
Treehugger Robot
8c8df2284b Merge "Explain how to get a tombstone proto." 2022-09-13 01:42:12 +00:00
Christopher Ferris
15fee82247 Fix thread unwind in CallStack.
The CallStack unwind of a different thread was broken since it
wasn't properly setting the tid value.

Fix this problem and add new unit tests to verify the behavior.

Bug: 246405269

Test: New unit tests pass.
Test: Ran unit tests for 1000 operations to verify not flaky.
Change-Id: I00342e6cdcdb4bcb68f29734dadee6c987c98040
2022-09-12 18:37:22 -07:00
Elliott Hughes
df2e7eb3cc Explain how to get a tombstone proto.
There's a link here from the javadoc, but a link to the javadoc from
here seems like a good idea.

Test: N/A
Change-Id: I89a29f72d086d08174e72f7d0aa0421fe417f733
2022-09-12 22:24:18 +00:00
Automerger Merge Worker
576de022fa Merge "Merge "libsnapshot: Remove flaky image creation test." into android13-tests-dev am: 220d4aba05" am: 61c82abe24
Original change: https://android-review.googlesource.com/c/platform/system/core/+/2190056

Change-Id: I552eb6d4eb07944f9ff644d040f2799ba070cee6
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-09-12 20:05:22 +00:00
Automerger Merge Worker
61c82abe24 Merge "Merge "libsnapshot: Remove flaky image creation test." into android13-tests-dev am: 220d4aba05" 2022-09-12 18:31:04 +00:00
David Anderson
430867e7cc Merge "libsnapshot: Remove flaky image creation test." into android13-tests-dev am: 220d4aba05
Original change: https://android-review.googlesource.com/c/platform/system/core/+/2190056

Change-Id: I91ca9d97ba751e292dd8f68188470ab6735e68eb
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-09-12 18:31:00 +00:00
Adam Langley
ecc14a5958 init: Add option to listen on sockets before starting service.
Review note: Original change was a p-o-c by agl in
https://r.android.com/2094350 which I think is actually
production quality.  I'm just taking it over so that he doesn't
get spammed by any review comments as that's not a good use
of his time.

Needed for the hardware entropy daemon (see bug).

Original commit message:
If one needs to create a service that synchronously starts listening on
a socket then there are currently no good options.

The traditional UNIX solution is to have the service create the socket
and then daemonise. In this situation, init could start the service with
`exec_start` and yet not block forever because the service forks and
exits. However, when the initial child process exits, init kills the
daemon process:

> init: Killed 1 additional processes from a oneshot process group for
> service 'foo'. This is new behavior, previously child processes
> would not be killed in this case.

Next, there is a `socket` option for services and (although the
documentation didn't nail this down), the socket is created
synchronously by `start`. However, init doesn't call `listen` on the
socket so, until the service starts listening on the socket itself,
clients will get ECONNREFUSED.

This this change adds a `+listen` option, similar to `+passcred` which
allows a socket service to reliably handle connections.

Bug: 243933553
Test: Started prng_seeder from init using the new listen flag
Change-Id: I91b3b2b1fd38cc3d96e19e92b76c8e95788191d5
2022-09-12 15:16:35 +01:00
Suren Baghdasaryan
65a9da7612 Merge "init: Change extra_free_kbytes.sh to add margin relative to the default watermark level" am: 633ce78b94
Original change: https://android-review.googlesource.com/c/platform/system/core/+/2194880

Change-Id: I35745072b0108994cf084cda46dd994f9279c4a0
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-09-09 17:17:33 +00:00
Suren Baghdasaryan
633ce78b94 Merge "init: Change extra_free_kbytes.sh to add margin relative to the default watermark level" 2022-09-09 16:55:25 +00:00
Deyao Ren
f71d80a154 Merge "Clean up services created after running test" am: 2880afb77f
Original change: https://android-review.googlesource.com/c/platform/system/core/+/2209900

Change-Id: I2c9a38b428d8264e1904b73a904d8b82f865b40e
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-09-09 16:50:11 +00:00
Deyao Ren
2880afb77f Merge "Clean up services created after running test" 2022-09-09 16:20:31 +00:00
deyaoren@google.com
909bc47536 Clean up services created after running test
Services created during new tests weren't properly cleaned up after tests. It caused slowdown of subsequent tests as described in b/244486404.
This change kills/terminates services after test with apex services.

To provide some context, original change is at https://android-review.googlesource.com/q/topic:vapex_stop_service. The issue was discovered by android test monitor and filed as a P0 bug.

Bug: 244486404
Change-Id: Ie64e0eb1686e94ef543a457ea49d1d7aeab38c97
2022-09-09 04:15:26 +00:00
Spandan Das
dad50f950b Merge "Declare the headers of the ndk_library" am: a23b5467dc
Original change: https://android-review.googlesource.com/c/platform/system/core/+/2211949

Change-Id: Ifcbd2661f15817318fe882329b501b5b7b4fb182
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-09-09 00:27:24 +00:00
Spandan Das
a23b5467dc Merge "Declare the headers of the ndk_library" 2022-09-08 23:53:18 +00:00
Spandan Das
9b4bc28b43 Declare the headers of the ndk_library
This creates a dependency edge between the ndk_library and its headers,
which should be a no-op in regular Soong builds. This dependency edge
will be used in the Multi-tree project to export the relevant .h files into a well
known location

Test: m nothing
Bug: 239044713
Change-Id: I374b1529456c4c71ac419b4684f2fd215c68e791
2022-09-08 21:59:20 +00:00
David Anderson
9b60fd39e5 Merge "vts_libsnapshot_test: Fix test flakiness." am: 0dfbdc5bdb
Original change: https://android-review.googlesource.com/c/platform/system/core/+/2199352

Change-Id: I83eb0010991c945233bf9dbff56e5322736d8311
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-09-08 20:16:21 +00:00
David Anderson
0dfbdc5bdb Merge "vts_libsnapshot_test: Fix test flakiness." 2022-09-08 19:44:05 +00:00
Suren Baghdasaryan
cfd8864f9a init: Change extra_free_kbytes.sh to add margin relative to the default watermark level
extra_free_kbytes.sh accepts a parameter representing the number of KB
to add to low and high watermarks. It adds this margin to the current
watermark levels, however this is not how /proc/sys/vm/extra_free_kbytes
knob that it replaces used to work. The old knob would add the margin
relative to the original and not the current level of the watermarks.
Change extra_free_kbytes.sh to add the specified margin to the original
watermark levels to act as correct replacement of the old knob.

Bug: 242837506
Fixes: 642048d969 ("init: Add extra_free_kbytes.sh script to adjust watermark_scale_factor")
Test: repeatedly run 'setprop sys.sysctl.extra_free_kbytes 30375'
Signed-off-by: Suren Baghdasaryan <surenb@google.com>
Change-Id: I8af603ba00bd4fb8182b80b3c0969fa96cdd7311
2022-09-08 19:34:43 +00:00
Treehugger Robot
7ce0d570e8 Merge "[LSC] Add LOCAL_LICENSE_KINDS to system/core" am: a5d944f67d
Original change: https://android-review.googlesource.com/c/platform/system/core/+/2210342

Change-Id: I8909574a544fcbb6a5bfd0564a5f934af213d475
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-09-08 17:37:12 +00:00
Treehugger Robot
a5d944f67d Merge "[LSC] Add LOCAL_LICENSE_KINDS to system/core" 2022-09-08 17:03:26 +00:00
Bob Badour
9cf81ccfef [LSC] Add LOCAL_LICENSE_KINDS to system/core
Added SPDX-license-identifier-Apache-2.0 to:
  init/test_upgrade_mte/Android.bp

Bug: 68860345
Bug: 151177513
Bug: 151953481

Test: m all
Change-Id: I77b956ed672a2f171b78ab1e7bfddc09bd0dc158
2022-09-08 15:23:25 +00:00
Treehugger Robot
342cfadb06 Merge "Change log level in mount_with_alternatives()" am: 34386d2d29
Original change: https://android-review.googlesource.com/c/platform/system/core/+/2209039

Change-Id: If9ffc952c9008f017790c6add4defcd640e7542a
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-09-08 13:30:13 +00:00
Treehugger Robot
34386d2d29 Merge "Change log level in mount_with_alternatives()" 2022-09-08 13:12:03 +00:00
Sandro Montanari
8ee78c7c3a Merge "Remove /dev/selinux directory creation from first_stage_init.cpp" am: 4b3c063ac3
Original change: https://android-review.googlesource.com/c/platform/system/core/+/2208840

Change-Id: I8f4dc3e209b5023be3700da39ffeae9d5181555c
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-09-08 09:05:19 +00:00
Sandro Montanari
4b3c063ac3 Merge "Remove /dev/selinux directory creation from first_stage_init.cpp" 2022-09-08 08:37:05 +00:00
David Anderson
7834809350 vts_libsnapshot_test: Fix test flakiness.
This patch fixes a few lingering issues in vts_libsnapshot_test.

The most important fix is a crash in snapuserd when handler deletion
races with the merge monitor thread. Since tests issue lots of
snapshot-related requests in rapid succession, this was easy to hit in
presubmit, and resulted in a null-pointer deref.

SnapuserdClient's CloseConnection does the same thing as the destructor,
but leaves SnapuserdClient in an unusable state. This method is removed
in favor of RAII.

Fix a bug in SnapshotManager where CloseConnection could be called
without zapping snapuserd_client_.

Fix a bug where POLLHUP was checked before calling recv().

Add test name logging so presubmit failures can be diagnosed via logcat
dumps.

Bug: N/A
Test: vts_libsnapshot_test on cuttlefish
Change-Id: I8f22a45e537c24a3c6d327ac47bf8b1352108706
2022-09-07 21:58:03 -07:00
Sandro Montanari
f3ce0486e1 Merge "Create /dev/selinux folder if it was not created by first-stage-init" am: 344f71605c
Original change: https://android-review.googlesource.com/c/platform/system/core/+/2203897

Change-Id: If4d1d10dd9cf313ce574b02d3736371c4663ef75
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-09-07 15:32:45 +00:00
Sandro
d01921034c Remove /dev/selinux directory creation from first_stage_init.cpp
Follow-up from aosp/2203897

Bug: 243923977
Test: m and manual verification
Change-Id: I9e41301d2fe4447906253a5c1249dc6c25cd5218
2022-09-07 15:04:59 +00:00
Sandro Montanari
344f71605c Merge "Create /dev/selinux folder if it was not created by first-stage-init" 2022-09-07 15:01:51 +00:00
Sandro
1120f7f4a9 Create /dev/selinux folder if it was not created by first-stage-init
The /dev/selinux folder is normally created by first-stage-init
https://cs.android.com/android/platform/superproject/+/master:system/core/init/first_stage_init.cpp;l=299-300;drc=07c86bace1e7a7cc4dd975f10b077d21c3743749

However, in some cases the first-stage-init comes from a GKI prebuilt
boot.img and doess not create the required folder (see for example
b/217677967), resulting in bugs like b/244793900.

I modified the selinux.cpp code to create the /dev/selinux folder if it
does not exist already, as a safety measure.

To verify these changes for b/244793900, follow gpaste/4922166775644160

Bug: 243923977
Test: atest SeamendcHostTest, manual verification
Change-Id: I8fe798643b1aeab2b4caac837055348febf70b94
2022-09-07 11:31:47 +00:00
Bowgo Tsai
0db62f43de Change log level in mount_with_alternatives()
mount_with_alternatives() supports mounting any of the
consecutive fstab entries. Some log messages shouldn't
be treated as error so changing log level to INFO instead.

Bug: 245468764
Test: TreeHugger
Change-Id: I94a18d4cf91ee5bb58cf5ba5f853a0e6599071d1
2022-09-07 18:45:36 +08:00
Treehugger Robot
aa83e839b0 Merge "Add fdsan capabilities for native handles" am: 98e474ab43
Original change: https://android-review.googlesource.com/c/platform/system/core/+/2199556

Change-Id: I2a2274988755c33d4eb3719f78bc50638782048b
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-09-06 23:04:33 +00:00
Treehugger Robot
98e474ab43 Merge "Add fdsan capabilities for native handles" 2022-09-06 22:48:31 +00:00
Treehugger Robot
ea5829fa05 Merge "Upgrade MTE to SYNC after ASYNC crash." am: c113dc3a95
Original change: https://android-review.googlesource.com/c/platform/system/core/+/2108595

Change-Id: I23cc0bd580c7c755158bc916d9d9fdbcddb8334c
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-09-06 21:56:38 +00:00
Treehugger Robot
c113dc3a95 Merge "Upgrade MTE to SYNC after ASYNC crash." 2022-09-06 21:29:14 +00:00
Florian Mayer
2ef47f8f6d Upgrade MTE to SYNC after ASYNC crash.
Bug: 169277947
Test: atest mte_ugprade_test on emulator.
Test: ASSUMPTION_FAILED on non-MTE
Test: ASSUMPTION_FAILED on HWASan
Change-Id: I5328d094ffb106abaa548feb76058c9ebd11d745
2022-09-06 20:10:57 +00:00
Treehugger Robot
5caaa2590e Merge "Only run Service::Start() under root" am: 752437b0c7
Original change: https://android-review.googlesource.com/c/platform/system/core/+/2207038

Change-Id: I9f46cc564b7af2b2d098373d0c68a119e398707b
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-09-06 14:11:19 +00:00
Treehugger Robot
752437b0c7 Merge "Only run Service::Start() under root" 2022-09-06 13:52:42 +00:00
Jooyung Han
93c24d7e65 Only run Service::Start() under root
Tests using Service::Start() should run under root. Otherwise tests fail
to start services from the test binary due to lack of permission.

Bug: 244748231
Test: CtsInitTestCases
Change-Id: Ia4eb8457cfad7d44da6b171e44f64238e08af9f7
2022-09-06 10:03:47 +09:00
Yi-yo Chiang
b781344780 Merge "adb-remount-test: Miscellaneous fixes - 2nd round" am: 9a0a9db6af
Original change: https://android-review.googlesource.com/c/platform/system/core/+/2200533

Change-Id: Ida5f5cb3e3209d15d1026258153cfe4ff38fcc92
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-09-05 09:01:21 +00:00
Yi-yo Chiang
9a0a9db6af Merge "adb-remount-test: Miscellaneous fixes - 2nd round" 2022-09-05 08:33:31 +00:00
Yi-yo Chiang
5676d384ef Merge changes I2360314c,I51bd32c6,Icb136327,Id8425488 am: 10b691284c
Original change: https://android-review.googlesource.com/c/platform/system/core/+/2200439

Change-Id: I4248b909181be6cf1d150a92b4716f403494d63b
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-09-05 06:30:47 +00:00
Yi-yo Chiang
10b691284c Merge changes I2360314c,I51bd32c6,Icb136327,Id8425488
* changes:
  adb-remount-test: Refactor test cleanup
  adb-remount-test: Replace libc.so test with build.prop test
  adb-remount-test: Check override_creds only if overlayfs is used
  adb-remount-test: Print log timestamp & auto-detect color
2022-09-05 05:59:36 +00:00
Yi-yo Chiang
6013e1cd3d Merge "adb-remount-test: Refactor raw remount & remount from scratch test" am: 78430afca4
Original change: https://android-review.googlesource.com/c/platform/system/core/+/2199115

Change-Id: I560a66119a8dc9885297417da06f3608f48f82a6
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-09-05 04:16:55 +00:00
Yi-yo Chiang
78430afca4 Merge "adb-remount-test: Refactor raw remount & remount from scratch test" 2022-09-05 03:34:56 +00:00