aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2016-11-14 17:15:53 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2016-11-14 17:15:53 -0500
commite76d21c40bd6c67fd4e2c1540d77e113df962b4d (patch)
tree26412781fb3f51719cb32d7b031660a7139c1a3b /include
parentd4b9532367c77a35849d6cce491a3ca474c519cf (diff)
parentac571de999e14b87890cb960ad6f03fbdde6abc8 (diff)
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
Pull networking fixes from David Miller: 1) Fix off by one wrt. indexing when dumping /proc/net/route entries, from Alexander Duyck. 2) Fix lockdep splats in iwlwifi, from Johannes Berg. 3) Cure panic when inserting certain netfilter rules when NFT_SET_HASH is disabled, from Liping Zhang. 4) Memory leak when nft_expr_clone() fails, also from Liping Zhang. 5) Disable UFO when path will apply IPSEC tranformations, from Jakub Sitnicki. 6) Don't bogusly double cwnd in dctcp module, from Florian Westphal. 7) skb_checksum_help() should never actually use the value "0" for the resulting checksum, that has a special meaning, use CSUM_MANGLED_0 instead. From Eric Dumazet. 8) Per-tx/rx queue statistic strings are wrong in qed driver, fix from Yuval MIntz. 9) Fix SCTP reference counting of associations and transports in sctp_diag. From Xin Long. 10) When we hit ip6tunnel_xmit() we could have come from an ipv4 path in a previous layer or similar, so explicitly clear the ipv6 control block in the skb. From Eli Cooper. 11) Fix bogus sleeping inside of inet_wait_for_connect(), from WANG Cong. 12) Correct deivce ID of T6 adapter in cxgb4 driver, from Hariprasad Shenai. 13) Fix potential access past the end of the skb page frag array in tcp_sendmsg(). From Eric Dumazet. 14) 'skb' can legitimately be NULL in inet{,6}_exact_dif_match(). Fix from David Ahern. 15) Don't return an error in tcp_sendmsg() if we wronte any bytes successfully, from Eric Dumazet. 16) Extraneous unlocks in netlink_diag_dump(), we removed the locking but forgot to purge these unlock calls. From Eric Dumazet. 17) Fix memory leak in error path of __genl_register_family(). We leak the attrbuf, from WANG Cong. 18) cgroupstats netlink policy table is mis-sized, from WANG Cong. 19) Several XDP bug fixes in mlx5, from Saeed Mahameed. 20) Fix several device refcount leaks in network drivers, from Johan Hovold. 21) icmp6_send() should use skb dst device not skb->dev to determine L3 routing domain. From David Ahern. 22) ip_vs_genl_family sets maxattr incorrectly, from WANG Cong. 23) We leak new macvlan port in some cases of maclan_common_netlink() errors. Fix from Gao Feng. 24) Similar to the icmp6_send() fix, icmp_route_lookup() should determine L3 routing domain using skb_dst(skb)->dev not skb->dev. Also from David Ahern. 25) Several fixes for route offloading and FIB notification handling in mlxsw driver, from Jiri Pirko. 26) Properly cap __skb_flow_dissect()'s return value, from Eric Dumazet. 27) Fix long standing regression in ipv4 redirect handling, wrt. validating the new neighbour's reachability. From Stephen Suryaputra Lin. 28) If sk_filter() trims the packet excessively, handle it reasonably in tcp input instead of exploding. From Eric Dumazet. 29) Fix handling of napi hash state when copying channels in sfc driver, from Bert Kenward. * git://git.kernel.org/pub/scm/linux/kernel/git/davem/net: (121 commits) mlxsw: spectrum_router: Flush FIB tables during fini net: stmmac: Fix lack of link transition for fixed PHYs sctp: change sk state only when it has assocs in sctp_shutdown bnx2: Wait for in-flight DMA to complete at probe stage Revert "bnx2: Reset device during driver initialization" ps3_gelic: fix spelling mistake in debug message net: ethernet: ixp4xx_eth: fix spelling mistake in debug message ibmvnic: Fix size of debugfs name buffer ibmvnic: Unmap ibmvnic_statistics structure sfc: clear napi_hash state when copying channels mlxsw: spectrum_router: Correctly dump neighbour activity mlxsw: spectrum: Fix refcount bug on span entries bnxt_en: Fix VF virtual link state. bnxt_en: Fix ring arithmetic in bnxt_setup_tc(). Revert "include/uapi/linux/atm_zatm.h: include linux/time.h" tcp: take care of truncations done by sk_filter() ipv4: use new_gw for redirect neigh lookup r8152: Fix error path in open function net: bpqether.h: remove if_ether.h guard net: __skb_flow_dissect() must cap its return value ...
Diffstat (limited to 'include')
-rw-r--r--include/linux/ipv6.h2
-rw-r--r--include/linux/netdevice.h15
-rw-r--r--include/net/ip.h3
-rw-r--r--include/net/ip6_tunnel.h1
-rw-r--r--include/net/netfilter/nf_conntrack_labels.h3
-rw-r--r--include/net/netfilter/nf_tables.h8
-rw-r--r--include/net/sctp/sctp.h2
-rw-r--r--include/net/sock.h4
-rw-r--r--include/net/tcp.h3
-rw-r--r--include/uapi/linux/atm_zatm.h1
-rw-r--r--include/uapi/linux/bpqether.h2
11 files changed, 29 insertions, 15 deletions
diff --git a/include/linux/ipv6.h b/include/linux/ipv6.h
index ca1ad9ebbc92..a0649973ee5b 100644
--- a/include/linux/ipv6.h
+++ b/include/linux/ipv6.h
@@ -149,7 +149,7 @@ static inline bool inet6_exact_dif_match(struct net *net, struct sk_buff *skb)
149{ 149{
150#if defined(CONFIG_NET_L3_MASTER_DEV) 150#if defined(CONFIG_NET_L3_MASTER_DEV)
151 if (!net->ipv4.sysctl_tcp_l3mdev_accept && 151 if (!net->ipv4.sysctl_tcp_l3mdev_accept &&
152 ipv6_l3mdev_skb(IP6CB(skb)->flags)) 152 skb && ipv6_l3mdev_skb(IP6CB(skb)->flags))
153 return true; 153 return true;
154#endif 154#endif
155 return false; 155 return false;
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h
index 91ee3643ccc8..bf04a46f6d5b 100644
--- a/include/linux/netdevice.h
+++ b/include/linux/netdevice.h
@@ -3354,6 +3354,21 @@ int dev_forward_skb(struct net_device *dev, struct sk_buff *skb);
3354bool is_skb_forwardable(const struct net_device *dev, 3354bool is_skb_forwardable(const struct net_device *dev,
3355 const struct sk_buff *skb); 3355 const struct sk_buff *skb);
3356 3356
3357static __always_inline int ____dev_forward_skb(struct net_device *dev,
3358 struct sk_buff *skb)
3359{
3360 if (skb_orphan_frags(skb, GFP_ATOMIC) ||
3361 unlikely(!is_skb_forwardable(dev, skb))) {
3362 atomic_long_inc(&dev->rx_dropped);
3363 kfree_skb(skb);
3364 return NET_RX_DROP;
3365 }
3366
3367 skb_scrub_packet(skb, true);
3368 skb->priority = 0;
3369 return 0;
3370}
3371
3357void dev_queue_xmit_nit(struct sk_buff *skb, struct net_device *dev); 3372void dev_queue_xmit_nit(struct sk_buff *skb, struct net_device *dev);
3358 3373
3359extern int netdev_budget; 3374extern int netdev_budget;
diff --git a/include/net/ip.h b/include/net/ip.h
index 5413883ac47f..d3a107850a41 100644
--- a/include/net/ip.h
+++ b/include/net/ip.h
@@ -47,8 +47,7 @@ struct inet_skb_parm {
47#define IPSKB_REROUTED BIT(4) 47#define IPSKB_REROUTED BIT(4)
48#define IPSKB_DOREDIRECT BIT(5) 48#define IPSKB_DOREDIRECT BIT(5)
49#define IPSKB_FRAG_PMTU BIT(6) 49#define IPSKB_FRAG_PMTU BIT(6)
50#define IPSKB_FRAG_SEGS BIT(7) 50#define IPSKB_L3SLAVE BIT(7)
51#define IPSKB_L3SLAVE BIT(8)
52 51
53 u16 frag_max_size; 52 u16 frag_max_size;
54}; 53};
diff --git a/include/net/ip6_tunnel.h b/include/net/ip6_tunnel.h
index 20ed9699fcd4..1b1cf33cbfb0 100644
--- a/include/net/ip6_tunnel.h
+++ b/include/net/ip6_tunnel.h
@@ -146,6 +146,7 @@ static inline void ip6tunnel_xmit(struct sock *sk, struct sk_buff *skb,
146{ 146{
147 int pkt_len, err; 147 int pkt_len, err;
148 148
149 memset(skb->cb, 0, sizeof(struct inet6_skb_parm));
149 pkt_len = skb->len - skb_inner_network_offset(skb); 150 pkt_len = skb->len - skb_inner_network_offset(skb);
150 err = ip6_local_out(dev_net(skb_dst(skb)->dev), sk, skb); 151 err = ip6_local_out(dev_net(skb_dst(skb)->dev), sk, skb);
151 if (unlikely(net_xmit_eval(err))) 152 if (unlikely(net_xmit_eval(err)))
diff --git a/include/net/netfilter/nf_conntrack_labels.h b/include/net/netfilter/nf_conntrack_labels.h
index 498814626e28..1723a67c0b0a 100644
--- a/include/net/netfilter/nf_conntrack_labels.h
+++ b/include/net/netfilter/nf_conntrack_labels.h
@@ -30,8 +30,7 @@ static inline struct nf_conn_labels *nf_ct_labels_ext_add(struct nf_conn *ct)
30 if (net->ct.labels_used == 0) 30 if (net->ct.labels_used == 0)
31 return NULL; 31 return NULL;
32 32
33 return nf_ct_ext_add_length(ct, NF_CT_EXT_LABELS, 33 return nf_ct_ext_add(ct, NF_CT_EXT_LABELS, GFP_ATOMIC);
34 sizeof(struct nf_conn_labels), GFP_ATOMIC);
35#else 34#else
36 return NULL; 35 return NULL;
37#endif 36#endif
diff --git a/include/net/netfilter/nf_tables.h b/include/net/netfilter/nf_tables.h
index 5031e072567b..d79d1e9b9546 100644
--- a/include/net/netfilter/nf_tables.h
+++ b/include/net/netfilter/nf_tables.h
@@ -145,7 +145,7 @@ static inline enum nft_registers nft_type_to_reg(enum nft_data_types type)
145 return type == NFT_DATA_VERDICT ? NFT_REG_VERDICT : NFT_REG_1 * NFT_REG_SIZE / NFT_REG32_SIZE; 145 return type == NFT_DATA_VERDICT ? NFT_REG_VERDICT : NFT_REG_1 * NFT_REG_SIZE / NFT_REG32_SIZE;
146} 146}
147 147
148unsigned int nft_parse_u32_check(const struct nlattr *attr, int max, u32 *dest); 148int nft_parse_u32_check(const struct nlattr *attr, int max, u32 *dest);
149unsigned int nft_parse_register(const struct nlattr *attr); 149unsigned int nft_parse_register(const struct nlattr *attr);
150int nft_dump_register(struct sk_buff *skb, unsigned int attr, unsigned int reg); 150int nft_dump_register(struct sk_buff *skb, unsigned int attr, unsigned int reg);
151 151
@@ -542,7 +542,8 @@ void *nft_set_elem_init(const struct nft_set *set,
542 const struct nft_set_ext_tmpl *tmpl, 542 const struct nft_set_ext_tmpl *tmpl,
543 const u32 *key, const u32 *data, 543 const u32 *key, const u32 *data,
544 u64 timeout, gfp_t gfp); 544 u64 timeout, gfp_t gfp);
545void nft_set_elem_destroy(const struct nft_set *set, void *elem); 545void nft_set_elem_destroy(const struct nft_set *set, void *elem,
546 bool destroy_expr);
546 547
547/** 548/**
548 * struct nft_set_gc_batch_head - nf_tables set garbage collection batch 549 * struct nft_set_gc_batch_head - nf_tables set garbage collection batch
@@ -693,7 +694,6 @@ static inline int nft_expr_clone(struct nft_expr *dst, struct nft_expr *src)
693{ 694{
694 int err; 695 int err;
695 696
696 __module_get(src->ops->type->owner);
697 if (src->ops->clone) { 697 if (src->ops->clone) {
698 dst->ops = src->ops; 698 dst->ops = src->ops;
699 err = src->ops->clone(dst, src); 699 err = src->ops->clone(dst, src);
@@ -702,6 +702,8 @@ static inline int nft_expr_clone(struct nft_expr *dst, struct nft_expr *src)
702 } else { 702 } else {
703 memcpy(dst, src, src->ops->size); 703 memcpy(dst, src, src->ops->size);
704 } 704 }
705
706 __module_get(src->ops->type->owner);
705 return 0; 707 return 0;
706} 708}
707 709
diff --git a/include/net/sctp/sctp.h b/include/net/sctp/sctp.h
index 87a7f42e7639..31acc3f4f132 100644
--- a/include/net/sctp/sctp.h
+++ b/include/net/sctp/sctp.h
@@ -152,7 +152,7 @@ void sctp_unhash_endpoint(struct sctp_endpoint *);
152struct sock *sctp_err_lookup(struct net *net, int family, struct sk_buff *, 152struct sock *sctp_err_lookup(struct net *net, int family, struct sk_buff *,
153 struct sctphdr *, struct sctp_association **, 153 struct sctphdr *, struct sctp_association **,
154 struct sctp_transport **); 154 struct sctp_transport **);
155void sctp_err_finish(struct sock *, struct sctp_association *); 155void sctp_err_finish(struct sock *, struct sctp_transport *);
156void sctp_icmp_frag_needed(struct sock *, struct sctp_association *, 156void sctp_icmp_frag_needed(struct sock *, struct sctp_association *,
157 struct sctp_transport *t, __u32 pmtu); 157 struct sctp_transport *t, __u32 pmtu);
158void sctp_icmp_redirect(struct sock *, struct sctp_transport *, 158void sctp_icmp_redirect(struct sock *, struct sctp_transport *,
diff --git a/include/net/sock.h b/include/net/sock.h
index 73c6b008f1b7..92b269709b9a 100644
--- a/include/net/sock.h
+++ b/include/net/sock.h
@@ -1596,11 +1596,11 @@ static inline void sock_put(struct sock *sk)
1596void sock_gen_put(struct sock *sk); 1596void sock_gen_put(struct sock *sk);
1597 1597
1598int __sk_receive_skb(struct sock *sk, struct sk_buff *skb, const int nested, 1598int __sk_receive_skb(struct sock *sk, struct sk_buff *skb, const int nested,
1599 unsigned int trim_cap); 1599 unsigned int trim_cap, bool refcounted);
1600static inline int sk_receive_skb(struct sock *sk, struct sk_buff *skb, 1600static inline int sk_receive_skb(struct sock *sk, struct sk_buff *skb,
1601 const int nested) 1601 const int nested)
1602{ 1602{
1603 return __sk_receive_skb(sk, skb, nested, 1); 1603 return __sk_receive_skb(sk, skb, nested, 1, true);
1604} 1604}
1605 1605
1606static inline void sk_tx_queue_set(struct sock *sk, int tx_queue) 1606static inline void sk_tx_queue_set(struct sock *sk, int tx_queue)
diff --git a/include/net/tcp.h b/include/net/tcp.h
index 5b82d4d94834..123979fe12bf 100644
--- a/include/net/tcp.h
+++ b/include/net/tcp.h
@@ -805,7 +805,7 @@ static inline bool inet_exact_dif_match(struct net *net, struct sk_buff *skb)
805{ 805{
806#if IS_ENABLED(CONFIG_NET_L3_MASTER_DEV) 806#if IS_ENABLED(CONFIG_NET_L3_MASTER_DEV)
807 if (!net->ipv4.sysctl_tcp_l3mdev_accept && 807 if (!net->ipv4.sysctl_tcp_l3mdev_accept &&
808 ipv4_l3mdev_skb(TCP_SKB_CB(skb)->header.h4.flags)) 808 skb && ipv4_l3mdev_skb(TCP_SKB_CB(skb)->header.h4.flags))
809 return true; 809 return true;
810#endif 810#endif
811 return false; 811 return false;
@@ -1220,6 +1220,7 @@ static inline void tcp_prequeue_init(struct tcp_sock *tp)
1220 1220
1221bool tcp_prequeue(struct sock *sk, struct sk_buff *skb); 1221bool tcp_prequeue(struct sock *sk, struct sk_buff *skb);
1222bool tcp_add_backlog(struct sock *sk, struct sk_buff *skb); 1222bool tcp_add_backlog(struct sock *sk, struct sk_buff *skb);
1223int tcp_filter(struct sock *sk, struct sk_buff *skb);
1223 1224
1224#undef STATE_TRACE 1225#undef STATE_TRACE
1225 1226
diff --git a/include/uapi/linux/atm_zatm.h b/include/uapi/linux/atm_zatm.h
index 5cd4d4d2dd1d..9c9c6ad55f14 100644
--- a/include/uapi/linux/atm_zatm.h
+++ b/include/uapi/linux/atm_zatm.h
@@ -14,7 +14,6 @@
14 14
15#include <linux/atmapi.h> 15#include <linux/atmapi.h>
16#include <linux/atmioc.h> 16#include <linux/atmioc.h>
17#include <linux/time.h>
18 17
19#define ZATM_GETPOOL _IOW('a',ATMIOC_SARPRV+1,struct atmif_sioc) 18#define ZATM_GETPOOL _IOW('a',ATMIOC_SARPRV+1,struct atmif_sioc)
20 /* get pool statistics */ 19 /* get pool statistics */
diff --git a/include/uapi/linux/bpqether.h b/include/uapi/linux/bpqether.h
index a6c35e1a89ad..05865edaefda 100644
--- a/include/uapi/linux/bpqether.h
+++ b/include/uapi/linux/bpqether.h
@@ -5,9 +5,7 @@
5 * Defines for the BPQETHER pseudo device driver 5 * Defines for the BPQETHER pseudo device driver
6 */ 6 */
7 7
8#ifndef __LINUX_IF_ETHER_H
9#include <linux/if_ether.h> 8#include <linux/if_ether.h>
10#endif
11 9
12#define SIOCSBPQETHOPT (SIOCDEVPRIVATE+0) /* reserved */ 10#define SIOCSBPQETHOPT (SIOCDEVPRIVATE+0) /* reserved */
13#define SIOCSBPQETHADDR (SIOCDEVPRIVATE+1) 11#define SIOCSBPQETHADDR (SIOCDEVPRIVATE+1)