lkml.org 
[lkml]   [2015]   [Dec]   [2]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH 3.13.y-ckt 78/86] ipv6: fix tunnel error handling
    Date
    3.13.11-ckt31 -stable review patch.  If anyone has any objections, please let me know.

    ------------------

    From: =?UTF-8?q?Michal=20Kube=C4=8Dek?= <mkubecek@suse.cz>

    commit ebac62fe3d24c0ce22dd83afa7b07d1a2aaef44d upstream.

    Both tunnel6_protocol and tunnel46_protocol share the same error
    handler, tunnel6_err(), which traverses through tunnel6_handlers list.
    For ipip6 tunnels, we need to traverse tunnel46_handlers as we do e.g.
    in tunnel46_rcv(). Current code can generate an ICMPv6 error message
    with an IPv4 packet embedded in it.

    Fixes: 73d605d1abbd ("[IPSEC]: changing API of xfrm6_tunnel_register")
    Signed-off-by: Michal Kubecek <mkubecek@suse.cz>
    Signed-off-by: David S. Miller <davem@davemloft.net>
    Signed-off-by: Kamal Mostafa <kamal@canonical.com>
    ---
    net/ipv6/tunnel6.c | 12 +++++++++++-
    1 file changed, 11 insertions(+), 1 deletion(-)

    diff --git a/net/ipv6/tunnel6.c b/net/ipv6/tunnel6.c
    index 4b0f50d..ebcbb3c 100644
    --- a/net/ipv6/tunnel6.c
    +++ b/net/ipv6/tunnel6.c
    @@ -147,6 +147,16 @@ static void tunnel6_err(struct sk_buff *skb, struct inet6_skb_parm *opt,
    break;
    }

    +static void tunnel46_err(struct sk_buff *skb, struct inet6_skb_parm *opt,
    + u8 type, u8 code, int offset, __be32 info)
    +{
    + struct xfrm6_tunnel *handler;
    +
    + for_each_tunnel_rcu(tunnel46_handlers, handler)
    + if (!handler->err_handler(skb, opt, type, code, offset, info))
    + break;
    +}
    +
    static const struct inet6_protocol tunnel6_protocol = {
    .handler = tunnel6_rcv,
    .err_handler = tunnel6_err,
    @@ -155,7 +165,7 @@ static const struct inet6_protocol tunnel6_protocol = {

    static const struct inet6_protocol tunnel46_protocol = {
    .handler = tunnel46_rcv,
    - .err_handler = tunnel6_err,
    + .err_handler = tunnel46_err,
    .flags = INET6_PROTO_NOPOLICY|INET6_PROTO_FINAL,
    };

    --
    1.9.1


    \
     
     \ /
      Last update: 2015-12-03 00:41    [W:4.151 / U:0.460 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site