All of lore.kernel.org
 help / color / mirror / Atom feed
From: Patrick McHardy <kaber@trash.net>
To: Matt Walters <mattw@parasun.com>
Cc: netfilter-devel@lists.netfilter.org
Subject: Re: libipq, kernel panics/oopses, and other undesirable traits
Date: Tue, 17 Aug 2004 12:40:02 +0200	[thread overview]
Message-ID: <4121E082.6050602@trash.net> (raw)
In-Reply-To: <1092703243.22731.1778.camel@marx.mindlink.net>

[-- Attachment #1: Type: text/plain, Size: 817 bytes --]

Matt Walters wrote:

>On Mon, 2004-08-16 at 15:38, Patrick McHardy wrote:
>
>>skb_tailroom should return 0 in this case and the skb should be linearized
>>by skb_copy_expand already. The check isn't triggered because this line is
>>wrong:
>>
>>diff = v->data_len - e->skb->len
>>
>>skb->len is the total length, including fragments. If we want to copy to it,
>>we either need to linearize it or look at skb_headlen(skb). It's complicated
>>getting everything right, I need to think about it some more.
>>    
>>

This patch on top of the ip_queue_nonlinear_skbs patch should fix the 
problem.
It wastes a couple of bytes when enlarging a non-linear skb, but that 
shouldn't be
a problem. When you test it, please try all three possibilities (replace 
by smaller,
equally sized and larger packet).

Regards
Patrick




[-- Attachment #2: x --]
[-- Type: text/plain, Size: 401 bytes --]

===== net/ipv4/netfilter/ip_queue.c 1.16 vs edited =====
--- 1.16/net/ipv4/netfilter/ip_queue.c	2004-01-29 00:59:33 +01:00
+++ edited/net/ipv4/netfilter/ip_queue.c	2004-08-17 12:35:05 +02:00
@@ -362,6 +362,8 @@
 		}
 		skb_put(e->skb, diff);
 	}
+	if (!skb_ip_make_writable(&e->skb, v->data_len))
+		return -ENOMEM;
 	memcpy(e->skb->data, v->payload, v->data_len);
 	e->skb->nfcache |= NFC_ALTERED;
 

  parent reply	other threads:[~2004-08-17 10:40 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-08-15 16:42 Re: libipq, kernel panics/oopses, and other undesirable traits Matt Walters
2004-08-16 21:45 ` Matt Walters
2004-08-16 22:38   ` Patrick McHardy
2004-08-17  0:40     ` Matt Walters
2004-08-17  0:44       ` Patrick McHardy
2004-08-17 10:40       ` Patrick McHardy [this message]
2004-08-17 20:40         ` Matt Walters
2004-08-19 10:55           ` Harald Welte
2004-08-19 14:13             ` Patrick McHardy
2004-08-23 19:07           ` Patrick McHardy
2004-08-23 19:16             ` Matt Walters
2004-08-17  0:53   ` Patrick McHardy
2004-08-17  1:34     ` Matt Walters
  -- strict thread matches above, loose matches on Subject: below --
2004-08-14  0:04 Matt Walters
2004-08-14  7:59 ` Patrick McHardy

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=4121E082.6050602@trash.net \
    --to=kaber@trash.net \
    --cc=mattw@parasun.com \
    --cc=netfilter-devel@lists.netfilter.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.