summaryrefslogtreecommitdiff
path: root/datapath
diff options
context:
space:
mode:
authorPravin B Shelar <pshelar@ovn.org>2016-08-02 17:03:41 -0700
committerPravin B Shelar <pshelar@ovn.org>2016-08-03 15:18:58 -0700
commitdfe999407a09cfa7052ab873fdebd4e910ac1312 (patch)
tree177ba5ea80da04b71577588bcd65ab200ff20ab5 /datapath
parent06478ca06a109b87894abfd2ed53c1ba5d7ef0fd (diff)
downloadopenvswitch-dfe999407a09cfa7052ab873fdebd4e910ac1312.tar.gz
datapath: fix size of struct ovs_gso_cb
struct ovs_gso_cb is stored in skb->cd. avoid going beyond size of skb->cb. Signed-off-by: Pravin B Shelar <pshelar@ovn.org> Acked-by: Jesse Gross <jesse@kernel.org>
Diffstat (limited to 'datapath')
-rw-r--r--datapath/linux/compat/gso.c1
-rw-r--r--datapath/linux/compat/gso.h2
2 files changed, 2 insertions, 1 deletions
diff --git a/datapath/linux/compat/gso.c b/datapath/linux/compat/gso.c
index 1f24e74fd..10412c0c9 100644
--- a/datapath/linux/compat/gso.c
+++ b/datapath/linux/compat/gso.c
@@ -171,6 +171,7 @@ static struct sk_buff *tnl_skb_gso_segment(struct sk_buff *skb,
__be16 proto = skb->protocol;
char cb[sizeof(skb->cb)];
+ BUILD_BUG_ON(sizeof(struct ovs_gso_cb) > FIELD_SIZEOF(struct sk_buff, cb));
OVS_GSO_CB(skb)->ipv6 = (sa_family == AF_INET6);
/* setup whole inner packet to get protocol. */
__skb_pull(skb, mac_offset);
diff --git a/datapath/linux/compat/gso.h b/datapath/linux/compat/gso.h
index fa0a7db53..e93998c71 100644
--- a/datapath/linux/compat/gso.h
+++ b/datapath/linux/compat/gso.h
@@ -14,6 +14,7 @@ struct ovs_gso_cb {
#ifndef USE_UPSTREAM_TUNNEL_GSO
gso_fix_segment_t fix_segment;
#endif
+ bool ipv6;
#ifndef HAVE_INNER_PROTOCOL
__be16 inner_protocol;
#endif
@@ -21,7 +22,6 @@ struct ovs_gso_cb {
/* Keep original tunnel info during userspace action execution. */
struct metadata_dst *fill_md_dst;
#endif
- bool ipv6;
};
#define OVS_GSO_CB(skb) ((struct ovs_gso_cb *)(skb)->cb)