Skip to content

Commit 8f8ba75

Browse files
committed
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
Pull networking update from David Miller: "A couple weeks of bug fixing in there. The largest chunk is all the broken crap Amerigo Wang found in the netpoll layer." 1) netpoll and it's users has several serious bugs: a) uses GFP_KERNEL with locks held b) interfaces requiring interrupts disabled are called with them enabled c) and vice versa d) VLAN tag demuxing, as per all other RX packet input paths, is not applied All from Amerigo Wang. 2) Hopefully cure the ipv4 mapped ipv6 address TCP early demux bugs for good, from Neal Cardwell. 3) Unlike AF_UNIX, AF_PACKET sockets don't set a default credentials when the user doesn't specify one explicitly during sendmsg(). Instead we attach an empty (zero) SCM credential block which is definitely not what we want. Fix from Eric Dumazet. 4) IPv6 illegally invokes netdevice notifiers with RCU lock held, fix from Ben Hutchings. 5) inet_csk_route_child_sock() checks wrong inet options pointer, fix from Christoph Paasch. 6) When AF_PACKET is used for transmit, packet loopback doesn't behave properly when a socket fanout is enabled, from Eric Leblond. 7) On bluetooth l2cap channel create failure, we leak the socket, from Jaganath Kanakkassery. 8) Fix all the netprio file handling bugs found by Al Viro, from John Fastabend. 9) Several error return and NULL deref bug fixes in networking drivers from Julia Lawall. 10) A large smattering of struct padding et al. kernel memory leaks to userspace found of Mathias Krause. 11) Conntrack expections in netfilter can access an uninitialized timer, fix from Pablo Neira Ayuso. 12) Several netfilter SIP tracker bug fixes from Patrick McHardy. 13) IPSEC ipv6 routes are not initialized correctly all the time, resulting in an OOPS in inet_putpeer(). Also from Patrick McHardy. 14) Bridging does rcu_dereference() outside of RCU protected area, from Stephen Hemminger. 15) Fix routing cache removal performance regression when looking up output routes that have a local destination. From Zheng Yan. * git://git.kernel.org/pub/scm/linux/kernel/git/davem/net: (87 commits) af_netlink: force credentials passing [CVE-2012-3520] ipv4: fix ip header ident selection in __ip_make_skb() ipv4: Use newinet->inet_opt in inet_csk_route_child_sock() tcp: fix possible socket refcount problem net: tcp: move sk_rx_dst_set call after tcp_create_openreq_child() net/core/dev.c: fix kernel-doc warning netconsole: remove a redundant netconsole_target_put() net: ipv6: fix oops in inet_putpeer() net/stmmac: fix issue of clk_get for Loongson1B. caif: Do not dereference NULL in chnl_recv_cb() af_packet: don't emit packet on orig fanout group drivers/net/irda: fix error return code drivers/net/wan/dscc4.c: fix error return code drivers/net/wimax/i2400m/fw.c: fix error return code smsc75xx: add missing entry to MAINTAINERS net: qmi_wwan: new devices: UML290 and K5006-Z net: sh_eth: Add eth support for R8A7779 device netdev/phy: skip disabled mdio-mux nodes dt: introduce for_each_available_child_of_node, of_get_next_available_child net: netprio: fix cgrp create and write priomap race ...
2 parents 1456c75 + e0e3cea commit 8f8ba75

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

88 files changed

+637
-575
lines changed

Documentation/networking/netconsole.txt

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,23 @@ Built-in netconsole starts immediately after the TCP stack is
5151
initialized and attempts to bring up the supplied dev at the supplied
5252
address.
5353

54-
The remote host can run either 'netcat -u -l -p <port>',
55-
'nc -l -u <port>' or syslogd.
54+
The remote host has several options to receive the kernel messages,
55+
for example:
56+
57+
1) syslogd
58+
59+
2) netcat
60+
61+
On distributions using a BSD-based netcat version (e.g. Fedora,
62+
openSUSE and Ubuntu) the listening port must be specified without
63+
the -p switch:
64+
65+
'nc -u -l -p <port>' / 'nc -u -l <port>' or
66+
'netcat -u -l -p <port>' / 'netcat -u -l <port>'
67+
68+
3) socat
69+
70+
'socat udp-recv:<port> -'
5671

