netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Patrick McHardy <kaber@trash.net>
To: "David S. Miller" <davem@redhat.com>
Cc: laforge@netfilter.org, okir@suse.de, netdev@oss.sgi.com,
	netfilter-devel@lists.netfilter.org
Subject: Re: [PATCH] Prevent crash on ip_conntrack removal
Date: Sun, 22 Aug 2004 14:58:01 +0200	[thread overview]
Message-ID: <41289859.2040803@trash.net> (raw)
In-Reply-To: <20040821221344.6dbc98ed.davem@redhat.com>

David S. Miller wrote:

>On Sat, 21 Aug 2004 17:10:20 +0200
>Patrick McHardy <kaber@trash.net> wrote:
>
>>The problem is that conntrack unload can cause packets without a
>>dst_entry to appear in ip_local_deliver, which is already after
>>the call to dst_input.
>>    
>>
>
>How can it call ip_local_deliver() without a valid skb->dst?
>That function is only invoked via skb->dst->input(skb) which
>by implication means that skb->dst is non-NULL.
>
>Actually there is a call via ip_mr_input() but that code also
>has a precondition that skb->dst is non-NULL too.  I say this
>due to the unchecked skb->dst accesses it makes early on.
>
>Please explain.  I don't question that it happens, just show
>me how :-)
>  
>

The first fragment (offset=0) is given to ip_defrag by conntrack
at PRE_ROUTING, without a dst_entry. Then conntrack is unloaded.
Further fragments are now queued in ip_local_deliver. When the
packet is reassembled and "continues" its way from
ip_local_deliver, it doesn't have a dst_entry.

The opposite way is of course also possible, packets queued in
ip_local_deliver can jump and appear in the PRE_ROUTING hook
when conntrack is loaded, but that way doesn't seem to cause
problems.

Regards
Patrick

  reply	other threads:[~2004-08-22 12:58 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-08-18  9:13 [PATCH] Prevent crash on ip_conntrack removal Olaf Kirch
2004-08-19 10:11 ` Harald Welte
2004-08-19 14:18   ` David S. Miller
2004-08-19 14:55     ` Patrick McHardy
2004-08-19 15:14       ` David S. Miller
2004-08-21 15:10         ` Patrick McHardy
2004-08-22  5:13           ` David S. Miller
2004-08-22 12:58             ` Patrick McHardy [this message]
2004-08-23  5:03               ` David S. Miller
2004-08-23 21:18               ` David Stevens
2004-08-24  0:45                 ` Nivedita Singhvi
2004-08-24  0:45                 ` Patrick McHardy
2004-08-24 21:28                   ` David Stevens
2004-08-29  6:15                     ` David S. Miller
2004-08-29 19:36                       ` Patrick McHardy
2004-08-29 19:57                         ` David S. Miller
2004-08-29 20:06                           ` Patrick McHardy
2004-08-29 21:58                           ` Patrick McHardy
2004-08-29 23:38                             ` David S. Miller
2004-08-30  0:50                               ` Patrick McHardy
2004-08-30  4:28                                 ` David S. Miller
2004-08-29 21:48                         ` Patrick McHardy
2004-08-30  7:57                         ` Olaf Kirch

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=41289859.2040803@trash.net \
    --to=kaber@trash.net \
    --cc=davem@redhat.com \
    --cc=laforge@netfilter.org \
    --cc=netdev@oss.sgi.com \
    --cc=netfilter-devel@lists.netfilter.org \
    --cc=okir@suse.de \
    /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;
as well as URLs for NNTP newsgroup(s).