[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <1450112125-29848-1-git-send-email-hannes@stressinduktion.org>
Date: Mon, 14 Dec 2015 17:55:25 +0100
From: Hannes Frederic Sowa <hannes@...essinduktion.org>
To: netdev@...r.kernel.org
Cc: Herbert Xu <herbert@...dor.apana.org.au>
Subject: [PATCH net] netlink: fix boolean evaluation on bound
portid may be 0, thus bound will set the flag to false for in-kernel
created netlink sockets.
Fixes: da314c9923fed55 ("netlink: Replace rhash_portid with bound")
Cc: Herbert Xu <herbert@...dor.apana.org.au>
Signed-off-by: Hannes Frederic Sowa <hannes@...essinduktion.org>
---
This patch should not affect anything and is just meant to close this
loophole in future. I based it on net, but you can also apply it to
net-next.
net/netlink/af_netlink.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/net/netlink/af_netlink.c b/net/netlink/af_netlink.c
index 59651af8cc2705..278e94c3c7f6d1 100644
--- a/net/netlink/af_netlink.c
+++ b/net/netlink/af_netlink.c
@@ -1137,7 +1137,7 @@ static int netlink_insert(struct sock *sk, u32 portid)
/* We need to ensure that the socket is hashed and visible. */
smp_wmb();
- nlk_sk(sk)->bound = portid;
+ nlk_sk(sk)->bound = true;
err:
release_sock(sk);
--
2.5.0
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists