Commit graph

90603 commits

Author SHA1 Message Date
Elliott Hughes
55056e9bd5 Merge "Stop explicitly adding bionic subdirectories to the include path." into main am: 3c63d0af34
Original change: https://android-review.googlesource.com/c/platform/system/core/+/3343293

Change-Id: Ib1e951f013e7935903502f8ef3a1c5bd3372df57
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-11-13 13:52:20 +00:00
Elliott Hughes
3c63d0af34 Merge "Stop explicitly adding bionic subdirectories to the include path." into main 2024-11-13 13:17:10 +00:00
David Drysdale
735298c3b5 Merge changes from topic "keymint-v3" into main am: 014c710c27
Original change: https://android-review.googlesource.com/c/platform/system/core/+/3345023

Change-Id: Icd1a9341b61b24ac4ff1c461afc746867c3f4397
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-11-13 07:15:21 +00:00
David Drysdale
014c710c27 Merge changes from topic "keymint-v3" into main
* changes:
  Declare previous version when using frozen HALs
  Set the proper FEATURE_HARDWARE_KEYSTORE version
2024-11-13 06:50:42 +00:00
Florian Mayer
9ce2ae15fc Merge "Remove mitchp from OWNERS file" into main am: 574ae66ee6
Original change: https://android-review.googlesource.com/c/platform/system/core/+/3343146

Change-Id: Icb636faf29fe8ceacb8dd755fea42ed1c5f5b058
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-11-12 21:33:00 +00:00
Florian Mayer
574ae66ee6 Merge "Remove mitchp from OWNERS file" into main 2024-11-12 20:51:20 +00:00
Florian Mayer
4be70e7db3 Remove mitchp from OWNERS file
Change-Id: Ifb0e1598f3908fcc2206a2b51611b996f8b48cb8
2024-11-12 20:46:08 +00:00
Florian Mayer
785789b830 Merge "Test stack buffer size calculation." into main am: a7da00f4f0
Original change: https://android-review.googlesource.com/c/platform/system/core/+/3342429

Change-Id: Ib1211301c68528998ca9f481204977ecaf3b3caf
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-11-12 19:14:33 +00:00
Florian Mayer
a7da00f4f0 Merge "Test stack buffer size calculation." into main 2024-11-12 18:51:39 +00:00
Elliott Hughes
945dd526ed Stop explicitly adding bionic subdirectories to the include path.
Change-Id: I24776f1008ca5f030cd8c94147d9630519ef6a24
2024-11-12 15:25:09 +00:00
Treehugger Robot
c2ade867be Merge "Add BOARD_GENFS_LABELS_VERSION" into main am: 7adba5989c
Original change: https://android-review.googlesource.com/c/platform/system/core/+/3337494

Change-Id: I70b57ba43294bb8638707c21d1ccf831db00fd13
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-11-12 01:54:08 +00:00
Jooyung Han
cb57a87502 Merge "Revert^2 "Deprecating libvendorsupport_llndk_headers"" into main am: 92d1597718
Original change: https://android-review.googlesource.com/c/platform/system/core/+/3342057

Change-Id: I0633530cc01567dbbefe98e2c14c4064edd3610d
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-11-12 01:52:54 +00:00
Treehugger Robot
7adba5989c Merge "Add BOARD_GENFS_LABELS_VERSION" into main 2024-11-12 01:42:47 +00:00
Jooyung Han
92d1597718 Merge "Revert^2 "Deprecating libvendorsupport_llndk_headers"" into main 2024-11-12 01:35:41 +00:00
Florian Mayer
6facd1bfd3 Test stack buffer size calculation.
Bug: 378140560
Change-Id: Idca03cac925bc0d8bd574817391c4eaca11f2bff
2024-11-11 14:03:00 -08:00
David Drysdale
5969d69248 Declare previous version when using frozen HALs
The KeyMint HAL has been updated to v4, but frozen builds (e.g. 25Q1)
remain on the previous version.  The core AIDL version is handled
automatically, but we also have a package manager flag whose value
is (100 * HAL-version).  Use `RELEASE_AIDL_USE_UNFROZEN` to switch
between `required` configs for that.

