netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] net: Make sure BHs are disabled in sock_prot_inuse_add()
@ 2008-11-24 17:23 Eric Dumazet
  2008-11-24 22:05 ` David Miller
  2008-11-25 20:35 ` Eric Dumazet
  0 siblings, 2 replies; 4+ messages in thread
From: Eric Dumazet @ 2008-11-24 17:23 UTC (permalink / raw)
  To: David S. Miller; +Cc: Linux Netdev List

[-- Attachment #1: Type: text/plain, Size: 314 bytes --]

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>

[-- Attachment #2: af_netlink.patch --]
[-- Type: text/plain, Size: 402 bytes --]

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;
 }

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] net: Make sure BHs are disabled in sock_prot_inuse_add()
  2008-11-24 17:23 [PATCH] net: Make sure BHs are disabled in sock_prot_inuse_add() Eric Dumazet
@ 2008-11-24 22:05 ` David Miller
  2008-11-25 20:35 ` Eric Dumazet
  1 sibling, 0 replies; 4+ messages in thread
From: David Miller @ 2008-11-24 22:05 UTC (permalink / raw)
  To: dada1; +Cc: netdev

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.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH] net: Make sure BHs are disabled in sock_prot_inuse_add()
  2008-11-24 17:23 [PATCH] net: Make sure BHs are disabled in sock_prot_inuse_add() Eric Dumazet
  2008-11-24 22:05 ` David Miller
@ 2008-11-25 20:35 ` Eric Dumazet
  2008-11-25 21:53   ` David Miller
  1 sibling, 1 reply; 4+ messages in thread
From: Eric Dumazet @ 2008-11-25 20:35 UTC (permalink / raw)
  To: David S. Miller; +Cc: Linux Netdev List

[-- Attachment #1: Type: text/plain, Size: 270 bytes --]

Oh well...

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

prot->destroy is not called with BH disabled. So we must add
explicit BH disable around call to sock_prot_inuse_add()
in sctp_destroy_sock()

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

[-- Attachment #2: sctp_prot_inuse.patch --]
[-- Type: text/plain, Size: 438 bytes --]

diff --git a/net/sctp/socket.c b/net/sctp/socket.c
index f03af84..ba81fe3 100644
--- a/net/sctp/socket.c
+++ b/net/sctp/socket.c
@@ -3633,7 +3633,9 @@ SCTP_STATIC void sctp_destroy_sock(struct sock *sk)
 	ep = sctp_sk(sk)->ep;
 	sctp_endpoint_free(ep);
 	atomic_dec(&sctp_sockets_allocated);
+	local_bh_disable();
 	sock_prot_inuse_add(sock_net(sk), sk->sk_prot, -1);
+	local_bh_enable();
 }
 
 /* API 4.1.7 shutdown() - TCP Style Syntax

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] net: Make sure BHs are disabled in sock_prot_inuse_add()
  2008-11-25 20:35 ` Eric Dumazet
@ 2008-11-25 21:53   ` David Miller
  0 siblings, 0 replies; 4+ messages in thread
From: David Miller @ 2008-11-25 21:53 UTC (permalink / raw)
  To: dada1; +Cc: netdev

From: Eric Dumazet <dada1@cosmosbay.com>
Date: Tue, 25 Nov 2008 21:35:23 +0100

> Oh well...
> 
> [PATCH] net: Make sure BHs are disabled in sock_prot_inuse_add()
> 
> prot->destroy is not called with BH disabled. So we must add
> explicit BH disable around call to sock_prot_inuse_add()
> in sctp_destroy_sock()
> 
> Signed-off-by: Eric Dumazet <dada1@cosmosbay.com>

At least it was found eventually :)

Applied, thanks Eric.

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2008-11-25 21:53 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-11-24 17:23 [PATCH] net: Make sure BHs are disabled in sock_prot_inuse_add() Eric Dumazet
2008-11-24 22:05 ` David Miller
2008-11-25 20:35 ` Eric Dumazet
2008-11-25 21:53   ` David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).