Commit Graph

16038 Commits

Author SHA1 Message Date
alex.lyn
d435712ccb runtime-rs: Introduce PortDevice in resource manager in sandbox
A new resource type `PortDevice` is introduced which is dedicated
for handling root ports/switch ports during sandbox creation(VM).

Fixes #10361

Signed-off-by: alex.lyn <alex.lyn@antgroup.com>
2025-05-15 20:10:49 +08:00
alex.lyn
1d670bb46c runtime-rs: handle useless Device match arms in dragonball vmm case
Fixes #10361

Signed-off-by: alex.lyn <alex.lyn@antgroup.com>
2025-05-15 20:10:49 +08:00
alex.lyn
f08fdd25d8 runtime-rs: Introduce device type of PordDevice in device manager
PortDevice is for handling root ports or switch ports in PCIe
Topology. It will make it easy pass the root ports/switch ports
information during create VM with requirements of PCIe devices.

Fixes #10361

Signed-off-by: alex.lyn <alex.lyn@antgroup.com>
2025-05-15 20:10:49 +08:00
alex.lyn
694a849eaa runtime-rs: Add PCIe topology mgmt for Root Port and Switch Port
This commit introduces an implementation for managing PCIe topologies,
focusing on the relationship between Root Ports and Switch Ports. The
design supports two strategies for generating Switch Ports:

Let's take the requirement of 4 switch ports as an example. There'll be
three possible solutions as below:
(1) Single Root Port + Single PCIe Switch: Uses 1 Root Port and 1 Switch
with 4 Downstream Ports.
(2) Multiple Root Ports + Multiple PCIe Switches: Uses 2 Root Ports and
2 Switches, each with 2 Downstream Ports.

The recommended strategy is Option 1 due to its simplicity, efficiency,
and scalability. The implementation includes data structures
(PcieTopology, RootPort, PcieSwitch, SwitchPort) and operations
(add_pcie_root_port, add_switch_to_root_port, add_switch_port_to_switch)
to manage the topology effectively.

Fxies #10361

Signed-off-by: alex.lyn <alex.lyn@antgroup.com>
2025-05-15 20:10:49 +08:00
alex.lyn
2f5ee0ec6d kata-types: Support switch port config via annotation and configuration
Support setting switch ports with annotatation or configuration.toml

Fixes #10361

Signed-off-by: alex.lyn <alex.lyn@antgroup.com>
2025-05-15 20:10:49 +08:00
alex.lyn
a42d16a6a4 kata-types: Introduce pcie_switch_port in configuration
(1) Introduce new field `pcie_switch_port` for switch ports.
(2) Add related checking logics in vmms(dragonball, qemu)

Fixes #10361

Signed-off-by: alex.lyn <alex.lyn@antgroup.com>
2025-05-15 20:10:49 +08:00
Fabiano Fidêncio
af3c601a92
Merge pull request #11258 from fidencio/topic/second-try-fix-multi-install-prefix
kata-deploy: Avoid changing any component path in case of restart
2025-05-15 11:21:15 +02:00
Seunguk Shin
560e718979 runtime: Add edk2 to configuration-qemu.toml for arm64
The edk2 is required for memory hot plug on qemu for arm64.
This adds the edk2 to configuration-qemu.toml for arm64.

Signed-off-by: Seunguk Shin <seunguk.shin@arm.com>
Reviewed-by: Nick Connolly <nick.connolly@arm.com>
2025-05-15 10:12:31 +01:00
Seunguk Shin
5cabce1a25 packaging: Build edk2 for arm64
The edk2 is required for memory hot plug on qemu for arm64.
This adds the edk2 to static tarball for arm64.

