netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Florian Westphal <fw@strlen.de>
To: "Maciej Żenczykowski" <zenczykowski@gmail.com>
Cc: Lorenzo Colitti <lorenzo@google.com>,
	Eric Dumazet <edumazet@google.com>,
	Florian Westphal <fw@strlen.de>,
	Linux NetDev <netdev@vger.kernel.org>,
	Maciej Zenczykowski <maze@google.com>
Subject: Re: crash in xt_policy due to skb_dst_drop() in nf_ct_frag6_gather()
Date: Tue, 16 Oct 2018 10:11:20 +0200	[thread overview]
Message-ID: <20181016081120.umbe3kz2vi4jfgks@breakpoint.cc> (raw)
In-Reply-To: <CANP3RGeX5=c=Lb+Pkg89zD7zQ_Z1T8oPJRCkorNCdghmofYXxg@mail.gmail.com>

Maciej Żenczykowski <zenczykowski@gmail.com> wrote:

I am currently travelling and not able to investigate
until next week.

> commit ad8b1ffc3efae2f65080bdb11145c87d299b8f9a
> Author: Florian Westphal <fw@strlen.de>
>     netfilter: ipv6: nf_defrag: drop skb dst before queueing
> 
> +++ b/net/ipv6/netfilter/nf_conntrack_reasm.c
> @@ -618,6 +618,8 @@ int nf_ct_frag6_gather(struct net *net, struct
> sk_buff *skb, u32 user)
>             fq->q.meat == fq->q.len &&
>             nf_ct_frag6_reasm(fq, skb, dev))
>                 ret = 0;
> +       else
> +               skb_dst_drop(skb);

This is only supposed to drop dst of skbs that are enqueued,
i.e. frag6_gather returns NF_STOLEN.

In case skb completes the queue, then that skbs dst_entry
is supposed to be kept, so skb_dst() does NOT return NULL.

Its not supposed to be any different than ipv4 defrag.

> const struct dst_entry *dst = skb_dst(skb); // returns NULL

That is not supposed to happen.

  reply	other threads:[~2018-10-16 16:00 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-10-16  4:13 crash in xt_policy due to skb_dst_drop() in nf_ct_frag6_gather() Maciej Żenczykowski
2018-10-16  8:11 ` Florian Westphal [this message]
2018-10-16  9:40   ` Maciej Żenczykowski
2018-10-16  9:41     ` Maciej Żenczykowski
2018-10-16  9:49       ` Maciej Żenczykowski
2018-10-23 14:47 ` [PATCH nf] netfilter: ipv6: fix oops when defragmenting locally generated fragments Florian Westphal
2018-10-23 14:54   ` Eric Dumazet
2018-10-23 21:04   ` Maciej Żenczykowski
2018-10-23 22:04     ` Florian Westphal
2018-10-25  8:18   ` Pablo Neira Ayuso

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=20181016081120.umbe3kz2vi4jfgks@breakpoint.cc \
    --to=fw@strlen.de \
    --cc=edumazet@google.com \
    --cc=lorenzo@google.com \
    --cc=maze@google.com \
    --cc=netdev@vger.kernel.org \
    --cc=zenczykowski@gmail.com \
    /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).