Skip to content

Commit 2b9bb7f

Browse files
ying-xuedavem330
authored andcommitted
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: Ying Xue <[email protected]> Reviewed-by: Erik Hugne <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 8460504 commit 2b9bb7f

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

net/tipc/server.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,7 @@ static void tipc_clean_outqueues(struct tipc_conn *con);
9090
static void tipc_conn_kref_release(struct kref *kref)
9191
{
9292
struct tipc_conn *con = container_of(kref, struct tipc_conn, kref);
93+
struct sockaddr_tipc *saddr = con->server->saddr;
9394
struct socket *sock = con->sock;
9495
struct sock *sk;
9596

@@ -99,6 +100,8 @@ static void tipc_conn_kref_release(struct kref *kref)
99100
__module_get(sock->ops->owner);
100101
__module_get(sk->sk_prot_creator->owner);
101102
}
103+
saddr->scope = -TIPC_NODE_SCOPE;
104+
kernel_bind(sock, (struct sockaddr *)saddr, sizeof(*saddr));
102105
sk_release_kernel(sk);
103106
con->sock = NULL;
104107
}

0 commit comments

Comments
 (0)