Test: TreeHugger
Bug: 377808462
Bug: 378026324
Change-Id: Id042bee2a81e8563e1029ea7bb43452715e3edee
2024-11-11 19:17:20 +00:00
Karuna Wadhera
e8ff8b494a Set the proper FEATURE_HARDWARE_KEYSTORE version
The binary implements V3 of the KeyMint HAL, so the feature version
should match.

Bug: 369375199
Bug: 378384123
Test: treehugger
Change-Id: Ib26ac73cf6593d9a50f7a019129c6e5e237ae2cd
2024-11-11 18:06:30 +00:00
Dennis Shen
a882da3ae7 Merge "Start aconfigd_system processes in init.rc" into main am: b842f642d9
Original change: https://android-review.googlesource.com/c/platform/system/core/+/3343282

Change-Id: Ia671c3fce477f4bfb7050a5fe96e4074da6d0fda
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-11-11 14:58:53 +00:00
Dennis Shen
b842f642d9 Merge "Start aconfigd_system processes in init.rc" into main 2024-11-11 14:33:09 +00:00
Treehugger Robot
2bf55942ab Merge "init: Avoid extra string copies when finding devices by using const refs" into main am: fa528cccf6
Original change: https://android-review.googlesource.com/c/platform/system/core/+/3342430

Change-Id: I48357c43e2aeed627af60a6ef7be4ec40470416e
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-11-11 02:31:02 +00:00
Treehugger Robot
fa528cccf6 Merge "init: Avoid extra string copies when finding devices by using const refs" into main 2024-11-11 02:05:44 +00:00
Jooyung Han
dbb080d9bf Revert^2 "Deprecating libvendorsupport_llndk_headers"
ab8f9717f1

Change-Id: Ie981692be554942df762a4c9be7c250b0b202f31
2024-11-09 02:41:13 +00:00
Douglas Anderson
46afe22f9d init: Avoid extra string copies when finding devices by using const refs
Now that FindPlatformDevice() isn't modifying the path argument, and
is just passing it on to FindSubsystemDevice(), take this argument by
const reference. That should avoid an unnecessary string copy.

Bug: 316324155
Test: Compile
Change-Id: I1d92a322d0c311ee46a117dd9d650896ec02520f
2024-11-08 15:48:35 -08:00
Priyanka Advani (xWF)
886b9483c6 Merge "Revert "Deprecating libvendorsupport_llndk_headers"" into main am: 244a63066b
Original change: https://android-review.googlesource.com/c/platform/system/core/+/3341360

Change-Id: I2e954552168ce55859d78aa81bb195afbd9e73c3
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-11-08 19:36:31 +00:00
Priyanka Advani (xWF)
244a63066b Merge "Revert "Deprecating libvendorsupport_llndk_headers"" into main 2024-11-08 19:05:16 +00:00
Ted Bauer
3c700588c7 Start aconfigd_system processes in init.rc
aconfigd_system is replacing aconfigd. Which one executes is toggled
by RO flag enable_system_aconfigd_rust, introduced in https://android-review.googlesource.com/q/topic:%22switch-to-aconfigd-system%22.

Bug: 378079539
Test: m
Change-Id: I6a04c38e9ef22da2b230046ddace73d6f7e39652
2024-11-08 17:45:16 +00:00
Priyanka Advani (xWF)
ab8f9717f1 Revert "Deprecating libvendorsupport_llndk_headers"
Revert submission 3334193-no-llndk-versioning

Reason for revert: Droidmonitor created revert  due to b/378038995. Will be verifying through ABTD before submission.

Reverted changes: /q/submissionid:3334193-no-llndk-versioning

Change-Id: Id8d85be1930bef68f94cee66a0fe29278de48d64
2024-11-08 17:37:26 +00:00
Inseob Kim
76afb4a2c2 Add BOARD_GENFS_LABELS_VERSION
If it's 202504 or later, /sys/class/udc will be labeled as sysfs_udc. If
it's not set, /sys/class/udc will stay at the label sysfs. This is to
support GRF vendors older than 202504.

202404 or old vendors can choose either way. If they want to customize
permissions to /sys/class/udc, they can turn off
BOARD_GENFS_LABELS_VERSION and assign their own label to /sys/class/udc
/sys/class/udc with vendor sepolicy.

