From: yzhu1 <Yanjun.Zhu@windriver.com>
To: Sebastian Poehn <sebastian.poehn@gmail.com>,
David Miller <davem@davemloft.net>
Cc: <netdev@vger.kernel.org>, <fw@strlen.de>, <eric.dumazet@gmail.com>
Subject: Re: [PATCH] ip_forward: Drop frames with attached skb->sk
Date: Tue, 14 Apr 2015 14:33:32 +0800 [thread overview]
Message-ID: <552CB4BC.9000207@windriver.com> (raw)
In-Reply-To: <1428990724.6812.8.camel@googlemail.com>
On 04/14/2015 01:52 PM, Sebastian Poehn wrote:
> Initial discussion was:
> [FYI] xfrm: Don't lookup sk_policy for timewait sockets
>
> Forwarded frames should not have a socket attached. Especially
> tw sockets will lead to panics later-on in the stack.
>
> This was observed with TPROXY assigning a tw socket and broken
> policy routing (misconfigured). As a result frame enters
> forwarding path instead of input. We cannot solve this in
> TPROXY as it cannot know that policy routing is broken.
>
> Signed-off-by: Sebastian Poehn <sebastian.poehn@gmail.com>
> ---
> diff --git a/net/ipv4/ip_forward.c b/net/ipv4/ip_forward.c
> index 939992c..2fc3b3e 100644
> --- a/net/ipv4/ip_forward.c
> +++ b/net/ipv4/ip_forward.c
> @@ -82,6 +82,10 @@ int ip_forward(struct sk_buff *skb)
> if (skb->pkt_type != PACKET_HOST)
> goto drop;
>
> + /* this should happen neither */
Sorry. "neither" should be "either"?
Zhu Yanjun
> + if (unlikely(skb->sk))
> + goto drop;
> +
> if (skb_warn_if_lro(skb))
> goto drop;
> --
>
>
> --
> To unsubscribe from this list: send the line "unsubscribe netdev" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
>
next prev parent reply other threads:[~2015-04-14 6:33 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-04-14 5:52 [PATCH] ip_forward: Drop frames with attached skb->sk Sebastian Poehn
2015-04-14 6:07 ` Stephen Hemminger
2015-04-14 6:18 ` Sebastian Poehn
2015-04-14 16:50 ` David Miller
2015-04-14 6:33 ` yzhu1 [this message]
2015-04-14 6:40 ` Sebastian Poehn
2015-04-14 11:54 ` Eric Dumazet
2015-04-14 18:23 ` David Miller
2015-04-15 7:32 ` Sebastian Poehn
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=552CB4BC.9000207@windriver.com \
--to=yanjun.zhu@windriver.com \
--cc=davem@davemloft.net \
--cc=eric.dumazet@gmail.com \
--cc=fw@strlen.de \
--cc=netdev@vger.kernel.org \
--cc=sebastian.poehn@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).