[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAM_iQpWOUw6im=1HAemYYahY_Q3W6kW42pYQEHWRxmha1GHyHg@mail.gmail.com>
Date: Thu, 3 Mar 2016 16:16:16 -0800
From: Cong Wang <xiyou.wangcong@...il.com>
To: Daniel Borkmann <daniel@...earbox.net>
Cc: David Miller <davem@...emloft.net>, Thomas Graf <tgraf@...g.ch>,
Pravin B Shelar <pshelar@...ira.com>, jesse@...nel.org,
Linux Kernel Network Developers <netdev@...r.kernel.org>
Subject: Re: [PATCH net] vxlan: fix missing options_len update on RX with
collect metadata
On Thu, Mar 3, 2016 at 12:58 AM, Daniel Borkmann <daniel@...earbox.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.
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.
I think this is why we had this bug.
Powered by blists - more mailing lists