aboutsummaryrefslogtreecommitdiff
path: root/net
diff options
context:
space:
mode:
authorAlex Shi <alex.shi@linaro.org>2017-11-22 12:01:54 +0800
committerAlex Shi <alex.shi@linaro.org>2017-11-22 12:01:54 +0800
commitc6c917192dccaef616c63f1d6acd0af45bf5cb84 (patch)
treeef82104b0b7c4c3f8342ed69e5961705b676d994 /net
parentef380b2c210541d6c6df7de360c09ec405a414d1 (diff)
parentc0426ccf530144f8af2e68165aa10cc52cd8f803 (diff)
Merge branch 'linux-linaro-lsk-v4.4' into linux-linaro-lsk-v4.4-android
Diffstat (limited to 'net')
-rw-r--r--net/sctp/socket.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/net/sctp/socket.c b/net/sctp/socket.c
index 73eec73ff733..7f0f689b8d2b 100644
--- a/net/sctp/socket.c
+++ b/net/sctp/socket.c
@@ -4453,6 +4453,10 @@ int sctp_do_peeloff(struct sock *sk, sctp_assoc_t id, struct socket **sockp)
struct socket *sock;
int err = 0;
+ /* Do not peel off from one netns to another one. */
+ if (!net_eq(current->nsproxy->net_ns, sock_net(sk)))
+ return -EINVAL;
+
if (!asoc)
return -EINVAL;