Skip to content

Commit f3ca4c5

Browse files
committed
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
Pull networking fixes from David Miller: "More fixes in the queue: 1) Netfilter nat can erroneously register the device notifier twice, fix from Florian Westphal. 2) Use after free in nf_tables, from Pablo Neira Ayuso. 3) Parallel update of steering rule fix in mlx5 river, from Eli Britstein. 4) RX processing panic in lan743x, fix from Bryan Whitehead. 5) Use before initialization of TCP_SKB_CB, fix from Christoph Paasch. 6) Fix locking in SRIOV mode of mlx4 driver, from Jack Morgenstein. 7) Fix TX stalls in lan743x due to mishandling of interrupt ACKing modes, from Bryan Whitehead. 8) Fix infoleak in l2tp_ip6_recvmsg(), from Eric Dumazet" * git://git.kernel.org/pub/scm/linux/kernel/git/davem/net: (43 commits) pptp: dst_release sk_dst_cache in pptp_sock_destruct MAINTAINERS: GENET & SYSTEMPORT: Add internal Broadcom list l2tp: fix infoleak in l2tp_ip6_recvmsg() net/tls: Inform user space about send buffer availability net_sched: return correct value for *notify* functions lan743x: Fix TX Stall Issue net/mlx4_core: Fix qp mtt size calculation net/mlx4_core: Fix locking in SRIOV mode when switching between events and polling net/mlx4_core: Fix reset flow when in command polling mode mlxsw: minimal: Initialize base_mac mlxsw: core: Prevent duplication during QSFP module initialization net: dwmac-sun8i: fix a missing check of of_get_phy_mode net: sh_eth: fix a missing check of of_get_phy_mode net: 8390: fix potential NULL pointer dereferences net: fujitsu: fix a potential NULL pointer dereference net: qlogic: fix a potential NULL pointer dereference isdn: hfcpci: fix potential NULL pointer dereference Documentation: devicetree: add a new optional property for port mac address net: rocker: fix a potential NULL pointer dereference net: qlge: fix a potential NULL pointer dereference ...
2 parents 31ef489 + 9417d81 commit f3ca4c5

File tree

46 files changed

+427
-213
lines changed

Some content is hidden

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

46 files changed

+427
-213
lines changed

Documentation/devicetree/bindings/net/dsa/dsa.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,10 @@ properties, described in binding documents:
7171
Documentation/devicetree/bindings/net/fixed-link.txt
7272
for details.
7373

74+
- local-mac-address : See
75+
Documentation/devicetree/bindings/net/ethernet.txt
76+
for details.
77+
7478
Example
7579

7680
The following example shows three switches on three MDIO busses,
@@ -97,6 +101,7 @@ linked into one DSA cluster.
97101
port@1 {
98102
reg = <1>;
99103
label = "lan1";
104+
local-mac-address = [00 00 00 00 00 00];
100105
};
101106

