summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHerbert Xu <herbert@gondor.apana.org.au>2015-12-08 14:13:19 +0800
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2015-12-09 14:03:28 -0500
commita52ec6de6d1638e8c203d7188c55627f75371612 (patch)
treeb84b09e3d9d1901b1ae18e3e4faff013568e3bb1
parent3f11689e161c77fa0bcda8a5aa3b4829c7da7fab (diff)
netlink: Add missing goto statement to netlink_insert
The backport of 1f770c0a09da855a2b51af6d19de97fb955eca85 ("netlink: Fix autobind race condition that leads to zero port ID") missed a goto statement, which causes netlink to break subtly. This was discovered by Stefan Priebe <s.priebe@profihost.ag>. Fixes: 4e2776241766 ("netlink: Fix autobind race condition that...") Reported-by: Stefan Priebe <s.priebe@profihost.ag> Reported-by: Philipp Hahn <pmhahn@pmhahn.de> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au> Acked-by: David S. Miller <davem@davemloft.net> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--net/netlink/af_netlink.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/net/netlink/af_netlink.c b/net/netlink/af_netlink.c
index d139c43ac6e5..0d6038c87bef 100644
--- a/net/netlink/af_netlink.c
+++ b/net/netlink/af_netlink.c
@@ -1118,6 +1118,7 @@ static int netlink_insert(struct sock *sk, u32 portid)
if (err == -EEXIST)
err = -EADDRINUSE;
sock_put(sk);
+ goto err;
}
/* We need to ensure that the socket is hashed and visible. */