Commit d0b169d2 authored by Ralf Bächle's avatar Ralf Bächle Committed by Greg Kroah-Hartman

[PATCH] NetROM locking

Fix deadlock in NetROM due to double locking.  I was sent the patch by
Alan and have doublechecked it.  This bug hits Net/ROM users really hard.
It's accepted by DaveM - but just too late to make it into 2.6.11.
Signed-off-by: default avatarRalf Baechle <ralf@linux-mips.org>
Signed-off-by: default avatarChris Wright <chrisw@osdl.org>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent 8936f70a
...@@ -74,7 +74,6 @@ static int nr_queue_rx_frame(struct sock *sk, struct sk_buff *skb, int more) ...@@ -74,7 +74,6 @@ static int nr_queue_rx_frame(struct sock *sk, struct sk_buff *skb, int more)
static int nr_state1_machine(struct sock *sk, struct sk_buff *skb, static int nr_state1_machine(struct sock *sk, struct sk_buff *skb,
int frametype) int frametype)
{ {
bh_lock_sock(sk);
switch (frametype) { switch (frametype) {
case NR_CONNACK: { case NR_CONNACK: {
nr_cb *nr = nr_sk(sk); nr_cb *nr = nr_sk(sk);
...@@ -103,8 +102,6 @@ static int nr_state1_machine(struct sock *sk, struct sk_buff *skb, ...@@ -103,8 +102,6 @@ static int nr_state1_machine(struct sock *sk, struct sk_buff *skb,
default: default:
break; break;
} }
bh_unlock_sock(sk);
return 0; return 0;
} }
...@@ -116,7 +113,6 @@ static int nr_state1_machine(struct sock *sk, struct sk_buff *skb, ...@@ -116,7 +113,6 @@ static int nr_state1_machine(struct sock *sk, struct sk_buff *skb,
static int nr_state2_machine(struct sock *sk, struct sk_buff *skb, static int nr_state2_machine(struct sock *sk, struct sk_buff *skb,
int frametype) int frametype)
{ {
bh_lock_sock(sk);
switch (frametype) { switch (frametype) {
case NR_CONNACK | NR_CHOKE_FLAG: case NR_CONNACK | NR_CHOKE_FLAG:
nr_disconnect(sk, ECONNRESET); nr_disconnect(sk, ECONNRESET);
...@@ -132,8 +128,6 @@ static int nr_state2_machine(struct sock *sk, struct sk_buff *skb, ...@@ -132,8 +128,6 @@ static int nr_state2_machine(struct sock *sk, struct sk_buff *skb,
default: default:
break; break;
} }
bh_unlock_sock(sk);
return 0; return 0;
} }
...@@ -154,7 +148,6 @@ static int nr_state3_machine(struct sock *sk, struct sk_buff *skb, int frametype ...@@ -154,7 +148,6 @@ static int nr_state3_machine(struct sock *sk, struct sk_buff *skb, int frametype
nr = skb->data[18]; nr = skb->data[18];
ns = skb->data[17]; ns = skb->data[17];
bh_lock_sock(sk);
switch (frametype) { switch (frametype) {
case NR_CONNREQ: case NR_CONNREQ:
nr_write_internal(sk, NR_CONNACK); nr_write_internal(sk, NR_CONNACK);
...@@ -265,8 +258,6 @@ static int nr_state3_machine(struct sock *sk, struct sk_buff *skb, int frametype ...@@ -265,8 +258,6 @@ static int nr_state3_machine(struct sock *sk, struct sk_buff *skb, int frametype
default: default:
break; break;
} }
bh_unlock_sock(sk);
return queued; return queued;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment