提交 2b9bb7f3 编写于 作者: Y Ying Xue 提交者: David S. Miller

tipc: withdraw tipc topology server name when namespace is deleted

The TIPC topology server is a per namespace service associated with the
tipc name {1, 1}. When a namespace is deleted, that name must be withdrawn
before we call sk_release_kernel because the kernel socket release is
done in init_net and trying to withdraw a TIPC name published in another
namespace will fail with an error as:

[  170.093264] Unable to remove local publication
[  170.093264] (type=1, lower=1, ref=2184244004, key=2184244005)

We fix this by breaking the association between the topology server name
and socket before calling sk_release_kernel.
Signed-off-by: NYing Xue <ying.xue@windriver.com>
Reviewed-by: NErik Hugne <erik.hugne@ericsson.com>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 8460504b
...@@ -90,6 +90,7 @@ static void tipc_clean_outqueues(struct tipc_conn *con); ...@@ -90,6 +90,7 @@ static void tipc_clean_outqueues(struct tipc_conn *con);
static void tipc_conn_kref_release(struct kref *kref) static void tipc_conn_kref_release(struct kref *kref)
{ {
struct tipc_conn *con = container_of(kref, struct tipc_conn, kref); struct tipc_conn *con = container_of(kref, struct tipc_conn, kref);
struct sockaddr_tipc *saddr = con->server->saddr;
struct socket *sock = con->sock; struct socket *sock = con->sock;
struct sock *sk; struct sock *sk;
...@@ -99,6 +100,8 @@ static void tipc_conn_kref_release(struct kref *kref) ...@@ -99,6 +100,8 @@ static void tipc_conn_kref_release(struct kref *kref)
__module_get(sock->ops->owner); __module_get(sock->ops->owner);
__module_get(sk->sk_prot_creator->owner); __module_get(sk->sk_prot_creator->owner);
} }
saddr->scope = -TIPC_NODE_SCOPE;
kernel_bind(sock, (struct sockaddr *)saddr, sizeof(*saddr));
sk_release_kernel(sk); sk_release_kernel(sk);
con->sock = NULL; con->sock = NULL;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册