All of lore.kernel.org
 help / color / mirror / Atom feed
From: David Miller <davem@redhat.com>
To: herbert@gondor.apana.org.au
Cc: alexander.duyck@gmail.com, alexander.h.duyck@redhat.com,
	netdev@vger.kernel.org, steffen.klassert@secunet.com,
	tgraf@suug.ch
Subject: Re: [net PATCH] ip_vti/ip6_vti: Clear skb->mark when resetting skb->dev in receive path
Date: Fri, 15 May 2015 12:37:26 -0400 (EDT)	[thread overview]
Message-ID: <20150515.123726.1298734930500737780.davem@redhat.com> (raw)
In-Reply-To: <20150514062614.GA6320@gondor.apana.org.au>

From: Herbert Xu <herbert@gondor.apana.org.au>
Date: Thu, 14 May 2015 14:26:14 +0800

> On Wed, May 13, 2015 at 11:14:39PM -0700, Alexander Duyck wrote:
>> 
>> The fact is I am not all that familiar with the vti code and just
>> started crawling through it a few days ago, but it seems like it is
>> overwriting the skb->mark value with the i_key to determine which
>> policy to use.  The code prior to commit df3893c176e9 ("vti: Update
>> the ipv4 side to use it's own receive hook.") was saving the old
>> skb->mark, overwriting it, and then restoring it after a call to
>> xfrm4_policy_check.  After that commit it was letting
>> skb_scrub_packet in vti_rcv_cb clear the mark and it was just
>> dropped.
> 
> Steffen, why is vti touching skb->mark at all? This is supposed
> to be a field used by user-space to control a packet as it moves
> inside the kernel.  Seconding it for other purposes looks very
> wrong.

If anything, the skb_scrub_packet() call right above the skb->mark
clears should be taking care of this.

The only case where mark should be cleared is if we are changing
namespaces, and that's exactly the policy implemented by
skb_scrub_packet() currently.

Yeah, this mark handling via tunnel->parms.o_key looks not so good.

  reply	other threads:[~2015-05-15 16:37 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-05-14  2:04 [net PATCH] ip_vti/ip6_vti: Clear skb->mark when resetting skb->dev in receive path Alexander Duyck
2015-05-14  3:28 ` Herbert Xu
2015-05-14  6:14   ` Alexander Duyck
2015-05-14  6:26     ` Herbert Xu
2015-05-15 16:37       ` David Miller [this message]
2015-05-15 19:14         ` Alexander Duyck
2015-05-16 12:34           ` Herbert Xu
2015-05-16 21:13             ` David Miller
2015-05-18  7:04               ` Steffen Klassert
2015-05-18  8:31                 ` Herbert Xu
2015-05-18  8:38                   ` Steffen Klassert
2015-05-18  8:59                     ` Herbert Xu
2015-05-18 10:30                       ` Steffen Klassert
2015-05-18 10:33                         ` Herbert Xu

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=20150515.123726.1298734930500737780.davem@redhat.com \
    --to=davem@redhat.com \
    --cc=alexander.duyck@gmail.com \
    --cc=alexander.h.duyck@redhat.com \
    --cc=herbert@gondor.apana.org.au \
    --cc=netdev@vger.kernel.org \
    --cc=steffen.klassert@secunet.com \
    --cc=tgraf@suug.ch \
    /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.