aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2014-10-18 12:31:37 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2014-10-18 12:31:37 -0400
commit2e923b0251932ad4a82cc87ec1443a1f1d17073e (patch)
treed12032bc9bcfbb8a57659275d1b9b582f23f2ecc /include/linux
parentffd8221bc348f8c282d1271883dbe629ea8ae289 (diff)
parentf2d9da1a8375cbe53df5b415d059429013a3a79f (diff)
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
Pull networking fixes from David Miller: 1) Include fixes for netrom and dsa (Fabian Frederick and Florian Fainelli) 2) Fix FIXED_PHY support in stmmac, from Giuseppe CAVALLARO. 3) Several SKB use after free fixes (vxlan, openvswitch, vxlan, ip_tunnel, fou), from Li ROngQing. 4) fec driver PTP support fixes from Luwei Zhou and Nimrod Andy. 5) Use after free in virtio_net, from Michael S Tsirkin. 6) Fix flow mask handling for megaflows in openvswitch, from Pravin B Shelar. 7) ISDN gigaset and capi bug fixes from Tilman Schmidt. 8) Fix route leak in ip_send_unicast_reply(), from Vasily Averin. 9) Fix two eBPF JIT bugs on x86, from Alexei Starovoitov. 10) TCP_SKB_CB() reorganization caused a few regressions, fixed by Cong Wang and Eric Dumazet. 11) Don't overwrite end of SKB when parsing malformed sctp ASCONF chunks, from Daniel Borkmann. 12) Don't call sock_kfree_s() with NULL pointers, this function also has the side effect of adjusting the socket memory usage. From Cong Wang. * git://git.kernel.org/pub/scm/linux/kernel/git/davem/net: (90 commits) bna: fix skb->truesize underestimation net: dsa: add includes for ethtool and phy_fixed definitions openvswitch: Set flow-key members. netrom: use linux/uaccess.h dsa: Fix conversion from host device to mii bus tipc: fix bug in bundled buffer reception ipv6: introduce tcp_v6_iif() sfc: add support for skb->xmit_more r8152: return -EBUSY for runtime suspend ipv4: fix a potential use after free in fou.c ipv4: fix a potential use after free in ip_tunnel_core.c hyperv: Add handling of IP header with option field in netvsc_set_hash() openvswitch: Create right mask with disabled megaflows vxlan: fix a free after use openvswitch: fix a use after free ipv4: dst_entry leak in ip_send_unicast_reply() ipv4: clean up cookie_v4_check() ipv4: share tcp_v4_save_options() with cookie_v4_check() ipv4: call __ip_options_echo() in cookie_v4_check() atm: simplify lanai.c by using module_pci_driver ...
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/genl_magic_func.h4
-rw-r--r--include/linux/kernelcapi.h2
-rw-r--r--include/linux/netdevice.h12
-rw-r--r--include/linux/skbuff.h7
4 files changed, 20 insertions, 5 deletions
diff --git a/include/linux/genl_magic_func.h b/include/linux/genl_magic_func.h
index c0894dd8827b..667c31101b8b 100644
--- a/include/linux/genl_magic_func.h
+++ b/include/linux/genl_magic_func.h
@@ -178,12 +178,12 @@ static int s_name ## _from_attrs_for_change(struct s_name *s, \
178#define __assign(attr_nr, attr_flag, name, nla_type, type, assignment...) \ 178#define __assign(attr_nr, attr_flag, name, nla_type, type, assignment...) \
179 nla = ntb[attr_nr]; \ 179 nla = ntb[attr_nr]; \
180 if (nla) { \ 180 if (nla) { \
181 if (exclude_invariants && ((attr_flag) & DRBD_F_INVARIANT)) { \ 181 if (exclude_invariants && !!((attr_flag) & DRBD_F_INVARIANT)) { \
182 pr_info("<< must not change invariant attr: %s\n", #name); \ 182 pr_info("<< must not change invariant attr: %s\n", #name); \
183 return -EEXIST; \ 183 return -EEXIST; \
184 } \ 184 } \
185 assignment; \ 185 assignment; \
186 } else if (exclude_invariants && ((attr_flag) & DRBD_F_INVARIANT)) { \ 186 } else if (exclude_invariants && !!((attr_flag) & DRBD_F_INVARIANT)) { \
187 /* attribute missing from payload, */ \ 187 /* attribute missing from payload, */ \
188 /* which was expected */ \ 188 /* which was expected */ \
189 } else if ((attr_flag) & DRBD_F_REQUIRED) { \ 189 } else if ((attr_flag) & DRBD_F_REQUIRED) { \
diff --git a/include/linux/kernelcapi.h b/include/linux/kernelcapi.h
index 9be37da93680..e985ba679c4a 100644
--- a/include/linux/kernelcapi.h
+++ b/include/linux/kernelcapi.h
@@ -41,7 +41,7 @@ u16 capi20_get_manufacturer(u32 contr, u8 buf[CAPI_MANUFACTURER_LEN]);
41u16 capi20_get_version(u32 contr, struct capi_version *verp); 41u16 capi20_get_version(u32 contr, struct capi_version *verp);
42u16 capi20_get_serial(u32 contr, u8 serial[CAPI_SERIAL_LEN]); 42u16 capi20_get_serial(u32 contr, u8 serial[CAPI_SERIAL_LEN]);
43u16 capi20_get_profile(u32 contr, struct capi_profile *profp); 43u16 capi20_get_profile(u32 contr, struct capi_profile *profp);
44int capi20_manufacturer(unsigned int cmd, void __user *data); 44int capi20_manufacturer(unsigned long cmd, void __user *data);
45 45
46#define CAPICTR_UP 0 46#define CAPICTR_UP 0
47#define CAPICTR_DOWN 1 47#define CAPICTR_DOWN 1
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h
index 838407aea705..74fd5d37f15a 100644
--- a/include/linux/netdevice.h
+++ b/include/linux/netdevice.h
@@ -998,6 +998,12 @@ typedef u16 (*select_queue_fallback_t)(struct net_device *dev,
998 * Callback to use for xmit over the accelerated station. This 998 * Callback to use for xmit over the accelerated station. This
999 * is used in place of ndo_start_xmit on accelerated net 999 * is used in place of ndo_start_xmit on accelerated net
1000 * devices. 1000 * devices.
1001 * bool (*ndo_gso_check) (struct sk_buff *skb,
1002 * struct net_device *dev);
1003 * Called by core transmit path to determine if device is capable of
1004 * performing GSO on a packet. The device returns true if it is
1005 * able to GSO the packet, false otherwise. If the return value is
1006 * false the stack will do software GSO.
1001 */ 1007 */
1002struct net_device_ops { 1008struct net_device_ops {
1003 int (*ndo_init)(struct net_device *dev); 1009 int (*ndo_init)(struct net_device *dev);
@@ -1147,6 +1153,8 @@ struct net_device_ops {
1147 struct net_device *dev, 1153 struct net_device *dev,
1148 void *priv); 1154 void *priv);
1149 int (*ndo_get_lock_subclass)(struct net_device *dev); 1155 int (*ndo_get_lock_subclass)(struct net_device *dev);
1156 bool (*ndo_gso_check) (struct sk_buff *skb,
1157 struct net_device *dev);
1150}; 1158};
1151 1159
1152/** 1160/**
@@ -3572,10 +3580,12 @@ static inline bool skb_gso_ok(struct sk_buff *skb, netdev_features_t features)
3572 (!skb_has_frag_list(skb) || (features & NETIF_F_FRAGLIST)); 3580 (!skb_has_frag_list(skb) || (features & NETIF_F_FRAGLIST));
3573} 3581}
3574 3582
3575static inline bool netif_needs_gso(struct sk_buff *skb, 3583static inline bool netif_needs_gso(struct net_device *dev, struct sk_buff *skb,
3576 netdev_features_t features) 3584 netdev_features_t features)
3577{ 3585{
3578 return skb_is_gso(skb) && (!skb_gso_ok(skb, features) || 3586 return skb_is_gso(skb) && (!skb_gso_ok(skb, features) ||
3587 (dev->netdev_ops->ndo_gso_check &&
3588 !dev->netdev_ops->ndo_gso_check(skb, dev)) ||
3579 unlikely((skb->ip_summed != CHECKSUM_PARTIAL) && 3589 unlikely((skb->ip_summed != CHECKSUM_PARTIAL) &&
3580 (skb->ip_summed != CHECKSUM_UNNECESSARY))); 3590 (skb->ip_summed != CHECKSUM_UNNECESSARY)));
3581} 3591}
diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h
index 3ab0749d6875..a59d9343c25b 100644
--- a/include/linux/skbuff.h
+++ b/include/linux/skbuff.h
@@ -1203,7 +1203,12 @@ static inline struct sk_buff *skb_unshare(struct sk_buff *skb,
1203 might_sleep_if(pri & __GFP_WAIT); 1203 might_sleep_if(pri & __GFP_WAIT);
1204 if (skb_cloned(skb)) { 1204 if (skb_cloned(skb)) {
1205 struct sk_buff *nskb = skb_copy(skb, pri); 1205 struct sk_buff *nskb = skb_copy(skb, pri);
1206 kfree_skb(skb); /* Free our shared copy */ 1206
1207 /* Free our shared copy */
1208 if (likely(nskb))
1209 consume_skb(skb);
1210 else
1211 kfree_skb(skb);
1207 skb = nskb; 1212 skb = nskb;
1208 } 1213 }
1209 return skb; 1214 return skb;