202504 or newer vendors must set BOARD_GENFS_LABELS_VERSION to a version
greater than or equal to 202504.

For now there's only one node /sys/class/udc, but more labels can be
added until 202504 freeze.

Bug: 361985697
Test: boot with and without BOARD_GENFS_LABELS_VERSION
Change-Id: I1a28109119368f1475628be85dd8d990c824922e
2024-11-08 16:41:45 +09:00
Treehugger Robot
ad0f3f67b7 Merge "Deprecating libvendorsupport_llndk_headers" into main am: 2a5bef2e98
Original change: https://android-review.googlesource.com/c/platform/system/core/+/3337493

Change-Id: Iccfcdd698dfe8cc2921333b0c0eb64ce34efef10
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-11-08 07:03:49 +00:00
Treehugger Robot
2a5bef2e98 Merge "Deprecating libvendorsupport_llndk_headers" into main 2024-11-08 06:29:05 +00:00
Hung Nguyen
f278c9ce19 Merge "Increase zram size percentage limit" into main am: fb954abea6
Original change: https://android-review.googlesource.com/c/platform/system/core/+/3343241

Change-Id: If9ca6ab46167e7136995b011afe736cbeb7ccd25
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-11-08 05:35:57 +00:00
Hung Nguyen
fb954abea6 Merge "Increase zram size percentage limit" into main 2024-11-08 05:09:37 +00:00
Treehugger Robot
1d4ac1eed6 Merge "Increase the test timeout" into main am: 308bcbea8e
Original change: https://android-review.googlesource.com/c/platform/system/core/+/3342095

Change-Id: I8cf8374f3cae4f188594ade50ededc6bd3d8f7cc
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-11-07 23:25:53 +00:00
Hung Nguyen
ce6f7330ad Increase zram size percentage limit
To allow experimenting with zram size larger than device memory size.

Bug: 368286978
Test: atest CtsFsMgrTestCases

Change-Id: I47a4a4e6af39571d13e4622d110c92936008127e
2024-11-07 15:16:17 -08:00
Treehugger Robot
308bcbea8e Merge "Increase the test timeout" into main 2024-11-07 23:07:11 +00:00
Akilesh Kailash
e5a2af34b3 Increase the test timeout
Bug: 338329603
Test: Build success
Change-Id: I97008dbe112d87ef2f4bff5605beb41cc4b1fac7
Signed-off-by: Akilesh Kailash <akailash@google.com>
2024-11-07 13:43:13 -08:00
Treehugger Robot
c4c178bafb Merge "init: Look for partition only on a boot device if using boot_part_uuid" into main am: c43fd51571
Original change: https://android-review.googlesource.com/c/platform/system/core/+/3336854

Change-Id: Ifea13a041e88cdf333b3bd95b2449fb21e961d37
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-11-07 17:35:09 +00:00
Treehugger Robot
c43fd51571 Merge "init: Look for partition only on a boot device if using boot_part_uuid" into main 2024-11-07 16:59:48 +00:00
Doug Anderson
c4ce6111b4 Merge changes If824cb70,I025d9d68,Ic5a57a89,If5d63f39,I1adb1906 into main am: f3e994b439
Original change: https://android-review.googlesource.com/c/platform/system/core/+/3318438

Change-Id: I251001b955a0ea61ec84fc5e6389b09666087146
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-11-07 15:59:51 +00:00
Doug Anderson
f3e994b439 Merge changes If824cb70,I025d9d68,Ic5a57a89,If5d63f39,I1adb1906 into main
* changes:
  init: Add the ability to find the boot device by partition UUID
  init: Move the stripping of "/devices" and "/devices/platform/" to a helper
  init: Break FindPlatformDevice() into a helper function
  init: Factor GetBlockDeviceInfo() out of GetBlockDeviceSymlinks()
  init: Use ConsumePrefix() instead of open coding in GetBlockDeviceSymlinks()
2024-11-07 15:28:10 +00:00
T.J. Mercier
ec19cc0444 Merge "Revert "Set input thread priority to RT - try 3"" into main am: 574da62341
Original change: https://android-review.googlesource.com/c/platform/system/core/+/3338904

