Commit graph

79914 commits

Author SHA1 Message Date
Treehugger Robot
455aba6afe Merge "Revert "init: Fix a race condition in KillProcessGroup()"" am: 4cdb6cf415
Original change: https://android-review.googlesource.com/c/platform/system/core/+/2302566

Change-Id: I3e0fae688563a4ffc426749007fe34f1e658ae4b
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-11-15 02:51:42 +00:00
Treehugger Robot
4cdb6cf415 Merge "Revert "init: Fix a race condition in KillProcessGroup()"" 2022-11-15 02:07:02 +00:00
Bart Van Assche
f26e59ebba Revert "init: Fix a race condition in KillProcessGroup()"
This reverts commit 15e5ecdcd7.

Reason for revert: breaks console support.
Bug: 213617178
Bug: 258754901
Change-Id: Iffe213e2cd295461a427621f2b84933f1bebd39f
2022-11-15 00:55:45 +00:00
Treehugger Robot
b16e22376e Merge "riscv64 doesn't require a 32-bit crash dump policy." am: 0d681e1f96
Original change: https://android-review.googlesource.com/c/platform/system/core/+/2302477

Change-Id: If9ffd2efba716d3b10fbe2033e76a0417b2aedaf
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-11-14 22:22:18 +00:00
Treehugger Robot
0d681e1f96 Merge "riscv64 doesn't require a 32-bit crash dump policy." 2022-11-14 21:37:42 +00:00
Elliott Hughes
2f883314b9 riscv64 doesn't require a 32-bit crash dump policy.
Test: `mm -j` in bionic
Change-Id: I6c2e91b540f544b1ca428692ebfb25697b0cb6e4
2022-11-14 20:06:16 +00:00
Yi-yo Chiang
66e3f01be9 Merge changes Iba86a814,If5d702ab am: 4b507bcdf3
Original change: https://android-review.googlesource.com/c/platform/system/core/+/2294138

Change-Id: Ice335ae1762578e0df34332868a158bbc9213c1b
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-11-14 08:49:31 +00:00
Yi-yo Chiang
4b507bcdf3 Merge changes Iba86a814,If5d702ab
* changes:
  remount: Remove all remaining opaque exit code (RemountStatus enum)
  remount: Don't assert ro.boot.vbmeta.* properties
2022-11-14 08:16:45 +00:00
Yi-yo Chiang
48b09efd50 Merge "remount: Simplify disable verity logic" am: d1b270abb2
Original change: https://android-review.googlesource.com/c/platform/system/core/+/2284553

Change-Id: Iad5ee139641c1c8b8ecb862153e1058bdd46dd2b
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-11-14 07:21:11 +00:00
Yi-yo Chiang
6305b0c1ab Merge "set-verity-state: Use ro.boot.veritymode to determine current verity state" am: d40fd73e62
Original change: https://android-review.googlesource.com/c/platform/system/core/+/2284293

Change-Id: I9d004b9eb9cfdc3b91d88ac1f8aebe64e2c5303c
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-11-14 07:21:02 +00:00
Jooyung Han
520b408009 Merge "Revert "add apex-ready event after post-fs-data"" am: d9d3a5cb2b
Original change: https://android-review.googlesource.com/c/platform/system/core/+/2294239

Change-Id: I7d11517140e04c10673d12eefe4941ef6971d463
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-11-14 07:20:52 +00:00
Yi-yo Chiang
d1b270abb2 Merge "remount: Simplify disable verity logic" 2022-11-14 07:13:27 +00:00
Yi-yo Chiang
d40fd73e62 Merge "set-verity-state: Use ro.boot.veritymode to determine current verity state" 2022-11-14 07:00:48 +00:00
Jooyung Han
d9d3a5cb2b Merge "Revert "add apex-ready event after post-fs-data"" 2022-11-14 06:51:14 +00:00
Treehugger Robot
65b4b8f13c Merge "Remove a file we haven't built since 2013." am: c14cda00a8
Original change: https://android-review.googlesource.com/c/platform/system/core/+/2299260

Change-Id: Ia2da2c39d7f1aeec611db0a1a53bf60c8babe62a
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-11-11 23:50:38 +00:00
Treehugger Robot
c14cda00a8 Merge "Remove a file we haven't built since 2013." 2022-11-11 23:28:50 +00:00
Elliott Hughes
8a9495aba6 Remove a file we haven't built since 2013.
It was only added in 2012, so it's been dead for 10 times longer than it
was ever built for at this point... YAGNI.

Test: treehugger
Change-Id: I6f31a3d1354f4d3304da463322cd1d9eff9e0597
2022-11-11 21:56:34 +00:00
Treehugger Robot
9955a72de7 Merge "Replace exit codes with EXIT_SUCCESS and EXIT_FAILURE." am: 1dcc32555e
Original change: https://android-review.googlesource.com/c/platform/system/core/+/2298858

Change-Id: I18182d2d25253edf5caf58b3955e49fcdd91ea42
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-11-11 18:10:19 +00:00
Treehugger Robot
a4efa03188 Merge "Fix clang error about incompatible assignment in simg2simg.cpp" am: e231eed81c
Original change: https://android-review.googlesource.com/c/platform/system/core/+/2298857

Change-Id: I983d5961e6017cbaf6e78039c514bb38f446107d
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-11-11 18:10:09 +00:00
Treehugger Robot
1dcc32555e Merge "Replace exit codes with EXIT_SUCCESS and EXIT_FAILURE." 2022-11-11 17:37:25 +00:00
Treehugger Robot
e231eed81c Merge "Fix clang error about incompatible assignment in simg2simg.cpp" 2022-11-11 17:33:25 +00:00
Victor Chang
9cb47d1cd6 Merge "Revert "Add ::1 to localhost in etc/hosts"" am: f6a35e2c5f
Original change: https://android-review.googlesource.com/c/platform/system/core/+/2300417

Change-Id: I4fc1a451423ddeb657872c92acd5194f3f19bc56
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-11-11 15:58:42 +00:00
Victor Chang
f6a35e2c5f Merge "Revert "Add ::1 to localhost in etc/hosts"" 2022-11-11 15:36:13 +00:00
Victor Chang
1498382581 Revert "Add ::1 to localhost in etc/hosts"
Revert submission 2291455-localhost_v6

Reason for revert: b/258627476
Reverted Changes:
Icd11fab47:[Test] Update test to comply with etc/hosts change...
Ibcee52a14:Add ::1 to localhost in etc/hosts

Bug: 258627476
Change-Id: I42c8b0aebdbd8b73a90606c0a999f25d8d071cd1
2022-11-11 12:26:49 +00:00
rapperskull
c91d1a6b17 Replace exit codes with EXIT_SUCCESS and EXIT_FAILURE.
Change-Id: I6777420892629ea6705806ba624ffb200d395114
2022-11-10 21:24:40 +01:00
Seth Moore
1dfb0be4a8 Merge "Add dependency on split out RKP HAL" am: 7e17f702e4
Original change: https://android-review.googlesource.com/c/platform/system/core/+/2295978

Change-Id: I6c49a688a160fd6804198108f5a8f083bc50ea22
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-11-10 20:18:54 +00:00
rapperskull
9cc8a29e33 Fix clang error about incompatible assignment in simg2simg.cpp
Change-Id: Ibb5c9431e51525c083e2981979e831d7f0b8ea1d
2022-11-10 20:42:10 +01:00
Seth Moore
7e17f702e4 Merge "Add dependency on split out RKP HAL" 2022-11-10 19:32:31 +00:00
Treehugger Robot
d07af196a9 Merge "init: Fix a race condition in KillProcessGroup()" am: 7f046419f8
Original change: https://android-review.googlesource.com/c/platform/system/core/+/2287913

Change-Id: I7297c705787b87da86223a21f10c85d3caae2e57
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-11-10 19:10:17 +00:00
Treehugger Robot
7f046419f8 Merge "init: Fix a race condition in KillProcessGroup()" 2022-11-10 18:58:04 +00:00
Sandeep Dhavale
4a7ffda8cb Merge "Fastbootd: Use Fastboot AIDL with the help of fastbootshim for legacy fastboot HAL" am: 7a866d5ac2
Original change: https://android-review.googlesource.com/c/platform/system/core/+/2293178