Signed-off-by: Seunguk Shin <seunguk.shin@arm.com>
Reviewed-by: Nick Connolly <nick.connolly@arm.com>
2025-05-15 10:12:24 +01:00
stevenhorsman
c09291a9c7 ci: gatekeeper: Require names update
The github rest api truncated job names that are >100
characters (which doesn't seem to be documented).
There doesn't seem to be a way to easily make gatekeeper
handle this automatically, so lets update the required-tests
to expect the truncated job names

Fixes: #11176
Signed-off-by: stevenhorsman <steven@uk.ibm.com>
2025-05-15 10:07:41 +01:00
Steve Horsman
95e5e0ec49
Merge pull request #11264 from fidencio/topic/helm-to-ci
helm: release: Publish our helm charts to the OCI registries
2025-05-15 09:47:33 +01:00
Lukáš Doktor
9f8c8ea851
tools.testing: Add way to re-play recorded queries in gatekeeper
to simplify gatekeeper development add support for DEBUG_INPUT which can
be used to report content from files gathered in DEBUG run.

Signed-off-by: Lukáš Doktor <ldoktor@redhat.com>
2025-05-15 10:32:10 +02:00
Lukáš Doktor
1a15990ee1
tools.testing: Add DEBUG support for gatekeeper
to avoid manual curling to analyze GK issues let's add a way to dump all
GK requests in a directory when the use specifies "DEBUG" env variable.

Signed-off-by: Lukáš Doktor <ldoktor@redhat.com>
2025-05-15 10:32:10 +02:00
Fabiano Fidêncio
71e8c1b4f0 helm: release: Publish our helm charts to the OCI registries
Let's take advantage that helm take and OCI registry as the charts, and
upload our charts to the OCI registries we've been using so far.

Signed-off-by: Fabiano Fidêncio <fidencio@northflank.com>
2025-05-14 20:20:35 +02:00
RuoqingHe
393cc61153
Merge pull request #11241 from kata-containers/dependabot/cargo/src/tools/agent-ctl/ring-0.17.14
build(deps): bump ring from 0.17.8 to 0.17.14 in /src/tools/agent-ctl
2025-05-14 16:20:33 +02:00
Adapa Chathurya
3d284d3b4e versions: Bump libz-sys version
Bump libz-sys version to update and remediate CVE-2025-1744.

Signed-off-by: Adapa Chathurya <adapa.chathurya1@ibm.com>
2025-05-14 19:48:10 +05:30
Fabiano Fidêncio
82928d1480 kata-deploy: Avoid changing any component path in case of restart
The previous attempt to fix this issue only took in consideration the
QEMU binary, as I completely forgot that there were other pieces of the
config that we also adjusted.

Now, let's just check one of the configs before trying to adjust
anything else, and only do the changes if the suffix added with the
multi-install suffix is not yet added.{

Signed-off-by: Fabiano Fidêncio <fidencio@northflank.com>
2025-05-14 15:41:13 +02:00
Jacek Tomasiak
e20fb377fc
osbuilder: ubuntu: Switch from multistrap to mmdebstrap
Multistrap requires usrmerge package which was dropped in Ubuntu 24.04
(Noble). Based on details from [0], the rootfs build process was switched
to mmdebstrap.

Some additional minor tweaks were needed around chrony as the version
from Noble has very strict systemd sandboxing configured and it doesn't
work with readonly root by default.

[0] https://lists.debian.org/debian-dpkg/2023/05/msg00080.html

Fixes: #11245
Signed-off-by: Jacek Tomasiak <jtomasiak@arista.com>
Signed-off-by: Jacek Tomasiak <jacek.tomasiak@gmail.com>
2025-05-14 11:46:19 +02:00
Steve Horsman
711fcd8f51
Merge pull request #11251 from stevenhorsman/rust-vulns-9th-may-2025
Rust vulns 9th may 2025
2025-05-14 09:58:12 +01:00
Tobin Feldman-Fitzthum
be708f410e tests: fixup error assert in pull image test
Guest components is now less verbose with its error messages. This will
be fixed after the release but for now switch to a more generic error
message that is still found in the logs.

Signed-off-by: Tobin Feldman-Fitzthum <tobin@ibm.com>
2025-05-13 20:17:02 -05:00
Tobin Feldman-Fitzthum
806abeefb9 tests: fixup error asserts in init-data test
Guest components is less verbose with its error message now. This will
be fixed after the release, but for now, update the tests with the new
more general message.

Signed-off-by: Tobin Feldman-Fitzthum <tobin@ibm.com>
2025-05-13 20:16:50 -05:00
Tobin Feldman-Fitzthum
e2e503eb33 tests: fixup error string for signature tests
Guets components is less verbose with its error messages. This will be
fixed after the release, but for now let's replace this with a more
generic message.

Signed-off-by: Tobin Feldman-Fitzthum <tobin@ibm.com>
2025-05-13 16:54:06 -05:00
Cameron Baird
090497f520 genpolicy: Add test cases for fsGroup and supplementalGroup fields
Fix up genpolicy test inputs to include required additionalGids

Include a test for the pod_container container in security_context tests
as these containers follow slightly different paths in containerd.

Introduce a test for fsGroup/supplementalGroups fields in the security
context.

Signed-off-by: Cameron Baird <cameronbaird@microsoft.com>
2025-05-13 21:48:58 +00:00
Cameron Baird
19d502de76 ci: Add test cases for fsGroup and supplementalGroup fields
Introduce new test case to the security context bats file which verifies
that policy works properly for a deployment yaml containing fsGroup and
supplementalGroup configuration.

Signed-off-by: Cameron Baird <cameronbaird@microsoft.com>
2025-05-13 21:48:58 +00:00
Cameron Baird
d3cd1af593 genpolicy: Enable AdditionalGids checks in rules.rego
With added support for parsing these fields in genpolicy, we can now
enable policy verification of AdditionalGids.

Signed-off-by: Cameron Baird <cameronbaird@microsoft.com>
2025-05-13 21:48:58 +00:00
Tobin Feldman-Fitzthum
ef98f39b6d tests: update error message for authenticated guest pull
Some changes in guest components have obscured the error message that we
show when we fail to get the credentials for an authenticated image. The
new error message is a little bit misleading since it references
decrypting an image. This will be udpated in a future release, but for
now look for this message.

Signed-off-by: Tobin Feldman-Fitzthum <tobin@ibm.com>
2025-05-13 16:46:32 -05:00
Cameron Baird
29ee46c186 genpolicy: Handle PodSecurityContext.fsGroup|supplementalGroups
Policy enforcement for additionalGids, A list of groups applied to the first process run in each container.

Manifests in OCI struct as additionalGids: Consists of container's GID, fsGroup, and supplementalGroups.

https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.28/#PodSecurityContext-v1-core

Signed-off-by: Cameron Baird <cameronbaird@microsoft.com>
2025-05-13 21:44:51 +00:00
Tobin Feldman-Fitzthum
e10aa4e49c tests: update error message for encrypted image test
Guest components prints out a different error when failing to decrypt an
image. Update the test to look for this new error.

Signed-off-by: Tobin Feldman-Fitzthum <tobin@ibm.com>
2025-05-13 12:33:37 -05:00
RuoqingHe
cd4c3e89e1
Merge pull request #11243 from kata-containers/dependabot/go_modules/src/runtime/github.com/opencontainers/runc-1.2.0
build(deps): bump github.com/opencontainers/runc from 1.1.12 to 1.2.0 in /src/runtime
2025-05-13 17:02:35 +02:00
RuoqingHe
268197957d
Merge pull request #11253 from stevenhorsman/golang.org/x/oauth2v0.27.0-bump
versions: Bump golang.org/x/oauth2
2025-05-13 15:03:24 +02:00
stevenhorsman
b3825829d8 versions: Bump golang.org/x/oauth2
Update module to remediate
[CVE-2025-22868](https://www.cve.org/CVERecord?id=CVE-2025-22868)

Signed-off-by: stevenhorsman <steven@uk.ibm.com>
2025-05-13 11:00:35 +01:00
Rong Tao
37a16c19d1 osbuilder: lib.sh: Fix indent
Replace 4 spaces to [tab].

Signed-off-by: Rong Tao <rongtao@cestc.cn>
2025-05-13 16:56:54 +08:00
Steve Horsman
299fb3b77b
Merge pull request #11255 from stevenhorsman/skip-docker-tests
ci: gatekeeper: skip docker tests
2025-05-13 09:18:09 +01:00
Zvonko Kaiser
842ec6a32e
Merge pull request #11262 from BbolroC/add-vfio-config-for-sel-runtime
runtime/config: Add VFIO config for IBM SEL
2025-05-12 10:59:09 -04:00
Zvonko Kaiser
5cc098ae43
Merge pull request #11242 from houstar/qing/safe-path
agent: use safe-path to replace secure_join
2025-05-12 10:58:19 -04:00
Mikko Ylinen
ab29c8c979 runtime: do not add virtio-rng-pci device for confidential guests
Adding:
"-object rng-random,id=rng0,filename=/dev/urandom -device
virtio-rng-pci,rng=rng0"

for confidential guests is not necessary as the RNG source cannot
be trusted and the guest kernel has the driver already disable as well.

Signed-off-by: Mikko Ylinen <mikko.ylinen@intel.com>
2025-05-12 17:14:51 +03:00
Mikko Ylinen
a44dfb8d37 versions: bump LTS kernel
6.12.28 has been released, let's bump to it.

Signed-off-by: Mikko Ylinen <mikko.ylinen@intel.com>
2025-05-12 17:14:51 +03:00
Mikko Ylinen
eb326477fc kernel: disable virtio RNG for confidential guests
Linux CoCo x86 guest is hardened to ensure RDRAND provides enough
entropy to initialize Linux RNG. A failure will panic the guest.

For confidential guests any other RNG source is untrusted so disable
them.

Signed-off-by: Mikko Ylinen <mikko.ylinen@intel.com>
2025-05-12 17:12:44 +03:00
Hyounggyu Choi
4fac1293bd runtime/config: Add VFIO config for IBM SEL
With #11076 merged, a VFIO configuration is needed in the runtime
when IBM SEL is involved (e.g., qemu-se or qemu-se-runtime-rs).

For the Go runtime, we already have a nightly test
(e.g., https://github.com/kata-containers/kata-containers/actions/runs/14964175872/job/42031097043)
in which this change has been applied.
For the Rust runtime, the feature has not yet been migrated.
Thus, this change serves as a placeholder and a reminder for future implementation.

Signed-off-by: Hyounggyu Choi <Hyounggyu.Choi@ibm.com>
2025-05-12 14:58:29 +02:00
Qingyuan Hou
c0ceaf661a agent: use safe-path to replace secure_join
This patch use safe-path library to safely handle filesystem paths.

Signed-off-by: Qingyuan Hou <qingyuan.hou@linux.alibaba.com>
2025-05-12 09:06:55 +00:00
Tobin Feldman-Fitzthum
de6f4ae99c versions: update Trustee version for CoCo v0.14.0
This hash will be tagged as Trustee v0.13.0 after the CoCo release is
finished.

Signed-off-by: Tobin Feldman-Fitzthum <tobin@ibm.com>
2025-05-09 13:40:28 -05:00
Tobin Feldman-Fitzthum
f9a9967e21 versions: update guest-components for CoCo v0.14.0
Pick up changes to guest components. This hash is right before the
changes to GC to support image pull via the CDH.

Signed-off-by: Tobin Feldman-Fitzthum <tobin@ibm.com>
2025-05-09 13:40:28 -05:00
Tobin Feldman-Fitzthum
d714eb2472 agent: update image-rs for CoCo v0.14.0
We might be able to eliminate this dependency soon, but for now let's
update image-rs.

I massaged the dependencies with:

cargo update idna_adapter@1.2.1 --precise 1.2.0
cargo update litemap@0.7.5 --precise 0.7.4
cargo update zerofrom@0.1.6 --precise 0.1.5
cargo update astral-tokio-tar@0.5.2 --precise 0.5.1
cargo update base64ct@1.7.3 --precise 1.6.0
cargo update generic-array@1.2.0 --precise 1.1.1

Signed-off-by: Tobin Feldman-Fitzthum <tobin@ibm.com>
2025-05-09 13:39:52 -05:00
stevenhorsman
35ed3a2a3a versions: Bump bumpalo version
Bump bumpalo version to remediate RUSTSEC-2022-0078

Signed-off-by: stevenhorsman <steven@uk.ibm.com>
2025-05-09 16:09:22 +01:00
stevenhorsman
fcc60b514b versions: Bump hyper version
Bump hyper version to update and remediate CVE-2023-26964

Signed-off-by: stevenhorsman <steven@uk.ibm.com>
2025-05-09 16:09:22 +01:00
stevenhorsman
7807e6c29a versions: Bump byte-unit and rust_decimal
Bump the crates to update them and pull in a
newer version of borsh to remediate RUSTSEC-2023-0033

Signed-off-by: stevenhorsman <steven@uk.ibm.com>
2025-05-09 16:09:22 +01:00
Mikko Ylinen
96d922fc27 kernel: disable virtio MMIO for confidential guests
As the comment in the fragment suggests, this is for the firecracker builds
and not relevant for confidential guests, for example.

Exlude mmio.conf fragment by adding the new !confidential tag to drop
virtio MMIO transport for the confidential guest kernel (as virtio PCI is
enough for the use cases today).

Signed-off-by: Mikko Ylinen <mikko.ylinen@intel.com>
2025-05-09 17:53:22 +03:00
Mikko Ylinen
31d6839eb5 tools: let confidential guest kernel builds to exclude fragments
build-kernel.sh supports exluding fragments from the common base
set based on the kernel target architecture.

However, there are also cases where the base set must be stripped
down for other reason. For example, confidential guest builds want to
exclude some drivers the untrusted host may try to add devices (e.g.,
virtio-rng).

Make build-kernel.sh to skip fragments tagged using '!confidential'
when confidential guest kernels are built.

Signed-off-by: Mikko Ylinen <mikko.ylinen@intel.com>
2025-05-09 17:53:22 +03:00
Zvonko Kaiser
78ff72a386
Merge pull request #11199 from fidencio/topic/kata-deploy-fix-multiInstallSufix-behaviour-during-restarts
helm: Avoid appending the multiInstallSuffix several times
2025-05-09 10:32:23 -04:00
Zvonko Kaiser
26a3cb4fd1
Merge pull request #11250 from stevenhorsman/tempfile-3.19.1-bump
versions: Update tempfile crate
2025-05-09 09:51:49 -04:00