]> git.baikalelectronics.ru Git - kernel.git/commit
xfrm: Fix stack-out-of-bounds read in xfrm_state_find.
authorSteffen Klassert <steffen.klassert@secunet.com>
Thu, 2 Nov 2017 07:10:17 +0000 (08:10 +0100)
committerSteffen Klassert <steffen.klassert@secunet.com>
Fri, 3 Nov 2017 12:02:41 +0000 (13:02 +0100)
commit44d2a944543e9dbd1a3bd0460e29cb4db2525204
tree5cf9469a3b411befeb91cfd3f34170b92e2a8356
parentf5dfad14bee665ca74c54f5c2f89a8b7bc04b6a3
xfrm: Fix stack-out-of-bounds read in xfrm_state_find.

When we do tunnel or beet mode, we pass saddr and daddr from the
template to xfrm_state_find(), this is ok. On transport mode,
we pass the addresses from the flowi, assuming that the IP
addresses (and address family) don't change during transformation.
This assumption is wrong in the IPv4 mapped IPv6 case, packet
is IPv4 and template is IPv6. Fix this by using the addresses
from the template unconditionally.

Signed-off-by: Steffen Klassert <steffen.klassert@secunet.com>
net/xfrm/xfrm_policy.c