aboutsummaryrefslogtreecommitdiffstats
path: root/include/net/gue.h
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2017-12-15 16:08:37 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2017-12-15 16:08:37 -0500
commit7a3c296ae08f9b51e399074d8ef6867d65fbd22b (patch)
treeb8f9eef7b2c5db64f5f977f67edd7cfaaaeb8a89 /include/net/gue.h
parentc36c7a7c4034f2ef35c6aa6821e7c82d9968dba4 (diff)
parent043ee1debd0b29c16c4c4b11a348ca667bfe9144 (diff)
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
Pull networking fixes from David Miller: 1) Clamp timeouts to INT_MAX in conntrack, from Jay Elliot. 2) Fix broken UAPI for BPF_PROG_TYPE_PERF_EVENT, from Hendrik Brueckner. 3) Fix locking in ieee80211_sta_tear_down_BA_sessions, from Johannes Berg. 4) Add missing barriers to ptr_ring, from Michael S. Tsirkin. 5) Don't advertise gigabit in sh_eth when not available, from Thomas Petazzoni. 6) Check network namespace when delivering to netlink taps, from Kevin Cernekee. 7) Kill a race in raw_sendmsg(), from Mohamed Ghannam. 8) Use correct address in TCP md5 lookups when replying to an incoming segment, from Christoph Paasch. 9) Add schedule points to BPF map alloc/free, from Eric Dumazet. 10) Don't allow silly mtu values to be used in ipv4/ipv6 multicast, also from Eric Dumazet. 11) Fix SKB leak in tipc, from Jon Maloy. 12) Disable MAC learning on OVS ports of mlxsw, from Yuval Mintz. 13) SKB leak fix in skB_complete_tx_timestamp(), from Willem de Bruijn. 14) Add some new qmi_wwan device IDs, from Daniele Palmas. 15) Fix static key imbalance in ingress qdisc, from Jiri Pirko. * git://git.kernel.org/pub/scm/linux/kernel/git/davem/net: (76 commits) net: qcom/emac: Reduce timeout for mdio read/write net: sched: fix static key imbalance in case of ingress/clsact_init error net: sched: fix clsact init error path ip_gre: fix wrong return value of erspan_rcv net: usb: qmi_wwan: add Telit ME910 PID 0x1101 support pkt_sched: Remove TC_RED_OFFLOADED from uapi net: sched: Move to new offload indication in RED net: sched: Add TCA_HW_OFFLOAD net: aquantia: Increment driver version net: aquantia: Fix typo in ethtool statistics names net: aquantia: Update hw counters on hw init net: aquantia: Improve link state and statistics check interval callback net: aquantia: Fill in multicast counter in ndev stats from hardware net: aquantia: Fill ndev stat couters from hardware net: aquantia: Extend stat counters to 64bit values net: aquantia: Fix hardware DMA stream overload on large MRRS net: aquantia: Fix actual speed capabilities reporting sock: free skb in skb_complete_tx_timestamp on error s390/qeth: update takeover IPs after configuration change s390/qeth: lock IP table while applying takeover changes ...
Diffstat (limited to 'include/net/gue.h')
-rw-r--r--include/net/gue.h18
1 files changed, 9 insertions, 9 deletions
diff --git a/include/net/gue.h b/include/net/gue.h
index 2fdb29ca74c2..fdad41469b65 100644
--- a/include/net/gue.h
+++ b/include/net/gue.h
@@ -44,10 +44,10 @@ struct guehdr {
44#else 44#else
45#error "Please fix <asm/byteorder.h>" 45#error "Please fix <asm/byteorder.h>"
46#endif 46#endif
47 __u8 proto_ctype; 47 __u8 proto_ctype;
48 __u16 flags; 48 __be16 flags;
49 }; 49 };
50 __u32 word; 50 __be32 word;
51 }; 51 };
52}; 52};
53 53
@@ -84,11 +84,10 @@ static inline size_t guehdr_priv_flags_len(__be32 flags)
84 * if there is an unknown standard or private flags, or the options length for 84 * if there is an unknown standard or private flags, or the options length for
85 * the flags exceeds the options length specific in hlen of the GUE header. 85 * the flags exceeds the options length specific in hlen of the GUE header.
86 */ 86 */
87static inline int validate_gue_flags(struct guehdr *guehdr, 87static inline int validate_gue_flags(struct guehdr *guehdr, size_t optlen)
88 size_t optlen)
89{ 88{
89 __be16 flags = guehdr->flags;
90 size_t len; 90 size_t len;
91 __be32 flags = guehdr->flags;
92 91
93 if (flags & ~GUE_FLAGS_ALL) 92 if (flags & ~GUE_FLAGS_ALL)
94 return 1; 93 return 1;
@@ -101,12 +100,13 @@ static inline int validate_gue_flags(struct guehdr *guehdr,
101 /* Private flags are last four bytes accounted in 100 /* Private flags are last four bytes accounted in
102 * guehdr_flags_len 101 * guehdr_flags_len
103 */ 102 */
104 flags = *(__be32 *)((void *)&guehdr[1] + len - GUE_LEN_PRIV); 103 __be32 pflags = *(__be32 *)((void *)&guehdr[1] +
104 len - GUE_LEN_PRIV);
105 105
106 if (flags & ~GUE_PFLAGS_ALL) 106 if (pflags & ~GUE_PFLAGS_ALL)
107 return 1; 107 return 1;
108 108
109 len += guehdr_priv_flags_len(flags); 109 len += guehdr_priv_flags_len(pflags);
110 if (len > optlen) 110 if (len > optlen)
111 return 1; 111 return 1;
112 } 112 }