netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Eric Dumazet <dada1@cosmosbay.com>
To: "David S. Miller" <davem@davemloft.net>
Cc: Linux Netdev List <netdev@vger.kernel.org>
Subject: [PATCH] net: Make sure BHs are disabled in sock_prot_inuse_add()
Date: Tue, 25 Nov 2008 21:35:23 +0100	[thread overview]
Message-ID: <492C618B.8090403@cosmosbay.com> (raw)
In-Reply-To: <492AE30C.70907@cosmosbay.com>

[-- 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

  parent reply	other threads:[~2008-11-25 20:35 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
2008-11-25 21:53   ` David Miller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=492C618B.8090403@cosmosbay.com \
    --to=dada1@cosmosbay.com \
    --cc=davem@davemloft.net \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).