[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20150401.144036.1354401396349418295.davem@davemloft.net>
Date: Wed, 01 Apr 2015 14:40:36 -0400 (EDT)
From: David Miller <davem@...emloft.net>
To: hannes@...essinduktion.org
Cc: netdev@...r.kernel.org, jiri@...nulli.us
Subject: Re: [PATCH net-next] ipv6: protect skb->sk accesses from recursive
dereference inside the stack
From: Hannes Frederic Sowa <hannes@...essinduktion.org>
Date: Wed, 1 Apr 2015 17:07:44 +0200
> From: "hannes@...essinduktion.org" <hannes@...essinduktion.org>
>
> We should not consult skb->sk for output decisions in xmit recursion
> levels > 0 in the stack. Otherwise local socket settings could influence
> the result of e.g. tunnel encapsulation process.
>
> ipv6 does not conform with this in three places:
>
> 1) ip6_fragment: we do consult ipv6_npinfo for frag_size
>
> 2) sk_mc_loop in ipv6 uses skb->sk and checks if we should
> loop the packet back to the local socket
>
> 3) ip6_skb_dst_mtu could query the settings from the user socket and
> force a wrong MTU
>
> Furthermore:
> In sk_mc_loop we could potentially land in WARN_ON(1) if we use a
> PF_PACKET socket ontop of an IPv6-backed vxlan device.
>
> Reuse xmit_recursion as we are currently only interested in protecting
> tunnel devices.
>
> Cc: Jiri Pirko <jiri@...nulli.us>
> Signed-off-by: Hannes Frederic Sowa <hannes@...essinduktion.org>
> ---
>
> Jiri tried to fix this bug by passing down the tunnel sock pointer.
> Currently there should be no difference in behaviour with this patch.
>
> http://patchwork.ozlabs.org/patch/380404/
> http://patchwork.ozlabs.org/patch/380406/
> http://patchwork.ozlabs.org/patch/380405/
>
> In case we do need more specific fragmentation setup semantics we would
> need to go with Jiri's approach. Currently we don't care about sk_mc_loop
> for kernel sockets, so it is easy to just shut them up. Other options
> are safe as well.
>
> Please review carefully!
As a short term solution I guess this is fine.
I'll let this sit for a day or two so others can review the change.
--
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