mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Shaun Pereira <spereira@tusc.com.au>
To: Andrew Morton <akpm@osdl.org>, netdev <netdev@vger.kernel.org>,
	x25 maintainer <eis@baty.hanse.de>,
	linux-x25 <linux-x25@vger.kernel.org>,
	linux-kenel <linux-kernel@vger.kernel.org>
Subject: [PATCH 1/1]x25: fix for spinlock recurse and spinlock lockup with timer handler in x25
Date: Thu, 20 Apr 2006 15:03:23 +1000	[thread overview]
Message-ID: <1145509403.16180.10.camel@spereira05.tusc.com.au> (raw)

From: spereira@tusc.com.au

When the sk_timer function x25_heartbeat_expiry() is called by the kernel
in a running/terminating process, spinlock-recursion and spinlock-lockup
locks up the kernel. 
This has happened with testing on some distro's and the patch below fixed it.

Signed-off-by:Shaun Pereira <spereira@tusc.com.au>

diff -uprN -X dontdiff linux-2.6.17-rc2-vanilla/net/x25/x25_timer.c linux-2.6.17-rc2/net/x25/x25_timer.c
--- linux-2.6.17-rc2-vanilla/net/x25/x25_timer.c	2006-04-20 12:00:03.000000000 +1000
+++ linux-2.6.17-rc2/net/x25/x25_timer.c	2006-04-20 12:02:43.000000000 +1000
@@ -114,8 +114,9 @@ static void x25_heartbeat_expiry(unsigne
 			if (sock_flag(sk, SOCK_DESTROY) ||
 			    (sk->sk_state == TCP_LISTEN &&
 			     sock_flag(sk, SOCK_DEAD))) {
+				bh_unlock_sock(sk);
 				x25_destroy_socket(sk);
-				goto unlock;
+				return;
 			}
 			break;
 
@@ -128,7 +129,6 @@ static void x25_heartbeat_expiry(unsigne
 	}
 restart_heartbeat:
 	x25_start_heartbeat(sk);
-unlock:
 	bh_unlock_sock(sk);
 }
 






             reply	other threads:[~2006-04-20  5:04 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-04-20  5:03 Shaun Pereira [this message]
2006-04-28 19:00 ` David S. 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=1145509403.16180.10.camel@spereira05.tusc.com.au \
    --to=spereira@tusc.com.au \
    --cc=akpm@osdl.org \
    --cc=eis@baty.hanse.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-x25@vger.kernel.org \
    --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

all inboxes | Powered by JetHome®