public inbox for netdev@vger.kernel.org 
 help / color / mirror / Atom feed
From: Jarek Poplawski <jarkao2@gmail•com>
To: Jann Traschewski <jann@gmx•de>
Cc: Ralf Baechle <ralf@linux-mips•org>, netdev@vger•kernel.org
Subject: [BUG][AX25] Fwd: SMP with AX.25
Date: Wed, 6 Feb 2008 09:30:50 +0000	[thread overview]
Message-ID: <20080206093050.GF4496@ff.dom.local> (raw)
In-Reply-To: <20080206074529.GC4496@ff.dom.local>

On Wed, Feb 06, 2008 at 07:45:29AM +0000, Jarek Poplawski wrote:
...
> From: Jann Traschewski <jann@gmx•de>
> Subject: SMP with AX.25
> To: jarkao2@gmail•com

According to one of OOPSes reported by Jann softirq can break
while skb is prepared for netif_rx. The report isn't complete,
so the real reason of the later bug could be different, but
IMHO this locking in ax_bump is wrong.

I attach this patch for testing purpose only.

Jarek P.

---

 drivers/net/hamradio/mkiss.c |    5 ++---
 1 files changed, 2 insertions(+), 3 deletions(-)

diff --git a/drivers/net/hamradio/mkiss.c b/drivers/net/hamradio/mkiss.c
index cfcd15a..30c9b3b 100644
--- a/drivers/net/hamradio/mkiss.c
+++ b/drivers/net/hamradio/mkiss.c
@@ -289,7 +289,6 @@ static void ax_bump(struct mkiss *ax)
 			*ax->rbuff &= ~0x20;
 		}
  	}
-	spin_unlock_bh(&ax->buflock);
 
 	count = ax->rcount;
 
@@ -297,17 +296,17 @@ static void ax_bump(struct mkiss *ax)
 		printk(KERN_ERR "mkiss: %s: memory squeeze, dropping packet.\n",
 		       ax->dev->name);
 		ax->stats.rx_dropped++;
+		spin_unlock_bh(&ax->buflock);
 		return;
 	}
 
-	spin_lock_bh(&ax->buflock);
 	memcpy(skb_put(skb,count), ax->rbuff, count);
-	spin_unlock_bh(&ax->buflock);
 	skb->protocol = ax25_type_trans(skb, ax->dev);
 	netif_rx(skb);
 	ax->dev->last_rx = jiffies;
 	ax->stats.rx_packets++;
 	ax->stats.rx_bytes += count;
+	spin_unlock_bh(&ax->buflock);
 }
 
 static void kiss_unesc(struct mkiss *ax, unsigned char s)

  parent reply	other threads:[~2008-02-06  9:23 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <00f201c8694a$2770f630$453c822c@dg8ngn>
     [not found] ` <cd9157050802071100m76a742bbyb18f4448d8ec436b@mail.gmail.com>
2008-02-06  7:45   ` [BUG][AX25] Fwd: SMP with AX.25 Jarek Poplawski
2008-02-06  8:15     ` [PATCH][AX25] " Jarek Poplawski
2008-02-06  9:14       ` [PATCH][AX25] ax25_ds_timer: use mod_timer instead of add_timer Jarek Poplawski
2008-02-10 18:23         ` Jann Traschewski
2008-02-12  5:38         ` David Miller
2008-02-12  5:37       ` [PATCH][AX25] Fwd: SMP with AX.25 David Miller
2008-02-06  9:30     ` Jarek Poplawski [this message]
2008-02-07 12:07     ` [BUG][AX25] " Jarek Poplawski
2008-02-07 19:34     ` Jarek Poplawski
2008-02-07 19:35     ` Jarek Poplawski
2008-02-07 20:34       ` Jarek Poplawski
2008-02-13 11:17     ` [PATCH][AX25] mkiss: ax_bump() locking fix Jarek Poplawski
2008-02-15 15:53       ` Jeff Garzik
2008-02-13 11:56     ` [PATCH][AX25] ax25_out: check skb for NULL in ax25_kick() Jarek Poplawski
2008-02-14  0:49       ` Jann Traschewski
2008-03-09  9:02         ` Pidoux
2008-03-09 14:30           ` Jarek Poplawski
2008-03-09 17:34             ` Jann Traschewski
2008-03-09 18:03               ` Jarek Poplawski
2008-03-24  5:03             ` David Miller
2008-02-18  6:31       ` 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=20080206093050.GF4496@ff.dom.local \
    --to=jarkao2@gmail$(echo .)com \
    --cc=jann@gmx$(echo .)de \
    --cc=netdev@vger$(echo .)kernel.org \
    --cc=ralf@linux-mips$(echo .)org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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