Change-Id: I93322fce25f02c679bab2f05b96db6e8b06b572b
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-11-10 18:55:35 +00:00
Sandeep Dhavale
7a866d5ac2 Merge "Fastbootd: Use Fastboot AIDL with the help of fastbootshim for legacy fastboot HAL" 2022-11-10 18:29:00 +00:00
Bart Van Assche
15e5ecdcd7 init: Fix a race condition in KillProcessGroup()
Multiple tests in CtsInitTestCases, e.g. RebootTest#StopServicesSIGKILL,
can trigger the following race condition:
* A service is started. This involves calling fork() and also to call
  RunService() in the child process. RunService() calls setpgid().
* Service::Stop() is called and calls KillProcessGroup().
  KillProcessGroup() calls kill(-pgid, SIGKILL) before the child process
  has called setpgid(). pgid is the process ID of the child process. The
  kill() call fails because setpgid() has not yet been called.

Fix this race condition by adding a setpgid() call in the parent process
and by waiting from the parent until the child has called setsid() if a
console is attached.

Bug: 213617178
Test: Cuttlefish + atest 'CtsInitTestCases'
Change-Id: I6931cd579e607c247b4f79a5b375455ca3d52e29
Signed-off-by: Bart Van Assche <bvanassche@google.com>
2022-11-10 09:08:21 -08:00
Ken Chen
7879a8e04c Merge "Add ::1 to localhost in etc/hosts" am: f7a95c879e
Original change: https://android-review.googlesource.com/c/platform/system/core/+/2291455

Change-Id: Ifb194bd9623fe96b20f7902be360413fc5b2158f
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-11-10 08:48:45 +00:00
Ken Chen
f7a95c879e Merge "Add ::1 to localhost in etc/hosts" 2022-11-10 08:19:07 +00:00
Seth Moore
8fbbf06f0c Add dependency on split out RKP HAL
Bug: 254112961
Test: vts_treble_vintf_vendor_test
Merged-In: I9dcb9b94b0e22466cd42592f4921eec3e4fcb13d
Change-Id: I9dcb9b94b0e22466cd42592f4921eec3e4fcb13d
2022-11-09 10:54:51 -08:00
Inseob Kim
61f38dd730 Merge "Don't unmount APEXes in microdroid" am: cb4c7d56e8
Original change: https://android-review.googlesource.com/c/platform/system/core/+/2294237

Change-Id: Ibe273945434c3dd3f67e3ea18293eb8537a8fc2e
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-11-09 10:09:29 +00:00
Inseob Kim
cb4c7d56e8 Merge "Don't unmount APEXes in microdroid" 2022-11-09 09:57:09 +00:00
Yi-yo Chiang
1fcac75ddc Merge changes from topic "merge_set-verity-state_with_remount" am: 2a501a11dc
Original change: https://android-review.googlesource.com/c/platform/system/core/+/2278463

Change-Id: I425f5ea813fac606aa72bc49bfc92c1f13aa0c05
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-11-09 09:53:38 +00:00
Yi-Yo Chiang
181597aa62 remount: Use MyLogger class and sundry improvements am: a799a58842
Original change: https://android-review.googlesource.com/c/platform/system/core/+/2278462

Change-Id: I0392e3f10eb70eb7fe025830ca11dca9729b41a9
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-11-09 09:53:36 +00:00
Yi-Yo Chiang
dea063b65d remount: Remove all remaining opaque exit code (RemountStatus enum)
All errors are already logged and the exit code is not used anywhere by
anyone.
Functions should instead return (true/false) or
(EXIT_SUCCESS/EXIT_FAILURE) to indicate error state, and log error
reasons to logd and stderr.

Bug: 241688845
Test: adb-remount-test
Change-Id: Iba86a814a75f81ed0f6e43659d1aca72813824bc
2022-11-09 17:12:39 +08:00
Yi-Yo Chiang
99ec013d58 remount: Simplify disable verity logic
We are calling avb_user_verity_set() _for each_ fstab entry in order to
disable verity. This is an artifact from back when each partition has
its own verity flag (VB1.0). Since AVB, the verity flag in vbmeta
affects all dm-verity device, thus we only need to call
avb_user_verity_set() once.

Bug: 241688845
Test: adb-remount-test
Change-Id: Ie5b788e2d34f83152228db62f84d26a32e2b26e0
2022-11-09 17:12:39 +08:00
Yi-Yo Chiang
6be7351bab remount: Don't assert ro.boot.vbmeta.* properties
ro.boot.vbmeta.* properties could be missing if device is verification
disabled.
Instead use ro.boot.verifiedbootstate to check device locked state.
No need to check ro.boot.vbmeta.digest, as we no longer support VB1.0.
In other words, all device running this piece of code must be using AVB.

Bug: 241688845
Test: adb-remount-test
Change-Id: If5d702ab3a6f12deef8204dba698e6c62eaae46f
2022-11-09 17:12:39 +08:00
Yi-Yo Chiang
ab4dd01395 set-verity-state: Use ro.boot.veritymode to determine current verity state
On a device that don't use overlayfs remount (e.g. no EXT4 dup blocks;
this can be simulated by patching fs_mgr_wants_overlayfs()), if we run
disable-verity or enable-verity twice in a row then the second
invocation would not suggest a reboot:

  adb disable-verity
  > Successfully disabled verity
  > Reboot to take effect...
  adb disable-verity
  > Verity is already disabled
              ^^^ this is WRONG! verity is disabled only after a reboot

It behaves like this because it suggest a reboot only if the vbmeta
verity (HASHTREE) flag is changed.
Read the ro.boot.veritymode property instead to determine the current
dm-verity state and suggest a reboot by comparing current and future
verity state:
* If AVB verification is disabled, then ro.boot.veritymode is undefined
  (probably empty), don't suggest reboot in this case as it's pointless.
* Otherwise suggest a reboot if the new state (which would take effect
  after reboot) differs from the current verity state.
* Reference:
  https://android.googlesource.com/platform/external/avb/+/master/README.md#handling-dm_verity-errors

Bug: 241688845
Test: adb-remount-test
Test: Run "adb enable-verity" & "adb disable-verity" multiple times
Change-Id: If1df5bee6e5dcbda580b3dff6c32da93d08bbb46
2022-11-09 17:12:38 +08:00
Ken Chen
7e6f2a44db Add ::1 to localhost in etc/hosts
::1 is IPv6 loopback address.

Bug: 256507503
Test: $ adb shell /data/dnschk localhost
      # localhost (via nethandle 0):
      127.0.0.1
      ::1
Change-Id: Ibcee52a14143856db50fca301c48ea9e2591914b
2022-11-09 17:05:35 +08:00
Yi-yo Chiang
2a501a11dc Merge changes from topic "merge_set-verity-state_with_remount"
* changes:
  remount: Merge 'remount' and 'set-verity-state'
  remount: Use MyLogger class and sundry improvements
2022-11-09 09:02:38 +00:00
Jooyung Han
8fbd79e689 Revert "add apex-ready event after post-fs-data"
This reverts commit 1eb3394e9c.

Reason for revert: b/244406239, we've migrated to a sysprop(apex.all.ready) instead of an event.

Change-Id: Iae54df241257e3a3dcad4e54fdbf9dd14e9814de
2022-11-09 07:55:58 +00:00
Inseob Kim
0fbc1d7e31 Don't unmount APEXes in microdroid
In microdroid, APEXes are passed as block devices from host, and then
mounted directly, without using /data. Unmounting APEXes on reboot is
for clean unmount of /data, so it's not needed in microdroid.

This skips unmounting in microdroid to remove unnecessary SELinux
denials.

Bug: 256793087
Test: run microdroid and reboot, see no denials happen
Change-Id: Iaf737876f5ab5de5e8f76ed8bb0963cc25d73a80
2022-11-09 12:50:14 +09:00
Sandeep Dhavale
2534d485d8 Fastbootd: Use Fastboot AIDL with the help of fastbootshim for legacy fastboot HAL
Bug: 205760652
Test: build & flash & reboot fastboot
Change-Id: I79617a396f536258655bdc28006ac2d0a7ab1912
Signed-off-by: Sandeep Dhavale <dhavale@google.com>
2022-11-09 00:38:34 +00:00
Kelvin Zhang
89837580bf Merge "Store lz4 blocks as uncompressed if compression makes data larger" am: 3c163eca84
Original change: https://android-review.googlesource.com/c/platform/system/core/+/2292820

Change-Id: I40486bf61280b9e252ecdff0795409175e26bccb
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-11-08 21:15:47 +00:00