summaryrefslogtreecommitdiffstats
path: root/net/key
diff options
context:
space:
mode:
authorSabrina Dubroca2017-05-03 16:43:19 +0200
committerSteffen Klassert2017-05-04 07:30:59 +0200
commit9b3eb54106cf6acd03f07cf0ab01c13676a226c2 (patch)
treed141faeb13e5f9d8c44a08157e4a7f59c24ee9dd /net/key
parentesp4: Fix udpencap for local TCP packets. (diff)
downloadkernel-qcow2-linux-9b3eb54106cf6acd03f07cf0ab01c13676a226c2.tar.gz
kernel-qcow2-linux-9b3eb54106cf6acd03f07cf0ab01c13676a226c2.tar.xz
kernel-qcow2-linux-9b3eb54106cf6acd03f07cf0ab01c13676a226c2.zip
xfrm: fix stack access out of bounds with CONFIG_XFRM_SUB_POLICY
When CONFIG_XFRM_SUB_POLICY=y, xfrm_dst stores a copy of the flowi for that dst. Unfortunately, the code that allocates and fills this copy doesn't care about what type of flowi (flowi, flowi4, flowi6) gets passed. In multiple code paths (from raw_sendmsg, from TCP when replying to a FIN, in vxlan, geneve, and gre), the flowi that gets passed to xfrm is actually an on-stack flowi4, so we end up reading stuff from the stack past the end of the flowi4 struct. Since xfrm_dst->origin isn't used anywhere following commit ca116922afa8 ("xfrm: Eliminate "fl" and "pol" args to xfrm_bundle_ok()."), just get rid of it. xfrm_dst->partner isn't used either, so get rid of that too. Fixes: 9d6ec938019c ("ipv4: Use flowi4 in public route lookup interfaces.") Signed-off-by: Sabrina Dubroca <sd@queasysnail.net> Signed-off-by: Steffen Klassert <steffen.klassert@secunet.com>
Diffstat (limited to 'net/key')
0 files changed, 0 insertions, 0 deletions