All of lore.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: Thu, 7 Feb 2008 12:07:27 +0000	[thread overview]
Message-ID: <20080207120727.GA2628@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

(testing patch #2)

According to some OOPSes reported by Jann it seems ax25_kick
tries to clone NULL skbs sometimes. Probably there is needed
a sock lock, but until it's checked more this patch should
help to avoid this. There are probably also cases where ax25
->paclen == 0 can happen: let's check for this.

I attach this patch for testing purpose only.

Jarek P.

---

diff -Nurp 2.6.24-/net/ax25/ax25_out.c 2.6.24+/net/ax25/ax25_out.c
--- 2.6.24-/net/ax25/ax25_out.c	2008-01-24 22:58:37.000000000 +0000
+++ 2.6.24+/net/ax25/ax25_out.c	2008-02-07 11:48:39.000000000 +0000
@@ -117,6 +117,12 @@ void ax25_output(ax25_cb *ax25, int pacl
 	unsigned char *p;
 	int frontlen, len, fragno, ka9qfrag, first = 1;
 
+	if (paclen < 16) {
+		WARN_ON_ONCE(1);
+		kfree_skb(skb);
+		return;
+	}
+
 	if ((skb->len - 1) > paclen) {
 		if (*skb->data == AX25_P_TEXT) {
 			skb_pull(skb, 1); /* skip PID */
@@ -263,6 +269,8 @@ void ax25_kick(ax25_cb *ax25)
 	 * Dequeue the frame and copy it.
 	 */
 	skb  = skb_dequeue(&ax25->write_queue);
+	if (!skb)
+		return;
 
 	do {
 		if ((skbn = skb_clone(skb, GFP_ATOMIC)) == NULL) {

  parent reply	other threads:[~2008-02-07 12:00 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     ` [BUG][AX25] " Jarek Poplawski
2008-02-07 12:07     ` Jarek Poplawski [this message]
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=20080207120727.GA2628@ff.dom.local \
    --to=jarkao2@gmail.com \
    --cc=jann@gmx.de \
    --cc=netdev@vger.kernel.org \
    --cc=ralf@linux-mips.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.