Files
linuxkit/alpine/kernel/patches-4.9/0001-VSOCK-Only-allow-host-network-namespace-to-use-AF_VS.patch
Rolf Neugebauer c3394ae3b3 kernel: add virtion_net csum fix and update patches to 4.9.4
Cherry-pick virtio_net csum fix and update patches based on:
https://github.com/rneugeba/linux-stable/tree/v4.9.4-moby

Signed-off-by: Rolf Neugebauer <rolf.neugebauer@docker.com>
2017-01-17 21:25:58 +00:00

31 lines
926 B
Diff

From a7fb60aeef7164c65c5aa266e7fdd5f95b3fdd68 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 1/7] 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 8a398b3fb532..0edc54c5e6ed 100644
--- a/net/vmw_vsock/af_vsock.c
+++ b/net/vmw_vsock/af_vsock.c
@@ -1852,6 +1852,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.11.0