5772
Dynamic reconfiguration:
5873
========================

MAINTAINERS

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7288,6 +7288,12 @@ W: http://www.connecttech.com
72887288
S: Supported
72897289
F: drivers/usb/serial/whiteheat*
72907290

7291+
USB SMSC75XX ETHERNET DRIVER
7292+
M: Steve Glendinning <[email protected]>
7293+
7294+
S: Maintained
7295+
F: drivers/net/usb/smsc75xx.*
7296+
72917297
USB SMSC95XX ETHERNET DRIVER
72927298
M: Steve Glendinning <[email protected]>
72937299

drivers/bluetooth/ath3k.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,7 @@ static struct usb_device_id ath3k_table[] = {
7979
{ USB_DEVICE(0x13d3, 0x3362) },
8080
{ USB_DEVICE(0x0CF3, 0xE004) },
8181
{ USB_DEVICE(0x0930, 0x0219) },
82+
{ USB_DEVICE(0x0489, 0xe057) },
8283

8384
/* Atheros AR5BBU12 with sflash firmware */
8485
{ USB_DEVICE(0x0489, 0xE02C) },
@@ -104,6 +105,7 @@ static struct usb_device_id ath3k_blist_tbl[] = {
104105
{ USB_DEVICE(0x13d3, 0x3362), .driver_info = BTUSB_ATH3012 },
105106
{ USB_DEVICE(0x0cf3, 0xe004), .driver_info = BTUSB_ATH3012 },
106107
{ USB_DEVICE(0x0930, 0x0219), .driver_info = BTUSB_ATH3012 },
108+
{ USB_DEVICE(0x0489, 0xe057), .driver_info = BTUSB_ATH3012 },
107109

108110
/* Atheros AR5BBU22 with sflash firmware */
109111
{ USB_DEVICE(0x0489, 0xE03C), .driver_info = BTUSB_ATH3012 },

drivers/bluetooth/btusb.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,7 @@ static struct usb_device_id btusb_table[] = {
9898
{ USB_DEVICE(0x0a5c, 0x21e6) },
9999
{ USB_DEVICE(0x0a5c, 0x21e8) },
100100
{ USB_DEVICE(0x0a5c, 0x21f3) },
101+
{ USB_DEVICE(0x0a5c, 0x21f4) },
101102
{ USB_DEVICE(0x413c, 0x8197) },
102103

103104
/* Foxconn - Hon Hai */
@@ -133,6 +134,7 @@ static struct usb_device_id blacklist_table[] = {
133134
{ USB_DEVICE(0x13d3, 0x3362), .driver_info = BTUSB_ATH3012 },
134135
{ USB_DEVICE(0x0cf3, 0xe004), .driver_info = BTUSB_ATH3012 },
135136
{ USB_DEVICE(0x0930, 0x0219), .driver_info = BTUSB_ATH3012 },
137+
{ USB_DEVICE(0x0489, 0xe057), .driver_info = BTUSB_ATH3012 },
136138

137139
/* Atheros AR5BBU12 with sflash firmware */
138140
{ USB_DEVICE(0x0489, 0xe02c), .driver_info = BTUSB_IGNORE },

drivers/net/bonding/bond_main.c

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -398,7 +398,7 @@ int bond_dev_queue_xmit(struct bonding *bond, struct sk_buff *skb,
398398
sizeof(qdisc_skb_cb(skb)->slave_dev_queue_mapping));
399399
skb->queue_mapping = qdisc_skb_cb(skb)->slave_dev_queue_mapping;
400400

401-
if (unlikely(netpoll_tx_running(slave_dev)))
401+
if (unlikely(netpoll_tx_running(bond->dev)))
402402
bond_netpoll_send_skb(bond_get_slave_by_dev(bond, slave_dev), skb);
403403
else
404404
dev_queue_xmit(skb);
@@ -1235,12 +1235,12 @@ static inline int slave_enable_netpoll(struct slave *slave)
12351235
struct netpoll *np;
12361236
int err = 0;
12371237

1238-
np = kzalloc(sizeof(*np), GFP_KERNEL);
1238+
np = kzalloc(sizeof(*np), GFP_ATOMIC);
12391239
err = -ENOMEM;
12401240
if (!np)
12411241
goto out;
12421242

1243-
err = __netpoll_setup(np, slave->dev);
1243+
err = __netpoll_setup(np, slave->dev, GFP_ATOMIC);
12441244
if (err) {
12451245
kfree(np);
12461246
goto out;
@@ -1257,9 +1257,7 @@ static inline void slave_disable_netpoll(struct slave *slave)
12571257
return;
12581258

12591259
slave->np = NULL;
1260-
synchronize_rcu_bh();
1261-
__netpoll_cleanup(np);
1262-
kfree(np);
1260+
__netpoll_free_rcu(np);
12631261
}
12641262
static inline bool slave_dev_support_netpoll(struct net_device *slave_dev)
12651263
{
@@ -1292,7 +1290,7 @@ static void bond_netpoll_cleanup(struct net_device *bond_dev)
12921290
read_unlock(&bond->lock);
12931291
}
12941292

1295-
static int bond_netpoll_setup(struct net_device *dev, struct netpoll_info *ni)
1293+
static int bond_netpoll_setup(struct net_device *dev, struct netpoll_info *ni, gfp_t gfp)
12961294
{
12971295
struct bonding *bond = netdev_priv(dev);
12981296
struct slave *slave;

drivers/net/ethernet/freescale/fs_enet/mii-bitbang.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -174,8 +174,10 @@ static int __devinit fs_enet_mdio_probe(struct platform_device *ofdev)
174174

175175
new_bus->phy_mask = ~0;
176176
new_bus->irq = kmalloc(sizeof(int) * PHY_MAX_ADDR, GFP_KERNEL);
177-
if (!new_bus->irq)
177+
if (!new_bus->irq) {
178+
ret = -ENOMEM;
178179
goto out_unmap_regs;
180+
}
179181

180182
new_bus->parent = &ofdev->dev;
181183
dev_set_drvdata(&ofdev->dev, new_bus);

drivers/net/ethernet/freescale/fs_enet/mii-fec.c

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -137,8 +137,10 @@ static int __devinit fs_enet_mdio_probe(struct platform_device *ofdev)
137137
snprintf(new_bus->id, MII_BUS_ID_SIZE, "%x", res.start);
138138

139139
fec->fecp = ioremap(res.start, resource_size(&res));
140-
if (!fec->fecp)
140+
if (!fec->fecp) {
141+
ret = -ENOMEM;
141142
goto out_fec;
143+
}
142144

143145
if (get_bus_freq) {
144146
clock = get_bus_freq(ofdev->dev.of_node);
@@ -172,8 +174,10 @@ static int __devinit fs_enet_mdio_probe(struct platform_device *ofdev)
172174

173175
new_bus->phy_mask = ~0;
174176
new_bus->irq = kmalloc(sizeof(int) * PHY_MAX_ADDR, GFP_KERNEL);
175-
if (!new_bus->irq)
177+
if (!new_bus->irq) {
178+
ret = -ENOMEM;
176179
goto out_unmap_regs;
180+
}
177181

178182
new_bus->parent = &ofdev->dev;
179183
dev_set_drvdata(&ofdev->dev, new_bus);

drivers/net/ethernet/mellanox/mlx4/mcg.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -432,8 +432,10 @@ static int add_promisc_qp(struct mlx4_dev *dev, u8 port,
432432
if ((be32_to_cpu(mgm->qp[i]) & MGM_QPN_MASK) == qpn) {
433433
/* Entry already exists, add to duplicates */
434434
dqp = kmalloc(sizeof *dqp, GFP_KERNEL);
435-
if (!dqp)
435+
if (!dqp) {
436+
err = -ENOMEM;
436437
goto out_mailbox;
438+
}
437439
dqp->qpn = qpn;
438440
list_add_tail(&dqp->list, &entry->duplicates);
439441
found = true;

drivers/net/ethernet/renesas/Kconfig

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ config SH_ETH
88
(CPU_SUBTYPE_SH7710 || CPU_SUBTYPE_SH7712 || \
99
CPU_SUBTYPE_SH7763 || CPU_SUBTYPE_SH7619 || \
1010
CPU_SUBTYPE_SH7724 || CPU_SUBTYPE_SH7734 || \
11-
CPU_SUBTYPE_SH7757 || ARCH_R8A7740)
11+
CPU_SUBTYPE_SH7757 || ARCH_R8A7740 || ARCH_R8A7779)
1212
select CRC32
1313
select NET_CORE
1414
select MII
@@ -18,4 +18,4 @@ config SH_ETH
1818
Renesas SuperH Ethernet device driver.
1919
This driver supporting CPUs are:
2020
- SH7619, SH7710, SH7712, SH7724, SH7734, SH7763, SH7757,
21-
and R8A7740.
21+
R8A7740 and R8A7779.

drivers/net/ethernet/renesas/sh_eth.c

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ static void sh_eth_select_mii(struct net_device *ndev)
7878
#endif
7979

8080
/* There is CPU dependent code */
81-
#if defined(CONFIG_CPU_SUBTYPE_SH7724)
81+
#if defined(CONFIG_CPU_SUBTYPE_SH7724) || defined(CONFIG_ARCH_R8A7779)
8282
#define SH_ETH_RESET_DEFAULT 1
8383
static void sh_eth_set_duplex(struct net_device *ndev)
8484
{
@@ -93,13 +93,18 @@ static void sh_eth_set_duplex(struct net_device *ndev)
9393
static void sh_eth_set_rate(struct net_device *ndev)
9494
{
9595
struct sh_eth_private *mdp = netdev_priv(ndev);
96+
unsigned int bits = ECMR_RTM;
97+
98+
#if defined(CONFIG_ARCH_R8A7779)
99+
bits |= ECMR_ELB;
100+
#endif
96101

97102
switch (mdp->speed) {
98103
case 10: /* 10BASE */
99-
sh_eth_write(ndev, sh_eth_read(ndev, ECMR) & ~ECMR_RTM, ECMR);
104+
sh_eth_write(ndev, sh_eth_read(ndev, ECMR) & ~bits, ECMR);
100105
break;
101106
case 100:/* 100BASE */
102-
sh_eth_write(ndev, sh_eth_read(ndev, ECMR) | ECMR_RTM, ECMR);
107+
sh_eth_write(ndev, sh_eth_read(ndev, ECMR) | bits, ECMR);
103108
break;
104109
default:
105110
break;

drivers/net/ethernet/stmicro/stmmac/stmmac_main.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2077,7 +2077,7 @@ struct stmmac_priv *stmmac_dvr_probe(struct device *device,
20772077
goto error_netdev_register;
20782078
}
20792079

2080-
priv->stmmac_clk = clk_get(priv->device, NULL);
2080+
priv->stmmac_clk = clk_get(priv->device, STMMAC_RESOURCE_NAME);
20812081
if (IS_ERR(priv->stmmac_clk)) {
20822082
pr_warning("%s: warning: cannot get CSR clock\n", __func__);
20832083
goto error_clk_get;

drivers/net/ethernet/ti/davinci_cpdma.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -538,11 +538,12 @@ EXPORT_SYMBOL_GPL(cpdma_chan_create);
538538

539539
int cpdma_chan_destroy(struct cpdma_chan *chan)
540540
{
541-
struct cpdma_ctlr *ctlr = chan->ctlr;
541+
struct cpdma_ctlr *ctlr;
542542
unsigned long flags;
543543

544544
if (!chan)
545545
return -EINVAL;
546+
ctlr = chan->ctlr;
546547

547548
spin_lock_irqsave(&ctlr->lock, flags);
548549
if (chan->state != CPDMA_STATE_IDLE)

drivers/net/irda/ks959-sir.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -542,6 +542,7 @@ static int ks959_net_open(struct net_device *netdev)
542542
sprintf(hwname, "usb#%d", kingsun->usbdev->devnum);
543543
kingsun->irlap = irlap_open(netdev, &kingsun->qos, hwname);
544544
if (!kingsun->irlap) {
545+
err = -ENOMEM;
545546
dev_err(&kingsun->usbdev->dev, "irlap_open failed\n");
546547
goto free_mem;
547548
}

drivers/net/irda/ksdazzle-sir.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -436,6 +436,7 @@ static int ksdazzle_net_open(struct net_device *netdev)
436436
sprintf(hwname, "usb#%d", kingsun->usbdev->devnum);
437437
kingsun->irlap = irlap_open(netdev, &kingsun->qos, hwname);
438438
if (!kingsun->irlap) {
439+
err = -ENOMEM;
439440
dev_err(&kingsun->usbdev->dev, "irlap_open failed\n");
440441
goto free_mem;
441442
}

drivers/net/netconsole.c

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -640,15 +640,9 @@ static int netconsole_netdev_event(struct notifier_block *this,
640640
* rtnl_lock already held
641641
*/
642642
if (nt->np.dev) {
643-
spin_unlock_irqrestore(
644-
&target_list_lock,
645-
flags);
646643
__netpoll_cleanup(&nt->np);
647-
spin_lock_irqsave(&target_list_lock,
648-
flags);
649644
dev_put(nt->np.dev);
650645
nt->np.dev = NULL;
651-
netconsole_target_put(nt);
652646
}
653647
nt->enabled = 0;
654648
stopped = true;

drivers/net/phy/mdio-mux.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ int mdio_mux_init(struct device *dev,
132132
pb->mii_bus = parent_bus;
133133

134134
ret_val = -ENODEV;
135-
for_each_child_of_node(dev->of_node, child_bus_node) {
135+
for_each_available_child_of_node(dev->of_node, child_bus_node) {
136136
u32 v;
137137

138138
r = of_property_read_u32(child_bus_node, "reg", &v);

drivers/net/team/team.c

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -795,16 +795,17 @@ static void team_port_leave(struct team *team, struct team_port *port)
795795
}
796796

797797
#ifdef CONFIG_NET_POLL_CONTROLLER
798-
static int team_port_enable_netpoll(struct team *team, struct team_port *port)
798+
static int team_port_enable_netpoll(struct team *team, struct team_port *port,
799+
gfp_t gfp)
799800
{
800801
struct netpoll *np;
801802
int err;
802803

803-
np = kzalloc(sizeof(*np), GFP_KERNEL);
804+
np = kzalloc(sizeof(*np), gfp);
804805
if (!np)
805806
return -ENOMEM;
806807

807-
err = __netpoll_setup(np, port->dev);
808+
err = __netpoll_setup(np, port->dev, gfp);
808809
if (err) {
809810
kfree(np);
810811
return err;
@@ -833,7 +834,8 @@ static struct netpoll_info *team_netpoll_info(struct team *team)
833834
}
834835

835836
#else
836-
static int team_port_enable_netpoll(struct team *team, struct team_port *port)
837+
static int team_port_enable_netpoll(struct team *team, struct team_port *port,
838+
gfp_t gfp)
837839
{
838840
return 0;
839841
}
@@ -913,7 +915,7 @@ static int team_port_add(struct team *team, struct net_device *port_dev)
913915
}
914916

915917
if (team_netpoll_info(team)) {
916-
err = team_port_enable_netpoll(team, port);
918+
err = team_port_enable_netpoll(team, port, GFP_KERNEL);
917919
if (err) {
918920
netdev_err(dev, "Failed to enable netpoll on device %s\n",
919921
portname);
@@ -1443,15 +1445,15 @@ static void team_netpoll_cleanup(struct net_device *dev)
14431445
}
14441446

14451447
static int team_netpoll_setup(struct net_device *dev,
1446-
struct netpoll_info *npifo)
1448+
struct netpoll_info *npifo, gfp_t gfp)
14471449
{
14481450
struct team *team = netdev_priv(dev);
14491451
struct team_port *port;
14501452
int err = 0;
14511453

14521454
mutex_lock(&team->lock);
14531455
list_for_each_entry(port, &team->port_list, list) {
1454-
err = team_port_enable_netpoll(team, port);
1456+
err = team_port_enable_netpoll(team, port, gfp);
14551457
if (err) {
14561458
__team_netpoll_cleanup(team);
14571459
break;

0 commit comments

Comments
 (0)