]> git.baikalelectronics.ru Git - kernel.git/commit
xfrm: Fix local error reporting crash with interfamily tunnels
authorSteffen Klassert <steffen.klassert@secunet.com>
Mon, 12 Jan 2015 12:38:49 +0000 (13:38 +0100)
committerSteffen Klassert <steffen.klassert@secunet.com>
Mon, 9 Feb 2015 10:14:17 +0000 (11:14 +0100)
commite67ca7d08b106360019443b498425f0fc4277ab9
treedede82b9efbd76456e5cc88723763330f29539a5
parentc7f852391de8171ac6fde6697a586690d47f1ff1
xfrm: Fix local error reporting crash with interfamily tunnels

We set the outer mode protocol too early. As a result, the
local error handler might dispatch to the wrong address family
and report the error to a wrong socket type. We fix this by
setting the outer protocol to the skb after we accessed the
inner mode for the last time, right before we do the atcual
encapsulation where we switch finally to the outer mode.

Reported-by: Chris Ruehl <chris.ruehl@gtsys.com.hk>
Tested-by: Chris Ruehl <chris.ruehl@gtsys.com.hk>
Signed-off-by: Steffen Klassert <steffen.klassert@secunet.com>
net/ipv4/xfrm4_output.c
net/ipv6/xfrm6_output.c