Commit Graph

9266 Commits

Author SHA1 Message Date
GabyCT
9bce2beebf
Merge pull request #5040 from GabyCT/topic/updatecni
versions: Update cni plugins version
2022-09-01 09:31:06 -05:00
Bin Liu
69b82023a8
Merge pull request #5065 from liubin/fix/5064-specify-language-for-code-in-markdown
docs: Specify language in markdown for syntax highlight
2022-09-01 16:11:23 +08:00
Bin Liu
749a6a2480 docs: Specify language in markdown for syntax highlight
Specify language for code block in docs/Unit-Test-Advice.md
for syntax highlight.

Fixes: #5064

Signed-off-by: Bin Liu <bin@hyper.sh>
2022-09-01 13:54:31 +08:00
Fabiano Fidêncio
08d230c940
Merge pull request #5046 from fidencio/topic/fix-regression-on-building-tdx-kernel
kernel: Re-work get_tee_kernel()
2022-08-31 13:16:26 +02:00
Greg Kurz
380af44043
Merge pull request #5036 from jpecholt/whitelist-cleanup
kernel: Whitelist cleanup
2022-08-31 11:08:32 +02:00
Fabiano Fidêncio
a1fdc08275 kernel: Re-work get_tee_kernel()
00aadfe20a introduced a regression on
`make cc-tdx-kernel-tarball` as we stopped passing all the needed
information to the `build-kernel.sh` script, leading to requiring `yq`
installed in the container used to build the kernel.

This commit partially reverts the faulty one, rewritting it in a way the
old behaviour is brought back, without changing the behaviour that was
added by the faulty commit.

Fixes: #5043

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
2022-08-31 10:08:12 +02:00
Peng Tao
f1276180b1
Merge pull request #4996 from liubin/fix/4995-delete-socket-option-for-shim
runtime-rs: delete socket from shim command-line options
2022-08-31 14:16:56 +08:00
Bin Liu
515bdcb138
Merge pull request #4900 from wllenyj/dragonball-ut
Built-in Sandbox: add more unit tests for dragonball.
2022-08-31 14:00:07 +08:00
Gabriela Cervantes
b1a8acad57 versions: Update cni plugins version
This PR updates the cni plugins version that is being used in the kata CI.

Fixes #5039
Depends-on: github.com/kata-containers/tests#5088

Signed-off-by: Gabriela Cervantes <gabriela.cervantes.tellez@intel.com>
2022-08-30 16:04:45 +00:00
Joana Pecholt
a6581734c2 kernel: Whitelist cleanup
This removes two options that are not needed (any longer). These
are not set for any kernel so they do not need to be ignored either.

Fixes #5035

Signed-off-by: Joana Pecholt <joana.pecholt@aisec.fraunhofer.de>
2022-08-30 13:24:12 +02:00
Fabiano Fidêncio
1b92a946d6
Merge pull request #4987 from ryansavino/initrd-fixes-for-ubuntu-systemd
Initrd fixes for ubuntu systemd
2022-08-30 09:16:43 +02:00
GabyCT
630eada0d3
Merge pull request #4956 from shippomx/main
kernel: Add CONFIG_CGROUP_HUGETLB=y as part of the cgroup fragments
2022-08-29 14:31:46 -05:00
GabyCT
3426da66df
Merge pull request #4951 from wainersm/fix_kata-deploy-ci
Fix kata-deploy to work on CI context
2022-08-29 14:30:59 -05:00
Wainer Moschetta
cd5be6d55a
Merge pull request #4775 from bookinabox/auto-backport
github-actions: Auto-backporting
2022-08-29 14:08:12 -03:00
Bin Liu
11383c2c0e
Merge pull request #4797 from openanolis/runtime-rs-coresched
runtime-rs: add support for core scheduling
2022-08-29 14:28:30 +08:00
Bin Liu
25f54bb999
Merge pull request #4942 from ManaSugi/fix/use-versions-yaml-for-libseccomp
ci: Use versions.yaml for the libseccomp
2022-08-29 11:22:35 +08:00
Archana Shinde
c174eb809e
Merge pull request #4983 from ManaSugi/runk/add-init-msg
runk: Add cli message for init command
2022-08-27 00:15:25 +05:30
Ryan Savino
dc32c4622f osbuilder: fix ubuntu initrd /dev/ttyS0 hang
Guest log is showing a hang on systemd getty start.
Adding symlink for /dev/ttyS0 resolves issue.

Fixes: #4932

Signed-Off-By: Ryan Savino <ryan.savino@amd.com>
2022-08-26 04:59:36 -05:00
Ryan Savino
cc5f91dac7 osbuilder: add systemd symlinks for kata-agent
AGENT_INIT=no (systemd) add symlinks for kata-agent service.