Change-Id: I67152db244bd9a427355c19586630540d7f3bbbc
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-11-06 22:12:12 +00:00
T.J. Mercier
574da62341 Merge "Revert "Set input thread priority to RT - try 3"" into main 2024-11-06 21:50:40 +00:00
Liana Kazanova
52da71d47b Revert "Set input thread priority to RT - try 3"
This reverts commit a2bd0e6b5d.

Reason for revert:DroidMonitor: Potential culprit for http://b/377739155 - verifying through ABTD before revert submission. This is part of the standard investigation process, and does not mean your CL will be reverted.

Change-Id: I4c2b686aaf291db819d37711d4427d0094ca2295
2024-11-06 21:42:29 +00:00
Douglas Anderson
eb3d280f1e init: Look for partition only on a boot device if using boot_part_uuid
The current code waits for boot partitions to show up by waiting to
see a uevent with the right partition name. However, nothing in the
waiting code validates that the partition that showed up is actually
on the boot device. That means that the current code can be confused
if there is another block device in the system (possibly connected via
USB) that has a partition name matching one of the system ones.

It can be noted that the problem is specifically just that the
"waiting" part returns too early. Later parts of the system,
specifically the parts of the system that create the
"/dev/block/by-name" symlinks, do properly look at the list of "boot
devices". This means that the problem we're fixing is that later code,
which assumes that the boot partitions have already initialized, can
fail to find an initialized partition.

To make it concrete, imagine that you have two block devices in your
system: the builtin emmc and an external USB disk. Let's say you're
booting over USB and "boot_devices" properly lists only USB. Both the
"emmc" and "USB" block devices are properly formatted Android disks
and have the full slew of partitions. At boot time, you can see:
1. We get to the point where we need to wait for the "boot" source
   (USB) to show up.
2. We see the eMMC show up.
3. The eMMC has all the needed partitions, so we consider our wait
   done. ...but eMMC isn't in the list of "boot devices" so we don't
   create the "/dev/block/by-name" symlinks.
4. Later code assumes that the "/dev/block/by-name" symlinks are
   already setup and fails.
5. The device fails to boot.

Fix it so that the wait makes sure that the partitions are on the boot
device.

Unfortunately, it appears that in some cases products (especially
emulators) aren't setting the "boot devices" and/or are not making
sure all boot partitions are on the same device. Limit the fix to only
devices using the new "boot_part_uuid" to make sure we don't break old
code.

