From: Daniel Borkmann <daniel@iogearbox.net>
To: Cong Wang <xiyou.wangcong@gmail.com>
Cc: David Miller <davem@davemloft.net>, Thomas Graf <tgraf@suug.ch>,
Pravin B Shelar <pshelar@nicira.com>,
jesse@kernel.org,
Linux Kernel Network Developers <netdev@vger.kernel.org>
Subject: Re: [PATCH net] vxlan: fix missing options_len update on RX with collect metadata
Date: Fri, 04 Mar 2016 03:22:54 +0100 [thread overview]
Message-ID: <56D8F17E.1020607@iogearbox.net> (raw)
In-Reply-To: <CAM_iQpWOUw6im=1HAemYYahY_Q3W6kW42pYQEHWRxmha1GHyHg@mail.gmail.com>
On 03/04/2016 01:16 AM, Cong Wang wrote:
> On Thu, Mar 3, 2016 at 12:58 AM, Daniel Borkmann <daniel@iogearbox.net> wrote:
>> On 03/03/2016 02:21 AM, Cong Wang wrote:
>>>
>>> Why not set it in tun_rx_dst() where it is allocated?
>>
>> Nope, current convention is to only fill options_len when an actual
>> option was detected on RX, f.e. see ip_tunnel_info_opts_set() in
>> geneve. Consumers like ovs_flow_key_extract() check for options_len
>> and not TUNNEL_OPTIONS_PRESENT to copy it via ip_tunnel_info_opts_get()
>> from there.
>
> But the APIs suck...
>
> You expect to use ip_tunnel_info_opts_{get,set}() to read or write
> the tun_info, but actually this is not the case here for vxlan.
Yep, since depending on the working mode either skb->mark is populated
or the tunnel opts buffer.
> Also, ip_tunnel_info_opts_set() could write out of range if the len is
> bigger than the allocated length. I know existing callers are fine, but this API
> is problematic.
Current call sites are good agree, API could probably be better, yeah.
> I think this is why we had this bug.
next prev parent reply other threads:[~2016-03-04 2:23 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-03-02 1:32 [PATCH net] vxlan: fix missing options_len update on RX with collect metadata Daniel Borkmann
2016-03-03 1:21 ` Cong Wang
2016-03-03 8:58 ` Daniel Borkmann
2016-03-04 0:16 ` Cong Wang
2016-03-04 2:22 ` Daniel Borkmann [this message]
2016-03-03 10:33 ` Thomas Graf
2016-03-03 22:11 ` David Miller
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=56D8F17E.1020607@iogearbox.net \
--to=daniel@iogearbox.net \
--cc=davem@davemloft.net \
--cc=jesse@kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pshelar@nicira.com \
--cc=tgraf@suug.ch \
--cc=xiyou.wangcong@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 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.