diff mbox

net: Make sure BHs are disabled in sock_prot_inuse_add()

Message ID 492AE30C.70907@cosmosbay.com
State Accepted, archived
Delegated to: David Miller
Headers show

Commit Message

Eric Dumazet Nov. 24, 2008, 5:23 p.m. UTC
Third round of patch about sock_prot_inuse_add() ...

Thanks

[PATCH] net: Make sure BHs are disabled in sock_prot_inuse_add()

There is still a call to sock_prot_inuse_add() in af_netlink
while in a preemptable section. Add explicit BH disable around
this call.

Signed-off-by: Eric Dumazet <dada1@cosmosbay.com>

Comments

David Miller Nov. 24, 2008, 10:05 p.m. UTC | #1
From: Eric Dumazet <dada1@cosmosbay.com>
Date: Mon, 24 Nov 2008 18:23:24 +0100

> Third round of patch about sock_prot_inuse_add() ...
> 
> Thanks
> 
> [PATCH] net: Make sure BHs are disabled in sock_prot_inuse_add()
> 
> There is still a call to sock_prot_inuse_add() in af_netlink
> while in a preemptable section. Add explicit BH disable around
> this call.
> 
> Signed-off-by: Eric Dumazet <dada1@cosmosbay.com>

Applied, thanks Eric.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/net/netlink/af_netlink.c b/net/netlink/af_netlink.c
index c7d7657..9eb895c 100644
--- a/net/netlink/af_netlink.c
+++ b/net/netlink/af_netlink.c
@@ -515,7 +515,9 @@  static int netlink_release(struct socket *sock)
 	kfree(nlk->groups);
 	nlk->groups = NULL;
 
+	local_bh_disable();
 	sock_prot_inuse_add(sock_net(sk), &netlink_proto, -1);
+	local_bh_enable();
 	sock_put(sk);
 	return 0;
 }