102107
port@2 {

MAINTAINERS

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3204,6 +3204,7 @@ F: drivers/phy/broadcom/phy-brcm-usb*
32043204
BROADCOM GENET ETHERNET DRIVER
32053205
M: Doug Berger <opendmb@gmail.com>
32063206
M: Florian Fainelli <f.fainelli@gmail.com>
3207+
L: bcm-kernel-feedback-list@broadcom.com
32073208
L: netdev@vger.kernel.org
32083209
S: Supported
32093210
F: drivers/net/ethernet/broadcom/genet/
@@ -3311,6 +3312,7 @@ F: drivers/spi/spi-iproc-qspi.c
33113312

33123313
BROADCOM SYSTEMPORT ETHERNET DRIVER
33133314
M: Florian Fainelli <f.fainelli@gmail.com>
3315+
L: bcm-kernel-feedback-list@broadcom.com
33143316
L: netdev@vger.kernel.org
33153317
S: Supported
33163318
F: drivers/net/ethernet/broadcom/bcmsysport.*

arch/alpha/include/uapi/asm/socket.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
#ifndef _UAPI_ASM_SOCKET_H
33
#define _UAPI_ASM_SOCKET_H
44

5+
#include <linux/posix_types.h>
56
#include <asm/sockios.h>
6-
#include <asm/bitsperlong.h>
77

88
/* For setsockopt(2) */
99
/*

arch/mips/include/uapi/asm/socket.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@
1010
#ifndef _UAPI_ASM_SOCKET_H
1111
#define _UAPI_ASM_SOCKET_H
1212

13+
#include <linux/posix_types.h>
1314
#include <asm/sockios.h>
14-
#include <asm/bitsperlong.h>
1515

1616
/*
1717
* For setsockopt(2)

arch/parisc/include/uapi/asm/socket.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
#ifndef _UAPI_ASM_SOCKET_H
33
#define _UAPI_ASM_SOCKET_H
44

5+
#include <linux/posix_types.h>
56
#include <asm/sockios.h>
6-
#include <asm/bitsperlong.h>
77

88
/* For setsockopt(2) */
99
#define SOL_SOCKET 0xffff

arch/sparc/include/uapi/asm/socket.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
#ifndef _ASM_SOCKET_H
33
#define _ASM_SOCKET_H
44

5+
#include <linux/posix_types.h>
56
#include <asm/sockios.h>
6-
#include <asm/bitsperlong.h>
77

88
/* For setsockopt(2) */
99
#define SOL_SOCKET 0xffff

drivers/isdn/hardware/mISDN/hfcpci.c

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2032,10 +2032,19 @@ setup_hw(struct hfc_pci *hc)
20322032
hc->hw.fifos = buffer;
20332033
pci_write_config_dword(hc->pdev, 0x80, hc->hw.dmahandle);
20342034
hc->hw.pci_io = ioremap((ulong) hc->hw.pci_io, 256);
2035+
if (unlikely(!hc->hw.pci_io)) {
2036+
printk(KERN_WARNING
2037+
"HFC-PCI: Error in ioremap for PCI!\n");
2038+
pci_free_consistent(hc->pdev, 0x8000, hc->hw.fifos,
2039+
hc->hw.dmahandle);
2040+
return 1;
2041+
}
2042+
20352043
printk(KERN_INFO
20362044
"HFC-PCI: defined at mem %#lx fifo %#lx(%#lx) IRQ %d HZ %d\n",
20372045
(u_long) hc->hw.pci_io, (u_long) hc->hw.fifos,
20382046
(u_long) hc->hw.dmahandle, hc->irq, HZ);
2047+
20392048
/* enable memory mapped ports, disable busmaster */
20402049
pci_write_config_word(hc->pdev, PCI_COMMAND, PCI_ENA_MEMIO);
20412050
hc->hw.int_m2 = 0;

drivers/net/ethernet/8390/pcnet_cs.c

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -289,6 +289,11 @@ static struct hw_info *get_hwinfo(struct pcmcia_device *link)
289289

290290
virt = ioremap(link->resource[2]->start,
291291
resource_size(link->resource[2]));
292+
if (unlikely(!virt)) {
293+
pcmcia_release_window(link, link->resource[2]);
294+
return NULL;
295+
}
296+
292297
for (i = 0; i < NR_INFO; i++) {
293298
pcmcia_map_mem_page(link, link->resource[2],
294299
hw_info[i].offset & ~(resource_size(link->resource[2])-1));
@@ -1423,6 +1428,11 @@ static int setup_shmem_window(struct pcmcia_device *link, int start_pg,
14231428
/* Try scribbling on the buffer */
14241429
info->base = ioremap(link->resource[3]->start,
14251430
resource_size(link->resource[3]));
1431+
if (unlikely(!info->base)) {
1432+
ret = -ENOMEM;
1433+
goto failed;
1434+
}
1435+
14261436
for (i = 0; i < (TX_PAGES<<8); i += 2)
14271437
__raw_writew((i>>1), info->base+offset+i);
14281438
udelay(100);

drivers/net/ethernet/cavium/liquidio/lio_core.c

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1211,6 +1211,11 @@ int liquidio_change_mtu(struct net_device *netdev, int new_mtu)
12111211

12121212
sc = (struct octeon_soft_command *)
12131213
octeon_alloc_soft_command(oct, OCTNET_CMD_SIZE, 16, 0);
1214+
if (!sc) {
1215+
netif_info(lio, rx_err, lio->netdev,
1216+
"Failed to allocate soft command\n");
1217+
return -ENOMEM;
1218+
}
12141219

12151220
ncmd = (union octnet_cmd *)sc->virtdptr;
12161221

@@ -1684,6 +1689,11 @@ int liquidio_set_fec(struct lio *lio, int on_off)
16841689

16851690
sc = octeon_alloc_soft_command(oct, OCTNET_CMD_SIZE,
16861691
sizeof(struct oct_nic_seapi_resp), 0);
1692+
if (!sc) {
1693+
dev_err(&oct->pci_dev->dev,
1694+
"Failed to allocate soft command\n");
1695+
return -ENOMEM;
1696+
}
16871697

16881698
ncmd = sc->virtdptr;
16891699
resp = sc->virtrptr;

drivers/net/ethernet/cavium/liquidio/lio_main.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1192,6 +1192,11 @@ static void send_rx_ctrl_cmd(struct lio *lio, int start_stop)
11921192
sc = (struct octeon_soft_command *)
11931193
octeon_alloc_soft_command(oct, OCTNET_CMD_SIZE,
11941194
16, 0);
1195+
if (!sc) {
1196+
netif_info(lio, rx_err, lio->netdev,
1197+
"Failed to allocate octeon_soft_command\n");
1198+
return;
1199+
}
11951200

11961201
ncmd = (union octnet_cmd *)sc->virtdptr;
11971202

drivers/net/ethernet/cavium/thunder/nicvf_main.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2234,6 +2234,12 @@ static int nicvf_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
22342234
nic->nicvf_rx_mode_wq = alloc_ordered_workqueue("nicvf_rx_mode_wq_VF%d",
22352235
WQ_MEM_RECLAIM,
22362236
nic->vf_id);
2237+
if (!nic->nicvf_rx_mode_wq) {
2238+
err = -ENOMEM;
2239+
dev_err(dev, "Failed to allocate work queue\n");
2240+
goto err_unregister_interrupts;
2241+
}
2242+
22372243
INIT_WORK(&nic->rx_mode_work.work, nicvf_set_rx_mode_task);
22382244
spin_lock_init(&nic->rx_mode_wq_lock);
22392245
mutex_init(&nic->rx_mode_mtx);

drivers/net/ethernet/fujitsu/fmvj18x_cs.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -547,6 +547,11 @@ static int fmvj18x_get_hwinfo(struct pcmcia_device *link, u_char *node_id)
547547
return -1;
548548

549549
base = ioremap(link->resource[2]->start, resource_size(link->resource[2]));
550+
if (!base) {
551+
pcmcia_release_window(link, link->resource[2]);
552+
return -ENOMEM;
553+
}
554+
550555
pcmcia_map_mem_page(link, link->resource[2], 0);
551556

552557
/*

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

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2645,6 +2645,8 @@ int mlx4_cmd_use_events(struct mlx4_dev *dev)
26452645
if (!priv->cmd.context)
26462646
return -ENOMEM;
26472647

2648+
if (mlx4_is_mfunc(dev))
2649+
mutex_lock(&priv->cmd.slave_cmd_mutex);
26482650
down_write(&priv->cmd.switch_sem);
26492651
for (i = 0; i < priv->cmd.max_cmds; ++i) {
26502652
priv->cmd.context[i].token = i;
@@ -2670,6 +2672,8 @@ int mlx4_cmd_use_events(struct mlx4_dev *dev)
26702672
down(&priv->cmd.poll_sem);
26712673
priv->cmd.use_events = 1;
26722674
up_write(&priv->cmd.switch_sem);
2675+
if (mlx4_is_mfunc(dev))
2676+
mutex_unlock(&priv->cmd.slave_cmd_mutex);
26732677

26742678
return err;
26752679
}
@@ -2682,16 +2686,21 @@ void mlx4_cmd_use_polling(struct mlx4_dev *dev)
26822686
struct mlx4_priv *priv = mlx4_priv(dev);
26832687
int i;
26842688

2689+
if (mlx4_is_mfunc(dev))
2690+
mutex_lock(&priv->cmd.slave_cmd_mutex);
26852691
down_write(&priv->cmd.switch_sem);
26862692
priv->cmd.use_events = 0;
26872693

26882694
for (i = 0; i < priv->cmd.max_cmds; ++i)
26892695
down(&priv->cmd.event_sem);
26902696

26912697
kfree(priv->cmd.context);
2698+
priv->cmd.context = NULL;
26922699

26932700
up(&priv->cmd.poll_sem);
26942701
up_write(&priv->cmd.switch_sem);
2702+
if (mlx4_is_mfunc(dev))
2703+
mutex_unlock(&priv->cmd.slave_cmd_mutex);
26952704
}
26962705

26972706
struct mlx4_cmd_mailbox *mlx4_alloc_cmd_mailbox(struct mlx4_dev *dev)

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2719,13 +2719,13 @@ static int qp_get_mtt_size(struct mlx4_qp_context *qpc)
27192719
int total_pages;
27202720
int total_mem;
27212721
int page_offset = (be32_to_cpu(qpc->params2) >> 6) & 0x3f;
2722+
int tot;
27222723

27232724
sq_size = 1 << (log_sq_size + log_sq_sride + 4);
27242725
rq_size = (srq|rss|xrc) ? 0 : (1 << (log_rq_size + log_rq_stride + 4));
27252726
total_mem = sq_size + rq_size;
2726-
total_pages =
2727-
roundup_pow_of_two((total_mem + (page_offset << 6)) >>
2728-
page_shift);
2727+
tot = (total_mem + (page_offset << 6)) >> page_shift;
2728+
total_pages = !tot ? 1 : roundup_pow_of_two(tot);
27292729

27302730
return total_pages;
27312731
}

drivers/net/ethernet/mellanox/mlx5/core/en_ethtool.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -424,6 +424,9 @@ int mlx5e_ethtool_set_channels(struct mlx5e_priv *priv,
424424

425425
if (!test_bit(MLX5E_STATE_OPENED, &priv->state)) {
426426
priv->channels.params = new_channels.params;
427+
if (!netif_is_rxfh_configured(priv->netdev))
428+
mlx5e_build_default_indir_rqt(priv->rss_params.indirection_rqt,
429+
MLX5E_INDIR_RQT_SIZE, count);
427430
goto out;
428431
}
429432

drivers/net/ethernet/mellanox/mlx5/core/en_rep.c

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1129,16 +1129,17 @@ static int mlx5e_rep_get_phys_port_name(struct net_device *dev,
11291129
struct mlx5e_priv *priv = netdev_priv(dev);
11301130
struct mlx5e_rep_priv *rpriv = priv->ppriv;
11311131
struct mlx5_eswitch_rep *rep = rpriv->rep;
1132-
int ret, pf_num;
1132+
unsigned int fn;
1133+
int ret;
11331134

1134-
ret = mlx5_lag_get_pf_num(priv->mdev, &pf_num);
1135-
if (ret)
1136-
return ret;
1135+
fn = PCI_FUNC(priv->mdev->pdev->devfn);
1136+
if (fn >= MLX5_MAX_PORTS)
1137+
return -EOPNOTSUPP;
11371138

11381139
if (rep->vport == MLX5_VPORT_UPLINK)
1139-
ret = snprintf(buf, len, "p%d", pf_num);
1140+
ret = snprintf(buf, len, "p%d", fn);
11401141
else
1141-
ret = snprintf(buf, len, "pf%dvf%d", pf_num, rep->vport - 1);
1142+
ret = snprintf(buf, len, "pf%dvf%d", fn, rep->vport - 1);
11421143

11431144
if (ret >= len)
11441145
return -EOPNOTSUPP;

drivers/net/ethernet/mellanox/mlx5/core/en_rx.c

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1295,8 +1295,14 @@ static inline void mlx5i_complete_rx_cqe(struct mlx5e_rq *rq,
12951295

12961296
skb->protocol = *((__be16 *)(skb->data));
12971297

1298-
skb->ip_summed = CHECKSUM_COMPLETE;
1299-
skb->csum = csum_unfold((__force __sum16)cqe->check_sum);
1298+
if (netdev->features & NETIF_F_RXCSUM) {
1299+
skb->ip_summed = CHECKSUM_COMPLETE;
1300+
skb->csum = csum_unfold((__force __sum16)cqe->check_sum);
1301+
stats->csum_complete++;
1302+
} else {
1303+
skb->ip_summed = CHECKSUM_NONE;
1304+
stats->csum_none++;
1305+
}
13001306

13011307
if (unlikely(mlx5e_rx_hw_stamp(tstamp)))
13021308
skb_hwtstamps(skb)->hwtstamp =
@@ -1315,7 +1321,6 @@ static inline void mlx5i_complete_rx_cqe(struct mlx5e_rq *rq,
13151321

13161322
skb->dev = netdev;
13171323

1318-
stats->csum_complete++;
13191324
stats->packets++;
13201325
stats->bytes += cqe_bcnt;
13211326
}

drivers/net/ethernet/mellanox/mlx5/core/eswitch.c

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1931,7 +1931,7 @@ int mlx5_eswitch_set_vport_mac(struct mlx5_eswitch *esw,
19311931
u64 node_guid;
19321932
int err = 0;
19331933

1934-
if (!MLX5_CAP_GEN(esw->dev, vport_group_manager))
1934+
if (!esw || !MLX5_CAP_GEN(esw->dev, vport_group_manager))
19351935
return -EPERM;
19361936
if (!LEGAL_VPORT(esw, vport) || is_multicast_ether_addr(mac))
19371937
return -EINVAL;
@@ -2005,7 +2005,7 @@ int mlx5_eswitch_get_vport_config(struct mlx5_eswitch *esw,
20052005
{
20062006
struct mlx5_vport *evport;
20072007

2008-
if (!MLX5_CAP_GEN(esw->dev, vport_group_manager))
2008+
if (!esw || !MLX5_CAP_GEN(esw->dev, vport_group_manager))
20092009
return -EPERM;
20102010
if (!LEGAL_VPORT(esw, vport))
20112011
return -EINVAL;
@@ -2297,19 +2297,24 @@ static int normalize_vports_min_rate(struct mlx5_eswitch *esw, u32 divider)
22972297
int mlx5_eswitch_set_vport_rate(struct mlx5_eswitch *esw, int vport,
22982298
u32 max_rate, u32 min_rate)
22992299
{
2300-
u32 fw_max_bw_share = MLX5_CAP_QOS(esw->dev, max_tsar_bw_share);
2301-
bool min_rate_supported = MLX5_CAP_QOS(esw->dev, esw_bw_share) &&
2302-
fw_max_bw_share >= MLX5_MIN_BW_SHARE;
2303-
bool max_rate_supported = MLX5_CAP_QOS(esw->dev, esw_rate_limit);
23042300
struct mlx5_vport *evport;
2301+
u32 fw_max_bw_share;
23052302
u32 previous_min_rate;
23062303
u32 divider;
2304+
bool min_rate_supported;
2305+
bool max_rate_supported;
23072306
int err = 0;
23082307

23092308
if (!ESW_ALLOWED(esw))
23102309
return -EPERM;
23112310
if (!LEGAL_VPORT(esw, vport))
23122311
return -EINVAL;
2312+
2313+
fw_max_bw_share = MLX5_CAP_QOS(esw->dev, max_tsar_bw_share);
2314+
min_rate_supported = MLX5_CAP_QOS(esw->dev, esw_bw_share) &&
2315+
fw_max_bw_share >= MLX5_MIN_BW_SHARE;
2316+
max_rate_supported = MLX5_CAP_QOS(esw->dev, esw_rate_limit);
2317+
23132318
if ((min_rate && !min_rate_supported) || (max_rate && !max_rate_supported))
23142319
return -EOPNOTSUPP;
23152320

0 commit comments

Comments
 (0)