提交 c48dad7e 编写于 作者: E Eric W. Biederman 提交者: David S. Miller

[NET]: Disable netfilter sockopts when not in the initial network namespace

Until we support multiple network namespaces with netfilter only allow
netfilter configuration in the initial network namespace.
Signed-off-by: NEric W. Biederman <ebiederm@xmission.com>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 d8a5ec67
......@@ -69,6 +69,9 @@ static int nf_sockopt(struct sock *sk, int pf, int val,
struct nf_sockopt_ops *ops;
int ret;
if (sk->sk_net != &init_net)
return -ENOPROTOOPT;
if (mutex_lock_interruptible(&nf_sockopt_mutex) != 0)
return -EINTR;
......@@ -125,6 +128,10 @@ static int compat_nf_sockopt(struct sock *sk, int pf, int val,
struct nf_sockopt_ops *ops;
int ret;
if (sk->sk_net != &init_net)
return -ENOPROTOOPT;
if (mutex_lock_interruptible(&nf_sockopt_mutex) != 0)
return -EINTR;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册