summaryrefslogtreecommitdiffstats
path: root/Documentation/core-api
diff options
context:
space:
mode:
authorPrashant Bhole <bhole_prashant_q7@lab.ntt.co.jp>2018-07-13 14:40:50 +0900
committerDavid S. Miller <davem@davemloft.net>2018-07-16 13:39:47 -0700
commitb7ed879425be371905d856410d19e9a42a62bcf3 (patch)
treebfc68d99f78c5897875eced15f2328252a9c23dd /Documentation/core-api
parent6e8cfd6d9d8049e2fd5b2de8a328519dc58ea1e6 (diff)
downloadlinux-b7ed879425be371905d856410d19e9a42a62bcf3.tar.bz2
net: ip6_gre: get ipv6hdr after skb_cow_head()
A KASAN:use-after-free bug was found related to ip6-erspan while running selftests/net/ip6_gre_headroom.sh It happens because of following sequence: - ipv6hdr pointer is obtained from skb - skb_cow_head() is called, skb->head memory is reallocated - old data is accessed using ipv6hdr pointer skb_cow_head() call was added in e41c7c68ea77 ("ip6erspan: make sure enough headroom at xmit."), but looking at the history there was a chance of similar bug because gre_handle_offloads() and pskb_trim() can also reallocate skb->head memory. Fixes tag points to commit which introduced possibility of this bug. This patch moves ipv6hdr pointer assignment after skb_cow_head() call. Fixes: 5a963eb61b7c ("ip6_gre: Add ERSPAN native tunnel support") Signed-off-by: Prashant Bhole <bhole_prashant_q7@lab.ntt.co.jp> Reviewed-by: Greg Rose <gvrose8192@gmail.com> Acked-by: William Tu <u9012063@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'Documentation/core-api')
0 files changed, 0 insertions, 0 deletions