NOTE: this is effectively the same change as a previous one ("init:
Look for super partition only on a boot device") but with the added
fix to only enable the check when using "boot_part_uuid".

Bug: 309244873
Bug: 349144493
Bug: 316324155
Test: Boot isn't confused when two boot devices are present
Change-Id: Iaae453ed661307f485cdf4dde86294105cae9b2d
2024-11-06 13:03:15 -08:00
Douglas Anderson
e9de310061 init: Add the ability to find the boot device by partition UUID
The current mechanism for specifying boot devices on Android systems
involves passing a set of "boot_devices" though command line,
bootconfig, or device tree.

The bootdevices are specified as strings and, in general, need to
match a sysfs path but without the "/sys/devices" or
"/sys/devices/platform" prefix. The sysfs path is generally the path
to the closest parent of the block device that is a "platform" device.

As an example, if the sysfs path of the expected boot device is:
  /sys/devices/platform/soc@0/7c4000.mmc/mmc_host/mmc1/mmc1:0001/block/mmcblk1

The bootloader would specify it as "soc@0/7c4000.mmc" since:
* We strip off "/sys/devices/platform/"
* As we move up directories, we don't find one whose subsystem is
  "platform" until we get up to
  "/sys/devices/platform/soc@0/7c4000.mmc".

The current mechanism is a bit brittle. Specifically:
* The sysfs path isn't _really_ stable and can change across kernel
  upgrades. For instance, during one kernel upgrade the device tree
  for a product changed so that the root node changed from "soc" to
  "soc@0" and this changed all sysfs paths. In the past device tree
  folks have asserted that we shouldn't rely on dts node names to stay
  consistent, yet those node names are used to construct sysfs paths.
* For some devices, like USB, the path of the closest "platform"
  device tends to be the path of the USB controller. This means that
  if two USB disks are plugged in we can't guarantee which one will be
  identified as the boot device.

Add a new method of finding the boot device by passing the partition
UUID that we loaded the kernel from. Using the partition UUID to
identify the boot device is standard on Linux. You can see this
because when you're not using an initramfs you can use the syntax
"root=PARTUUID=<valid-uuid-id>[/PARTNROFF=n]" to specify the root.
Using the same idea for Android's boot code makes sense.

With this new method for finding the boot device, we can make the code
much more specific about matching sysfs paths. Once we find the sysfs
path for the kernel we can make sure that all of the other boot
partition share the same "scsi" or "mmc" parent instead of going all
the way to the closest platform device. In the above example, this
means that we'd make sure that all boot devices are found under this
sysfs node:
  /sys/devices/platform/soc@0/7c4000.mmc/mmc_host/mmc1/mmc1:0001/block/mmcblk1
...instead of just making sure they are under:
  /sys/devices/platform/soc@0/7c4000.mmc

There is the question of what we should do if the bootloader passes
_both_ an old style "boot_devices" and also a partition UUID. In this
case, we'll issue a warning and then ignore the old "boot_devices".
Considering it a warning rather than an error could allow switching to
the "boot_part_uuid" method even if an old bootloader is still
hardcoding some old "boot_devices".

NOTE: Using partition UUID won't cause any security problems even
though someone _could_ plug in an external device crafted to have the
same UUID as the normal boot device's kernel partition. We already
have "verity" in the system making sure our filesystems are not
tampered with and this would also protect us from booting a tampered
disk. That means that the worst someone could do in this case would be
to confuse the system and make the device non-bootable. Chromebooks
have been using the partition UUID to find the root filesystems for
years and this has never been a problem.

NOTE: this new method relies on the commit ("init: Add partition_uuid
to Uevent") which in turn relies upstream kernel commit 74f4a8dc0dd8
("block: add partition uuid into uevent as "PARTUUID"").

Bug: 316324155
Test: Use partition UUID to boot

Change-Id: If824cb700ca3696a442a28e6ad02d7c522c3b495
2024-11-06 13:03:15 -08:00
Douglas Anderson
3de05fcff6 init: Move the stripping of "/devices" and "/devices/platform/" to a helper
A future change will want the same stripping when looking for USB boot
devices. Move the stripping down to the helper.

This change is intended to be a no-op and just a reorganization.

Bug: 316324155
Test: See boot devices still found
Change-Id: I025d9d68fedf652055454cbd93e15f480b6056dd
2024-11-06 13:03:15 -08:00
Douglas Anderson
6519e6d67f init: Break FindPlatformDevice() into a helper function
We want to use the logic for FindPlatformDevice() in a future change
to look for devices that have USB parents. Break out a helper
function.

This change is intended to be a no-op and just a reorganization.

Bug: 316324155
Test: See boot devices still found
Change-Id: Ic5a57a89339c43dea1334644be9386637169c61c
2024-11-06 13:03:15 -08:00
Douglas Anderson
9481f97603 init: Factor GetBlockDeviceInfo() out of GetBlockDeviceSymlinks()
Later code will want to use GetBlockDeviceInfo(), so factor it out to
a helper function. This change is intended to be a no-op.

Bug: 316324155
Test: Build & boot
Change-Id: If5d63f39efcd84a07eb8c6fa4f28bda45c4cbe5c
2024-11-06 13:03:14 -08:00
Douglas Anderson
743e8f16a7 init: Use ConsumePrefix() instead of open coding in GetBlockDeviceSymlinks()
In GetBlockDeviceSymlinks() we may need to strip the
"/devices/platform/" or "/devices/" from a string. Use the helper
ConsumePrefix() to do this, which is more convenient and readable.

This change is intended to be a no-op and just a cleanup.

Bug: 316324155
Test: Build and boot
Change-Id: I1adb1906ec37ff8f6f505abc5f26e1e3b157e608
2024-11-06 12:22:48 -08:00
Treehugger Robot
46d81be6fb Merge "Set input thread priority to RT - try 3" into main am: 04130ee930
Original change: https://android-review.googlesource.com/c/platform/system/core/+/3338177

Change-Id: If0809a4e4b18871d324b23c32d2daaa01e4271d2
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-11-06 19:19:31 +00:00