mirror of
https://github.com/linuxkit/linuxkit.git
synced 2025-12-06 19:33:22 +00:00
These are WIP taken from git@github.com:stefanha/linux.git#vsock (==4c9d2a6be1c6, using "cherry-pick -x") and correspond to RFC v5 of the frontend patches posted in http://thread.gmane.org/gmane.linux.kernel.virtualization/27455 There is no corresponding spec proposal update yet, but this set of patches correspond (roughly) to addressing the feedback on v4 of the spec proposal http://thread.gmane.org/gmane.comp.emulators.virtio.devel/1062. kernel_config.arm modifications copied from x86, not tested. Added /etc/kernel-patches/ directory to the image to be consumed by the licensing. Signed-off-by: Ian Campbell <ian.campbell@docker.com>
31 lines
919 B
Diff
31 lines
919 B
Diff
From 366c9c42afb9bd54f92f72518470c09e46f12e88 Mon Sep 17 00:00:00 2001
|
|
From: Ian Campbell <ian.campbell@docker.com>
|
|
Date: Mon, 4 Apr 2016 14:50:10 +0100
|
|
Subject: [PATCH 9/9] VSOCK: Only allow host network namespace to use AF_VSOCK.
|
|
|
|
The VSOCK addressing schema does not really lend itself to simply creating an
|
|
alternative end point address within a namespace.
|
|
|
|
Signed-off-by: Ian Campbell <ian.campbell@docker.com>
|
|
---
|
|
net/vmw_vsock/af_vsock.c | 3 +++
|
|
1 file changed, 3 insertions(+)
|
|
|
|
diff --git a/net/vmw_vsock/af_vsock.c b/net/vmw_vsock/af_vsock.c
|
|
index 1e5f5ed..cdb3dd3 100644
|
|
--- a/net/vmw_vsock/af_vsock.c
|
|
+++ b/net/vmw_vsock/af_vsock.c
|
|
@@ -1840,6 +1840,9 @@ static const struct proto_ops vsock_stream_ops = {
|
|
static int vsock_create(struct net *net, struct socket *sock,
|
|
int protocol, int kern)
|
|
{
|
|
+ if (!net_eq(net, &init_net))
|
|
+ return -EAFNOSUPPORT;
|
|
+
|
|
if (!sock)
|
|
return -EINVAL;
|
|
|
|
--
|
|
2.8.0.rc3
|
|
|