mirror of
https://github.com/kata-containers/kata-containers.git
synced 2025-04-29 20:24:31 +00:00
packaging: make build-kernel.sh work for 2.0
We do not need to clone packaging repository, nor apply virtio_vsock as virtio-fs-dev has already included that fix. Signed-off-by: Peng Tao <bergwolf@hyper.sh>
This commit is contained in:
parent
aa3fb4db28
commit
5216815d1c
@ -27,18 +27,16 @@ kernel_version=""
|
|||||||
# Flag know if need to download the kernel source
|
# Flag know if need to download the kernel source
|
||||||
download_kernel=false
|
download_kernel=false
|
||||||
# The repository where kernel configuration lives
|
# The repository where kernel configuration lives
|
||||||
runtime_repository="github.com/${project_name}/runtime"
|
|
||||||
# The repository where kernel configuration lives
|
|
||||||
readonly kernel_config_repo="github.com/${project_name}/kata-containers/tools/packaging"
|
readonly kernel_config_repo="github.com/${project_name}/kata-containers/tools/packaging"
|
||||||
readonly patches_repo="github.com/${project_name}/kata-containers/tools/packaging"
|
readonly patches_repo="github.com/${project_name}/kata-containers/tools/packaging"
|
||||||
readonly patches_repo_dir="${GOPATH}/src/${patches_repo}"
|
readonly patches_repo_dir="${GOPATH}/src/${patches_repo}"
|
||||||
# Default path to search patches to apply to kernel
|
# Default path to search patches to apply to kernel
|
||||||
readonly default_patches_dir="${patches_repo_dir}/kernel/patches/"
|
readonly default_patches_dir="${script_dir}/patches/"
|
||||||
# Default path to search config for kata
|
# Default path to search config for kata
|
||||||
readonly default_kernel_config_dir="${GOPATH}/src/${kernel_config_repo}/kernel/configs"
|
readonly default_kernel_config_dir="${script_dir}/configs"
|
||||||
# Default path to search for kernel config fragments
|
# Default path to search for kernel config fragments
|
||||||
readonly default_config_frags_dir="${GOPATH}/src/${kernel_config_repo}/kernel/configs/fragments"
|
readonly default_config_frags_dir="${script_dir}/configs/fragments"
|
||||||
readonly default_config_whitelist="${GOPATH}/src/${kernel_config_repo}/kernel/configs/fragments/whitelist.conf"
|
readonly default_config_whitelist="${script_dir}/configs/fragments/whitelist.conf"
|
||||||
# GPU vendor
|
# GPU vendor
|
||||||
readonly GV_INTEL="intel"
|
readonly GV_INTEL="intel"
|
||||||
readonly GV_NVIDIA="nvidia"
|
readonly GV_NVIDIA="nvidia"
|
||||||
@ -291,16 +289,6 @@ get_default_kernel_config() {
|
|||||||
get_config_and_patches() {
|
get_config_and_patches() {
|
||||||
if [ -z "${patches_path}" ]; then
|
if [ -z "${patches_path}" ]; then
|
||||||
patches_path="${default_patches_dir}"
|
patches_path="${default_patches_dir}"
|
||||||
if [ ! -d "${patches_path}" ]; then
|
|
||||||
tag="${kata_version}"
|
|
||||||
git clone -q "https://${patches_repo}.git" "${patches_repo_dir}"
|
|
||||||
pushd "${patches_repo_dir}" >> /dev/null
|
|
||||||
if [ -n $tag ] ; then
|
|
||||||
info "checking out $tag"
|
|
||||||
git checkout -q $tag
|
|
||||||
fi
|
|
||||||
popd >> /dev/null
|
|
||||||
fi
|
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,49 +0,0 @@
|
|||||||
From c7ec155ec5e0f573e9c3cc4eb38d47543a2f1e81 Mon Sep 17 00:00:00 2001
|
|
||||||
From: Sebastien Boeuf <sebastien.boeuf@intel.com>
|
|
||||||
Date: Thu, 13 Feb 2020 08:50:38 +0100
|
|
||||||
Subject: [PATCH] net: virtio_vsock: Fix race condition between bind and listen
|
|
||||||
|
|
||||||
Whenever the vsock backend on the host sends a packet through the RX
|
|
||||||
queue, it expects an answer on the TX queue. Unfortunately, there is one
|
|
||||||
case where the host side will hang waiting for the answer and will
|
|
||||||
effectively never recover.
|
|
||||||
|
|
||||||
This issue happens when the guest side starts binding to the socket,
|
|
||||||
which insert a new bound socket into the list of already bound sockets.
|
|
||||||
At this time, we expect the guest to also start listening, which will
|
|
||||||
trigger the sk_state to move from TCP_CLOSE to TCP_LISTEN. The problem
|
|
||||||
occurs if the host side queued a RX packet and triggered an interrupt
|
|
||||||
right between the end of the binding process and the beginning of the
|
|
||||||
listening process. In this specific case, the function processing the
|
|
||||||
packet virtio_transport_recv_pkt() will find a bound socket, which means
|
|
||||||
it will hit the switch statement checking for the sk_state, but the
|
|
||||||
state won't be changed into TCP_LISTEN yet, which leads the code to pick
|
|
||||||
the default statement. This default statement will only free the buffer,
|
|
||||||
while it should also respond to the host side, by sending a packet on
|
|
||||||
its TX queue.
|
|
||||||
|
|
||||||
In order to simply fix this unfortunate chain of events, it is important
|
|
||||||
that in case the default statement is entered, and because at this stage
|
|
||||||
we know the host side is waiting for an answer, we must send back a
|
|
||||||
packet containing the operation VIRTIO_VSOCK_OP_RST.
|
|
||||||
|
|
||||||
Signed-off-by: Sebastien Boeuf <sebastien.boeuf@intel.com>
|
|
||||||
---
|
|
||||||
net/vmw_vsock/virtio_transport_common.c | 1 +
|
|
||||||
1 file changed, 1 insertion(+)
|
|
||||||
|
|
||||||
diff --git a/net/vmw_vsock/virtio_transport_common.c b/net/vmw_vsock/virtio_transport_common.c
|
|
||||||
index 6f1a8aff65c5..0b6fb687a3e0 100644
|
|
||||||
--- a/net/vmw_vsock/virtio_transport_common.c
|
|
||||||
+++ b/net/vmw_vsock/virtio_transport_common.c
|
|
||||||
@@ -1048,6 +1048,7 @@ void virtio_transport_recv_pkt(struct virtio_vsock_pkt *pkt)
|
|
||||||
virtio_transport_free_pkt(pkt);
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
+ (void)virtio_transport_reset_no_sock(t, pkt);
|
|
||||||
virtio_transport_free_pkt(pkt);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
--
|
|
||||||
2.20.1
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user