Fixes: #4932

Signed-Off-By: Ryan Savino <ryan.savino@amd.com>
2022-08-26 04:59:36 -05:00
Fupan Li
63959b0be6
Merge pull request #5011 from liubin/fix/4962-add-logs
agent: add some logs for mount operation
2022-08-26 17:12:15 +08:00
Bin Liu
c08a8631e0 agent: add some logs for mount operation
Somewhere is lack of log info, add more details about
the storage and log when error will help understand
what happened.

Fixes: #4962

Signed-off-by: Bin Liu <bin@hyper.sh>
2022-08-26 14:09:56 +08:00
Archana Shinde
7d52934ec1
Merge pull request #4798 from amshinde/use-iouring-qemu
Use iouring for qemu block devices
2022-08-26 04:00:24 +05:30
Wainer Moschetta
cbe5e324ae
Merge pull request #4815 from bookinabox/improve-agent-errors
logging: Replace nix::Error::EINVAL with more descriptive msgs
2022-08-25 14:27:56 -03:00
Fabiano Fidêncio
1eea3d9920
Merge pull request #4965 from ryansavino/kata-deploy-threading-fix
kata-deploy: fix threading conflicts
2022-08-25 19:11:52 +02:00
Fabiano Fidêncio
70cd4f1320
Merge pull request #4999 from fidencio/topic/ignore-CONFIG_SPECULATION_MITIGATIONS-for-older-kernels
kernel: Ignore CONFIG_SPECULATION_MITIGATIONS for older kernels
2022-08-25 17:43:57 +02:00
Fabiano Fidêncio
0a6f0174f5 kernel: Ignore CONFIG_SPECULATION_MITIGATIONS for older kernels
TDX kernel is based on a kernel version which doesn't have the
CONFIG_SPECULATION_MITIGATIONS option.

Having this in the allow list for missing configs avoids a breakage in
the TDX CI.

Fixes: #4998

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
2022-08-25 10:51:13 +02:00
Bin Liu
cce99c5c73 runtime-rs: delete socket from shim command-line options
The socket is not used to specify the socket address, but
an ENV variable is used for runtime-rs.

Fixes: #4995

Signed-off-by: Bin Liu <bin@hyper.sh>
2022-08-25 15:32:17 +08:00
Bin Liu
a7e64b1ca9
Merge pull request #4892 from openanolis/shuoyu/runtime-rs
runtime-rs: support loading kernel modules in guest vm
2022-08-25 15:01:23 +08:00
Fabiano Fidêncio
ddc94e00b0
Merge pull request #4982 from fidencio/topic/improve-cloud-hypervisor-plus-tdx-support
TDX: Get TDX working again with Cloud Hypervisor + a minor change on QEMU's code
2022-08-25 08:53:10 +02:00
Bin Liu
875d946fb4
Merge pull request #4976 from ManaSugi/runk/refactor-delete-func
runk: Move delete logic to libcontainer
2022-08-25 14:30:30 +08:00
Yushuo
6cf16c4f76 agent-ctl: fix clippy error
Fixes: #4988

Signed-off-by: Yushuo <y-shuo@linux.alibaba.com>
2022-08-25 11:00:49 +08:00
Yushuo
4b57c04c33 runtime-rs: support loading kernel modules in guest vm
Users can specify the kernel module to be loaded through the agent
configuration in kata configuration file or in pod anotation file.

And information of those modules will be sent to kata agent when
sandbox is created.

Fixes: #4894

Signed-off-by: Yushuo <y-shuo@linux.alibaba.com>
2022-08-25 10:38:04 +08:00
Peng Tao
aa6bcacb7d
Merge pull request #4973 from bergwolf/github/go-depbot
runtime: cri-o annotations have been moved to podman
2022-08-25 10:12:06 +08:00
Peng Tao
78af76b72a
Merge pull request #4969 from bergwolf/github/depbot
Fix depbot reported rust crates dependency security issues
2022-08-25 10:11:54 +08:00
Fabiano Fidêncio
dc90eae17b qemu: Drop unnecessary tdx_guest kernel parameter
With the current TDX kernel used with Kata Containers, `tdx_guest` is
not needed, as TDX_GUEST is now a kernel configuration.

With this in mind, let's just drop the kernel parameter.

Fixes: #4981

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
2022-08-24 20:02:43 +02:00
Fabiano Fidêncio
d4b67613f0 clh: Use HVC console with TDX
As right now the TDX guest kernel doesn't support "serial" console,
let's switch to using HVC in this case.

Fixes: #4980

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
2022-08-24 20:02:40 +02:00
Fabiano Fidêncio
c0cb3cd4d8 clh: Avoid crashing when memory hotplug is not allowed
The runtime will crash when trying to resize memory when memory hotplug
is not allowed.

This happens because we cannot simply set the hotplug amount to zero,
leading is to not set memory hotplug at all, and later then trying to
access the value of a nil pointer.

Fixes: #4979

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
2022-08-24 20:02:22 +02:00
Fabiano Fidêncio
9f0a57c0eb clh: Increase API and SandboxStop timeouts for TDX
While doing tests using `ctr`, I've noticed that I've been hitting those
timeouts more frequently than expected.

Till we find the root cause of the issue (which is *not* in the Kata
Containers), let's increase the timeouts when dealing with a
Confidential Guest.

Fixes: #4978

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
2022-08-24 20:02:12 +02:00
Manabu Sugimoto
b535bac9c3 runk: Add cli message for init command
Add cli message for init command to tell the user
not to run this command directly.

Fixes: #4367

Signed-off-by: Manabu Sugimoto <Manabu.Sugimoto@sony.com>
2022-08-25 00:32:35 +09:00
Fabiano Fidêncio
c142fa2541 clh: Lift the sharedFS restriction used with TDX
When booting the TDX kernel with `tdx_disable_filter`, as it's been done
for QEMU, VirtioFS can work without any issues.

Whether this will be part of the upstream kernel or not is a different
story, but it easily could make it there as Cloud Hypervisor relies on
the VIRTIO_F_IOMMU_PLATFORM feature, which forces the guest to use the
DMA API, making these devices compatible with TDX.

See Sebastien Boeuf's explanation of this in the
3c973fa7ce208e7113f69424b7574b83f584885d commit:
"""
By using DMA API, the guest triggers the TDX codepath to share some of
the guest memory, in particular the virtqueues and associated buffers so
that the VMM and vhost-user backends/processes can access this memory.
"""

Fixes: #4977

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
2022-08-24 17:14:05 +02:00
Manabu Sugimoto
bdf8a57bdb runk: Move delete logic to libcontainer
Move delete logic to `libcontainer` crate to make the code clean
like other commands.

Fixes: #4975

Signed-off-by: Manabu Sugimoto <Manabu.Sugimoto@sony.com>
2022-08-24 19:12:36 +09:00
Peng Tao
a06d819b24 runtime: cri-o annotations have been moved to podman
Let's swith to depending on podman which also simplies indirect
dependency on kubernetes components. And it helps to avoid cri-o
security issues like CVE-2022-1708 as well.

Fixes: #4972
Signed-off-by: Peng Tao <bergwolf@hyper.sh>
2022-08-24 18:11:37 +08:00
Peng Tao
ffd1c1ff4f agent-ctl/trace-forwarder: udpate thread_local dependency
To bring in fix to CWE-362.

Fixes: #4968
Signed-off-by: Peng Tao <bergwolf@hyper.sh>
2022-08-24 17:10:49 +08:00
Peng Tao
69080d76da agent/runk: update regex dependency
To bring in fix to CVE-2022-24713.

Signed-off-by: Peng Tao <bergwolf@hyper.sh>
2022-08-24 17:02:15 +08:00
Peng Tao
e0ec09039d runtime-rs: update async-std dependency
So that we bump several indirect dependencies like crossbeam-channel,
crossbeam-utils to bring in fixes to known security issues like CVE-2020-15254.

Signed-off-by: Peng Tao <bergwolf@hyper.sh>
2022-08-24 16:56:29 +08:00
Bin Liu
2b5dc2ad39
Merge pull request #4705 from bergwolf/github/agent-ut-improve
UT: test_load_kernel_module needs root
2022-08-24 16:22:55 +08:00
Bin Liu
6551d4f25a
Merge pull request #4051 from bergwolf/github/vmx-vm-factory
enable vmx for vm factory
2022-08-24 16:22:37 +08:00
Bin Liu
ad91801240
Merge pull request #4870 from cyyzero/runk-cgroup
runk: add pause/resume commands
2022-08-24 14:44:43 +08:00
Derek Lee
763ceeb7ba logging: Replace nix::Error::EINVAL with more descriptive msgs
Replaces instances of anyhow!(nix::Error::EINVAL) with other messages to
make it easier to debug.

Fixes #954

Signed-off-by: Derek Lee <derlee@redhat.com>
2022-08-23 13:44:46 -07:00
Ryan Savino
4ee2b99e1e kata-deploy: fix threading conflicts
Fix threading conflicts when kata-deploy 'make kata-tarball' is called.
Force the creation of rootfs tarballs to happen serially instead of in parallel.

Fixes: #4787

Signed-Off-By: Ryan Savino <ryan.savino@amd.com>
2022-08-23 12:35:23 -05:00