public inbox for netdev@vger.kernel.org
 help / color / mirror / Atom feed
From: "Jann Traschewski" <jann@gmx.de>
To: "'Jarek Poplawski'" <jarkao2@gmail.com>,
	"'David Miller'" <davem@davemloft.net>
Cc: "'Bernard Pidoux F6BVP'" <f6bvp@free.fr>,
	"'Ralf Baechle'" <ralf@linux-mips.org>, <netdev@vger.kernel.org>
Subject: Re: [PATCH][AX25] ax25_out: check skb for NULL in ax25_kick()
Date: Thu, 14 Feb 2008 01:49:29 +0100	[thread overview]
Message-ID: <025801c86ea3$75add3f0$453c822c@dg8ngn> (raw)
In-Reply-To: <20080213115607.GB2867@ff.dom.local>

Applied and stable with Kernel 2.6.24.2 since 12 hours.
Regards,
Jann

> -----Ursprüngliche Nachricht-----
> Von: Jarek Poplawski [mailto:jarkao2@gmail.com] 
> Gesendet: Mittwoch, 13. Februar 2008 12:56
> An: David Miller
> Cc: Jann Traschewski; Bernard Pidoux F6BVP; Ralf Baechle; 
> netdev@vger.kernel.org
> Betreff: [PATCH][AX25] ax25_out: check skb for NULL in ax25_kick()
> 
> Hi,
> 
> Here is an "official" version of "testing patch #2" from this thread.
> The only difference: ax25->vs is changed only after checking 
> skb is not NULL (plus a comment). IMHO it could be applied.
> 
> Thanks,
> Jarek P.
> 
> ---------------->
> 
> Subject: [AX25] ax25_out: check skb for NULL in ax25_kick()
> 
> According to some OOPS reports ax25_kick tries to clone NULL 
> skbs sometimes. It looks like a race with 
> ax25_clear_queues(). Probably there is no need to add more 
> than a simple check for this yet.
> Another report suggested there are probably also cases where ax25
> ->paclen == 0 can happen in ax25_output(); this wasn't confirmed
> during testing but let's leave this debugging check for some time.
> 
> 
> Reported-and-tested-by: Jann Traschewski <jann@gmx.de>
> Signed-off-by: Jarek Poplawski <jarkao2@gmail.com>
> 
> ---
> 
> diff -Nurp 2.6.24-mm1-/net/ax25/ax25_out.c 
> 2.6.24-mm1+/net/ax25/ax25_out.c
> --- 2.6.24-mm1-/net/ax25/ax25_out.c	2008-01-24 
> 22:58:37.000000000 +0000
> +++ 2.6.24-mm1+/net/ax25/ax25_out.c	2008-02-13 
> 10:43:50.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 */
> @@ -251,8 +257,6 @@ void ax25_kick(ax25_cb *ax25)
>  	if (start == end)
>  		return;
>  
> -	ax25->vs = start;
> -
>  	/*
>  	 * Transmit data until either we're out of data to send or
>  	 * the window is full. Send a poll on the final I frame 
> if @@ -261,8 +265,13 @@ void ax25_kick(ax25_cb *ax25)
>  
>  	/*
>  	 * Dequeue the frame and copy it.
> +	 * Check for race with ax25_clear_queues().
>  	 */
>  	skb  = skb_dequeue(&ax25->write_queue);
> +	if (!skb)
> +		return;
> +
> +	ax25->vs = start;
>  
>  	do {
>  		if ((skbn = skb_clone(skb, GFP_ATOMIC)) == NULL) {


  reply	other threads:[~2008-02-14  0:49 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
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 [this message]
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='025801c86ea3$75add3f0$453c822c@dg8ngn' \
    --to=jann@gmx.de \
    --cc=davem@davemloft.net \
    --cc=f6bvp@free.fr \
    --cc=jarkao2@gmail.com \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox