Skip to content

Commit 5de6ac7

Browse files
committed
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
Pull networking fixes from David Miller: 1) Fix BPF handling of branch offset adjustmnets on backjumps, from Daniel Borkmann. 2) Make sure selinux knows about SOCK_DESTROY netlink messages, from Lorenzo Colitti. 3) Fix openvswitch tunnel mtu regression, from David Wragg. 4) Fix ICMP handling of TCP sockets in syn_recv state, from Eric Dumazet. 5) Fix SCTP user hmacid byte ordering bug, from Xin Long. 6) Fix recursive locking in ipv6 addrconf, from Subash Abhinov Kasiviswanathan. * git://git.kernel.org/pub/scm/linux/kernel/git/davem/net: bpf: fix branch offset adjustment on backjumps after patching ctx expansion vxlan, gre, geneve: Set a large MTU on ovs-created tunnel devices geneve: Relax MTU constraints vxlan: Relax MTU constraints flow_dissector: Fix unaligned access in __skb_flow_dissector when used by eth_get_headlen of: of_mdio: Add marvell, 88e1145 to whitelist of PHY compatibilities. selinux: nlmsgtab: add SOCK_DESTROY to the netlink mapping tables sctp: translate network order to host order when users get a hmacid enic: increment devcmd2 result ring in case of timeout tg3: Fix for tg3 transmit queue 0 timed out when too many gso_segs net:Add sysctl_max_skb_frags tcp: do not drop syn_recv on all icmp reports ipv6: fix a lockdep splat unix: correctly track in-flight fds in sending process user_struct update be2net maintainers' email addresses dwc_eth_qos: Reset hardware before PHY start ipv6: addrconf: Fix recursive spin lock call
2 parents 721675f + a1b14d2 commit 5de6ac7

File tree

30 files changed

+191
-66
lines changed

30 files changed

+191
-66
lines changed

MAINTAINERS

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9787,10 +9787,11 @@ S: Supported
97879787
F: drivers/scsi/be2iscsi/
97889788

97899789
Emulex 10Gbps NIC BE2, BE3-R, Lancer, Skyhawk-R DRIVER
9790-
M: Sathya Perla <[email protected]>
9791-
M: Ajit Khaparde <[email protected]>
9792-
M: Padmanabh Ratnakar <[email protected]>
9793-
M: Sriharsha Basavapatna <[email protected]>
9790+
M: Sathya Perla <[email protected]>
9791+
M: Ajit Khaparde <[email protected]>
9792+
M: Padmanabh Ratnakar <[email protected]>
9793+
M: Sriharsha Basavapatna <[email protected]>
9794+
M: Somnath Kotur <[email protected]>
97949795
97959796
W: http://www.emulex.com
97969797
S: Supported

drivers/net/ethernet/broadcom/tg3.c

Lines changed: 19 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7831,6 +7831,14 @@ static int tigon3_dma_hwbug_workaround(struct tg3_napi *tnapi,
78317831
return ret;
78327832
}
78337833

7834+
static bool tg3_tso_bug_gso_check(struct tg3_napi *tnapi, struct sk_buff *skb)
7835+
{
7836+
/* Check if we will never have enough descriptors,
7837+
* as gso_segs can be more than current ring size
7838+
*/
7839+
return skb_shinfo(skb)->gso_segs < tnapi->tx_pending / 3;
7840+
}
7841+
78347842
static netdev_tx_t tg3_start_xmit(struct sk_buff *, struct net_device *);
78357843

78367844
/* Use GSO to workaround all TSO packets that meet HW bug conditions
@@ -7934,14 +7942,19 @@ static netdev_tx_t tg3_start_xmit(struct sk_buff *skb, struct net_device *dev)
79347942
* vlan encapsulated.
79357943
*/
79367944
if (skb->protocol == htons(ETH_P_8021Q) ||
7937-
skb->protocol == htons(ETH_P_8021AD))
7938-
return tg3_tso_bug(tp, tnapi, txq, skb);
7945+
skb->protocol == htons(ETH_P_8021AD)) {
7946+
if (tg3_tso_bug_gso_check(tnapi, skb))
7947+
return tg3_tso_bug(tp, tnapi, txq, skb);
7948+
goto drop;
7949+
}
79397950

79407951
if (!skb_is_gso_v6(skb)) {
79417952
if (unlikely((ETH_HLEN + hdr_len) > 80) &&
7942-
tg3_flag(tp, TSO_BUG))
7943-
return tg3_tso_bug(tp, tnapi, txq, skb);
7944-
7953+
tg3_flag(tp, TSO_BUG)) {
7954+
if (tg3_tso_bug_gso_check(tnapi, skb))
7955+
return tg3_tso_bug(tp, tnapi, txq, skb);
7956+
goto drop;
7957+
}
79457958
ip_csum = iph->check;
79467959
ip_tot_len = iph->tot_len;
79477960
iph->check = 0;
@@ -8073,7 +8086,7 @@ static netdev_tx_t tg3_start_xmit(struct sk_buff *skb, struct net_device *dev)
80738086
if (would_hit_hwbug) {
80748087
tg3_tx_skb_unmap(tnapi, tnapi->tx_prod, i);
80758088

8076-
if (mss) {
8089+
if (mss && tg3_tso_bug_gso_check(tnapi, skb)) {
80778090
/* If it's a TSO packet, do GSO instead of
80788091
* allocating and copying to a large linear SKB
80798092
*/

drivers/net/ethernet/cisco/enic/enic.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333

3434
#define DRV_NAME "enic"
3535
#define DRV_DESCRIPTION "Cisco VIC Ethernet NIC Driver"
36-
#define DRV_VERSION "2.3.0.12"
36+
#define DRV_VERSION "2.3.0.20"
3737
#define DRV_COPYRIGHT "Copyright 2008-2013 Cisco Systems, Inc"
3838

3939
#define ENIC_BARS_MAX 6

drivers/net/ethernet/cisco/enic/vnic_dev.c

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -298,7 +298,8 @@ static int _vnic_dev_cmd2(struct vnic_dev *vdev, enum vnic_devcmd_cmd cmd,
298298
int wait)
299299
{
300300
struct devcmd2_controller *dc2c = vdev->devcmd2;
301-
struct devcmd2_result *result = dc2c->result + dc2c->next_result;
301+
struct devcmd2_result *result;
302+
u8 color;
302303
unsigned int i;
303304
int delay, err;
304305
u32 fetch_index, new_posted;
@@ -336,13 +337,17 @@ static int _vnic_dev_cmd2(struct vnic_dev *vdev, enum vnic_devcmd_cmd cmd,
336337
if (dc2c->cmd_ring[posted].flags & DEVCMD2_FNORESULT)
337338
return 0;
338339

340+
result = dc2c->result + dc2c->next_result;
341+
color = dc2c->color;
342+
343+
dc2c->next_result++;
344+
if (dc2c->next_result == dc2c->result_size) {
345+
dc2c->next_result = 0;
346+
dc2c->color = dc2c->color ? 0 : 1;
347+
}
348+
339349
for (delay = 0; delay < wait; delay++) {
340-
if (result->color == dc2c->color) {
341-
dc2c->next_result++;
342-
if (dc2c->next_result == dc2c->result_size) {
343-
dc2c->next_result = 0;
344-
dc2c->color = dc2c->color ? 0 : 1;
345-
}
350+
if (result->color == color) {
346351
if (result->error) {
347352
err = result->error;
348353
if (err != ERR_ECMDUNKNOWN ||

drivers/net/ethernet/synopsys/dwc_eth_qos.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1880,9 +1880,9 @@ static int dwceqos_open(struct net_device *ndev)
18801880
}
18811881
netdev_reset_queue(ndev);
18821882

1883+
dwceqos_init_hw(lp);
18831884
napi_enable(&lp->napi);
18841885
phy_start(lp->phy_dev);
1885-
dwceqos_init_hw(lp);
18861886

18871887
netif_start_queue(ndev);
18881888
tasklet_enable(&lp->tx_bdreclaim_tasklet);

drivers/net/geneve.c

Lines changed: 26 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1039,6 +1039,17 @@ static netdev_tx_t geneve_xmit(struct sk_buff *skb, struct net_device *dev)
10391039
return geneve_xmit_skb(skb, dev, info);
10401040
}
10411041

1042+
static int geneve_change_mtu(struct net_device *dev, int new_mtu)
1043+
{
1044+
/* GENEVE overhead is not fixed, so we can't enforce a more
1045+
* precise max MTU.
1046+
*/
1047+
if (new_mtu < 68 || new_mtu > IP_MAX_MTU)
1048+
return -EINVAL;
1049+
dev->mtu = new_mtu;
1050+
return 0;
1051+
}
1052+
10421053
static int geneve_fill_metadata_dst(struct net_device *dev, struct sk_buff *skb)
10431054
{
10441055
struct ip_tunnel_info *info = skb_tunnel_info(skb);
@@ -1083,7 +1094,7 @@ static const struct net_device_ops geneve_netdev_ops = {
10831094
.ndo_stop = geneve_stop,
10841095
.ndo_start_xmit = geneve_xmit,
10851096
.ndo_get_stats64 = ip_tunnel_get_stats64,
1086-
.ndo_change_mtu = eth_change_mtu,
1097+
.ndo_change_mtu = geneve_change_mtu,
10871098
.ndo_validate_addr = eth_validate_addr,
10881099
.ndo_set_mac_address = eth_mac_addr,
10891100
.ndo_fill_metadata_dst = geneve_fill_metadata_dst,
@@ -1442,11 +1453,21 @@ struct net_device *geneve_dev_create_fb(struct net *net, const char *name,
14421453

14431454
err = geneve_configure(net, dev, &geneve_remote_unspec,
14441455
0, 0, 0, htons(dst_port), true, 0);
1445-
if (err) {
1446-
free_netdev(dev);
1447-
return ERR_PTR(err);
1448-
}
1456+
if (err)
1457+
goto err;
1458+
1459+
/* openvswitch users expect packet sizes to be unrestricted,
1460+
* so set the largest MTU we can.
1461+
*/
1462+
err = geneve_change_mtu(dev, IP_MAX_MTU);
1463+
if (err)
1464+
goto err;
1465+
14491466
return dev;
1467+
1468+
err:
1469+
free_netdev(dev);
1470+
return ERR_PTR(err);
14501471
}
14511472
EXPORT_SYMBOL_GPL(geneve_dev_create_fb);
14521473

drivers/net/vxlan.c

Lines changed: 33 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -2367,29 +2367,43 @@ static void vxlan_set_multicast_list(struct net_device *dev)
23672367
{
23682368
}
23692369

2370-
static int vxlan_change_mtu(struct net_device *dev, int new_mtu)
2370+
static int __vxlan_change_mtu(struct net_device *dev,
2371+
struct net_device *lowerdev,
2372+
struct vxlan_rdst *dst, int new_mtu, bool strict)
23712373
{
2372-
struct vxlan_dev *vxlan = netdev_priv(dev);
2373-
struct vxlan_rdst *dst = &vxlan->default_dst;
2374-
struct net_device *lowerdev;
2375-
int max_mtu;
2374+
int max_mtu = IP_MAX_MTU;
23762375

2377-
lowerdev = __dev_get_by_index(vxlan->net, dst->remote_ifindex);
2378-
if (lowerdev == NULL)
2379-
return eth_change_mtu(dev, new_mtu);
2376+
if (lowerdev)
2377+
max_mtu = lowerdev->mtu;
23802378

23812379
if (dst->remote_ip.sa.sa_family == AF_INET6)
2382-
max_mtu = lowerdev->mtu - VXLAN6_HEADROOM;
2380+
max_mtu -= VXLAN6_HEADROOM;
23832381
else
2384-
max_mtu = lowerdev->mtu - VXLAN_HEADROOM;
2382+
max_mtu -= VXLAN_HEADROOM;
23852383

2386-
if (new_mtu < 68 || new_mtu > max_mtu)
2384+
if (new_mtu < 68)
23872385
return -EINVAL;
23882386

2387+
if (new_mtu > max_mtu) {
2388+
if (strict)
2389+
return -EINVAL;
2390+
2391+
new_mtu = max_mtu;
2392+
}
2393+
23892394
dev->mtu = new_mtu;
23902395
return 0;
23912396
}
23922397

2398+
static int vxlan_change_mtu(struct net_device *dev, int new_mtu)
2399+
{
2400+
struct vxlan_dev *vxlan = netdev_priv(dev);
2401+
struct vxlan_rdst *dst = &vxlan->default_dst;
2402+
struct net_device *lowerdev = __dev_get_by_index(vxlan->net,
2403+
dst->remote_ifindex);
2404+
return __vxlan_change_mtu(dev, lowerdev, dst, new_mtu, true);
2405+
}
2406+
23932407
static int egress_ipv4_tun_info(struct net_device *dev, struct sk_buff *skb,
23942408
struct ip_tunnel_info *info,
23952409
__be16 sport, __be16 dport)
@@ -2765,6 +2779,7 @@ static int vxlan_dev_configure(struct net *src_net, struct net_device *dev,
27652779
int err;
27662780
bool use_ipv6 = false;
27672781
__be16 default_port = vxlan->cfg.dst_port;
2782+
struct net_device *lowerdev = NULL;
27682783

27692784
vxlan->net = src_net;
27702785

@@ -2785,9 +2800,7 @@ static int vxlan_dev_configure(struct net *src_net, struct net_device *dev,
27852800
}
27862801

27872802
if (conf->remote_ifindex) {
2788-
struct net_device *lowerdev
2789-
= __dev_get_by_index(src_net, conf->remote_ifindex);
2790-
2803+
lowerdev = __dev_get_by_index(src_net, conf->remote_ifindex);
27912804
dst->remote_ifindex = conf->remote_ifindex;
27922805

27932806
if (!lowerdev) {
@@ -2811,6 +2824,12 @@ static int vxlan_dev_configure(struct net *src_net, struct net_device *dev,
28112824
needed_headroom = lowerdev->hard_header_len;
28122825
}
28132826

2827+
if (conf->mtu) {
2828+
err = __vxlan_change_mtu(dev, lowerdev, dst, conf->mtu, false);
2829+
if (err)
2830+
return err;
2831+
}
2832+
28142833
if (use_ipv6 || conf->flags & VXLAN_F_COLLECT_METADATA)
28152834
needed_headroom += VXLAN6_HEADROOM;
28162835
else

drivers/of/of_mdio.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,7 @@ static const struct of_device_id whitelist_phys[] = {
154154
{ .compatible = "marvell,88E1111", },
155155
{ .compatible = "marvell,88e1116", },
156156
{ .compatible = "marvell,88e1118", },
157+
{ .compatible = "marvell,88e1145", },
157158
{ .compatible = "marvell,88e1149r", },
158159
{ .compatible = "marvell,88e1310", },
159160
{ .compatible = "marvell,88E1510", },

include/linux/skbuff.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -299,6 +299,7 @@ struct sk_buff;
299299
#else
300300
#define MAX_SKB_FRAGS (65536/PAGE_SIZE + 1)
301301
#endif
302+
extern int sysctl_max_skb_frags;
302303

303304
typedef struct skb_frag_struct skb_frag_t;
304305

include/net/af_unix.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@
66
#include <linux/mutex.h>
77
#include <net/sock.h>
88

9-
void unix_inflight(struct file *fp);
10-
void unix_notinflight(struct file *fp);
9+
void unix_inflight(struct user_struct *user, struct file *fp);
10+
void unix_notinflight(struct user_struct *user, struct file *fp);
1111
void unix_gc(void);
1212
void wait_for_unix_gc(void);
1313
struct sock *unix_get_socket(struct file *filp);

include/net/ip_tunnels.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -230,6 +230,7 @@ void ip_tunnel_xmit(struct sk_buff *skb, struct net_device *dev,
230230
int ip_tunnel_ioctl(struct net_device *dev, struct ip_tunnel_parm *p, int cmd);
231231
int ip_tunnel_encap(struct sk_buff *skb, struct ip_tunnel *t,
232232
u8 *protocol, struct flowi4 *fl4);
233+
int __ip_tunnel_change_mtu(struct net_device *dev, int new_mtu, bool strict);
233234
int ip_tunnel_change_mtu(struct net_device *dev, int new_mtu);
234235

235236
struct rtnl_link_stats64 *ip_tunnel_get_stats64(struct net_device *dev,

include/net/scm.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ struct scm_creds {
2121
struct scm_fp_list {
2222
short count;
2323
short max;
24+
struct user_struct *user;
2425
struct file *fp[SCM_MAX_FD];
2526
};
2627

include/net/tcp.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -447,7 +447,7 @@ const u8 *tcp_parse_md5sig_option(const struct tcphdr *th);
447447

448448
void tcp_v4_send_check(struct sock *sk, struct sk_buff *skb);
449449
void tcp_v4_mtu_reduced(struct sock *sk);
450-
void tcp_req_err(struct sock *sk, u32 seq);
450+
void tcp_req_err(struct sock *sk, u32 seq, bool abort);
451451
int tcp_v4_conn_request(struct sock *sk, struct sk_buff *skb);
452452
struct sock *tcp_create_openreq_child(const struct sock *sk,
453453
struct request_sock *req,

kernel/bpf/verifier.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2082,7 +2082,7 @@ static void adjust_branches(struct bpf_prog *prog, int pos, int delta)
20822082
/* adjust offset of jmps if necessary */
20832083
if (i < pos && i + insn->off + 1 > pos)
20842084
insn->off += delta;
2085-
else if (i > pos && i + insn->off + 1 < pos)
2085+
else if (i > pos + delta && i + insn->off + 1 <= pos + delta)
20862086
insn->off -= delta;
20872087
}
20882088
}

net/core/flow_dissector.c

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,6 @@ bool __skb_flow_dissect(const struct sk_buff *skb,
208208
case htons(ETH_P_IPV6): {
209209
const struct ipv6hdr *iph;
210210
struct ipv6hdr _iph;
211-
__be32 flow_label;
212211

213212
ipv6:
214213
iph = __skb_header_pointer(skb, nhoff, sizeof(_iph), data, hlen, &_iph);
@@ -230,8 +229,12 @@ bool __skb_flow_dissect(const struct sk_buff *skb,
230229
key_control->addr_type = FLOW_DISSECTOR_KEY_IPV6_ADDRS;
231230
}
232231

233-
flow_label = ip6_flowlabel(iph);
234-
if (flow_label) {
232+
if ((dissector_uses_key(flow_dissector,
233+
FLOW_DISSECTOR_KEY_FLOW_LABEL) ||
234+
(flags & FLOW_DISSECTOR_F_STOP_AT_FLOW_LABEL)) &&
235+
ip6_flowlabel(iph)) {
236+
__be32 flow_label = ip6_flowlabel(iph);
237+
235238
if (dissector_uses_key(flow_dissector,
236239
FLOW_DISSECTOR_KEY_FLOW_LABEL)) {
237240
key_tags = skb_flow_dissector_target(flow_dissector,

net/core/scm.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,7 @@ static int scm_fp_copy(struct cmsghdr *cmsg, struct scm_fp_list **fplp)
8787
*fplp = fpl;
8888
fpl->count = 0;
8989
fpl->max = SCM_MAX_FD;
90+
fpl->user = NULL;
9091
}
9192
fpp = &fpl->fp[fpl->count];
9293

@@ -107,6 +108,10 @@ static int scm_fp_copy(struct cmsghdr *cmsg, struct scm_fp_list **fplp)
107108
*fpp++ = file;
108109
fpl->count++;
109110
}
111+
112+
if (!fpl->user)
113+
fpl->user = get_uid(current_user());
114+
110115
return num;
111116
}
112117

@@ -119,6 +124,7 @@ void __scm_destroy(struct scm_cookie *scm)
119124
scm->fp = NULL;
120125
for (i=fpl->count-1; i>=0; i--)
121126
fput(fpl->fp[i]);
127+
free_uid(fpl->user);
122128
kfree(fpl);
123129
}
124130
}
@@ -336,6 +342,7 @@ struct scm_fp_list *scm_fp_dup(struct scm_fp_list *fpl)
336342
for (i = 0; i < fpl->count; i++)
337343
get_file(fpl->fp[i]);
338344
new_fpl->max = new_fpl->count;
345+
new_fpl->user = get_uid(fpl->user);
339346
}
340347
return new_fpl;
341348
}

net/core/skbuff.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,8 @@
7979

8080
struct kmem_cache *skbuff_head_cache __read_mostly;
8181
static struct kmem_cache *skbuff_fclone_cache __read_mostly;
82+
int sysctl_max_skb_frags __read_mostly = MAX_SKB_FRAGS;
83+
EXPORT_SYMBOL(sysctl_max_skb_frags);
8284

8385
/**
8486
* skb_panic - private function for out-of-line support

0 commit comments

Comments
 (0)