[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Thu, 08 Aug 2013 09:00:58 -0700
From: Eric Dumazet <eric.dumazet@...il.com>
To: Kristian Evensen <kristian.evensen@...il.com>
Cc: netdev@...r.kernel.org
Subject: Re: [RFC net-next] ipip: Add room for custom tunnel header
On Thu, 2013-08-08 at 15:52 +0200, Kristian Evensen wrote:
> Hello,
...
> Signed-off-by: Kristian Evensen <kristian.evensen@...il.com>
> ---
> include/uapi/linux/if_tunnel.h | 1 +
> net/ipv4/ipip.c | 5 ++++-
> 2 files changed, 5 insertions(+), 1 deletion(-)
>
> diff --git a/include/uapi/linux/if_tunnel.h b/include/uapi/linux/if_tunnel.h
> index aee73d0..039bbc3 100644
> --- a/include/uapi/linux/if_tunnel.h
> +++ b/include/uapi/linux/if_tunnel.h
> @@ -35,6 +35,7 @@ struct ip_tunnel_parm {
> __be32 i_key;
> __be32 o_key;
> struct iphdr iph;
> + int hlen;
> };
>
> enum {
> diff --git a/net/ipv4/ipip.c b/net/ipv4/ipip.c
> index 51fc2a1..9705aa1 100644
> --- a/net/ipv4/ipip.c
> +++ b/net/ipv4/ipip.c
> @@ -226,6 +226,9 @@ static netdev_tx_t ipip_tunnel_xmit(struct sk_buff *skb, struct net_device *dev)
> skb->encapsulation = 1;
> }
>
> + if (tunnel->hlen > 0)
> + skb_push(skb, tunnel->hlen);
What happens if hlen is bigger than available headroom ?
hlen comes from userspace and there is no safety check, right ?
What guarantee do we have _something_ will fill the bytes ?
(We do not want to leak prior content of those bytes to the wire)
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists