Skip to content

Commit 03250e1

Browse files
committed
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
Pull networking fixes from David Miller: "Let's begin the holiday weekend with some networking fixes: 1) Whoops need to restrict cfg80211 wiphy names even more to 64 bytes. From Eric Biggers. 2) Fix flags being ignored when using kernel_connect() with SCTP, from Xin Long. 3) Use after free in DCCP, from Alexey Kodanev. 4) Need to check rhltable_init() return value in ipmr code, from Eric Dumazet. 5) XDP handling fixes in virtio_net from Jason Wang. 6) Missing RTA_TABLE in rtm_ipv4_policy[], from Roopa Prabhu. 7) Need to use IRQ disabling spinlocks in mlx4_qp_lookup(), from Jack Morgenstein. 8) Prevent out-of-bounds speculation using indexes in BPF, from Daniel Borkmann. 9) Fix regression added by AF_PACKET link layer cure, from Willem de Bruijn. 10) Correct ENIC dma mask, from Govindarajulu Varadarajan. 11) Missing config options for PMTU tests, from Stefano Brivio" * git://git.kernel.org/pub/scm/linux/kernel/git/davem/net: (48 commits) ibmvnic: Fix partial success login retries selftests/net: Add missing config options for PMTU tests mlx4_core: allocate ICM memory in page size chunks enic: set DMA mask to 47 bit ppp: remove the PPPIOCDETACH ioctl ipv4: remove warning in ip_recv_error net : sched: cls_api: deal with egdev path only if needed vhost: synchronize IOTLB message with dev cleanup packet: fix reserve calculation net/mlx5: IPSec, Fix a race between concurrent sandbox QP commands net/mlx5e: When RXFCS is set, add FCS data into checksum calculation bpf: properly enforce index mask to prevent out-of-bounds speculation net/mlx4: Fix irq-unsafe spinlock usage net: phy: broadcom: Fix bcm_write_exp() net: phy: broadcom: Fix auxiliary control register reads net: ipv4: add missing RTA_TABLE to rtm_ipv4_policy net/mlx4: fix spelling mistake: "Inrerface" -> "Interface" and rephrase message ibmvnic: Only do H_EOI for mobility events tuntap: correctly set SOCKWQ_ASYNC_NOSPACE virtio-net: fix leaking page for gso packet during mergeable XDP ...
2 parents 62d18ec + eb11041 commit 03250e1

File tree

49 files changed

+372
-193
lines changed

Some content is hidden

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

49 files changed

+372
-193
lines changed

Documentation/networking/ppp_generic.txt

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -300,12 +300,6 @@ unattached instance are:
300300
The ioctl calls available on an instance of /dev/ppp attached to a
301301
channel are:
302302

303-
* PPPIOCDETACH detaches the instance from the channel. This ioctl is
304-
deprecated since the same effect can be achieved by closing the
305-
instance. In order to prevent possible races this ioctl will fail
306-
with an EINVAL error if more than one file descriptor refers to this
307-
instance (i.e. as a result of dup(), dup2() or fork()).
308-
309303
* PPPIOCCONNECT connects this channel to a PPP interface. The
310304
argument should point to an int containing the interface unit
311305
number. It will return an EINVAL error if the channel is already

MAINTAINERS

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2332,7 +2332,7 @@ F: drivers/gpio/gpio-ath79.c
23322332
F: Documentation/devicetree/bindings/gpio/gpio-ath79.txt
23332333

23342334
ATHEROS ATH GENERIC UTILITIES
2335-
M: "Luis R. Rodriguez" <mcgrof@do-not-panic.com>
2335+
M: Kalle Valo <kvalo@codeaurora.org>
23362336
L: linux-wireless@vger.kernel.org
23372337
S: Supported
23382338
F: drivers/net/wireless/ath/*
@@ -2347,7 +2347,7 @@ S: Maintained
23472347
F: drivers/net/wireless/ath/ath5k/
23482348

23492349
ATHEROS ATH6KL WIRELESS DRIVER
2350-
M: Kalle Valo <kvalo@qca.qualcomm.com>
2350+
M: Kalle Valo <kvalo@codeaurora.org>
23512351
L: linux-wireless@vger.kernel.org
23522352
W: http://wireless.kernel.org/en/users/Drivers/ath6kl
23532353
T: git git://git.kernel.org/pub/scm/linux/kernel/git/kvalo/ath.git
@@ -11626,7 +11626,7 @@ S: Maintained
1162611626
F: drivers/media/tuners/qt1010*
1162711627

1162811628
QUALCOMM ATHEROS ATH10K WIRELESS DRIVER
11629-
M: Kalle Valo <kvalo@qca.qualcomm.com>
11629+
M: Kalle Valo <kvalo@codeaurora.org>
1163011630
L: ath10k@lists.infradead.org
1163111631
W: http://wireless.kernel.org/en/users/Drivers/ath10k
1163211632
T: git git://git.kernel.org/pub/scm/linux/kernel/git/kvalo/ath.git
@@ -11677,7 +11677,7 @@ S: Maintained
1167711677
F: drivers/media/platform/qcom/venus/
1167811678

1167911679
QUALCOMM WCN36XX WIRELESS DRIVER
11680-
M: Eugene Krasnikov <k.eugene.e@gmail.com>
11680+
M: Kalle Valo <kvalo@codeaurora.org>
1168111681
L: wcn36xx@lists.infradead.org
1168211682
W: http://wireless.kernel.org/en/users/Drivers/wcn36xx
1168311683
T: git git://github.com/KrasnikovEugene/wcn36xx.git

drivers/bcma/driver_mips.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@ static void bcma_core_mips_print_irq(struct bcma_device *dev, unsigned int irq)
184184
{
185185
int i;
186186
static const char *irq_name[] = {"2(S)", "3", "4", "5", "6", "D", "I"};
187-
char interrupts[20];
187+
char interrupts[25];
188188
char *ints = interrupts;
189189

190190
for (i = 0; i < ARRAY_SIZE(irq_name); i++)

drivers/isdn/hardware/eicon/diva.c

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -388,10 +388,10 @@ void divasa_xdi_driver_unload(void)
388388
** Receive and process command from user mode utility
389389
*/
390390
void *diva_xdi_open_adapter(void *os_handle, const void __user *src,
391-
int length,
391+
int length, void *mptr,
392392
divas_xdi_copy_from_user_fn_t cp_fn)
393393
{
394-
diva_xdi_um_cfg_cmd_t msg;
394+
diva_xdi_um_cfg_cmd_t *msg = (diva_xdi_um_cfg_cmd_t *)mptr;
395395
diva_os_xdi_adapter_t *a = NULL;
396396
diva_os_spin_lock_magic_t old_irql;
397397
struct list_head *tmp;
@@ -401,21 +401,21 @@ void *diva_xdi_open_adapter(void *os_handle, const void __user *src,
401401
length, sizeof(diva_xdi_um_cfg_cmd_t)))
402402
return NULL;
403403
}
404-
if ((*cp_fn) (os_handle, &msg, src, sizeof(msg)) <= 0) {
404+
if ((*cp_fn) (os_handle, msg, src, sizeof(*msg)) <= 0) {
405405
DBG_ERR(("A: A(?) open, write error"))
406406
return NULL;
407407
}
408408
diva_os_enter_spin_lock(&adapter_lock, &old_irql, "open_adapter");
409409
list_for_each(tmp, &adapter_queue) {
410410
a = list_entry(tmp, diva_os_xdi_adapter_t, link);
411-
if (a->controller == (int)msg.adapter)
411+
if (a->controller == (int)msg->adapter)
412412
break;
413413
a = NULL;
414414
}
415415
diva_os_leave_spin_lock(&adapter_lock, &old_irql, "open_adapter");
416416

417417
if (!a) {
418-
DBG_ERR(("A: A(%d) open, adapter not found", msg.adapter))
418+
DBG_ERR(("A: A(%d) open, adapter not found", msg->adapter))
419419
}
420420

421421
return (a);
@@ -437,8 +437,10 @@ void diva_xdi_close_adapter(void *adapter, void *os_handle)
437437

438438
int
439439
diva_xdi_write(void *adapter, void *os_handle, const void __user *src,
440-
int length, divas_xdi_copy_from_user_fn_t cp_fn)
440+
int length, void *mptr,
441+
divas_xdi_copy_from_user_fn_t cp_fn)
441442
{
443+
diva_xdi_um_cfg_cmd_t *msg = (diva_xdi_um_cfg_cmd_t *)mptr;
442444
diva_os_xdi_adapter_t *a = (diva_os_xdi_adapter_t *) adapter;
443445
void *data;
444446

@@ -459,7 +461,13 @@ diva_xdi_write(void *adapter, void *os_handle, const void __user *src,
459461
return (-2);
460462
}
461463

462-
length = (*cp_fn) (os_handle, data, src, length);
464+
if (msg) {
465+
*(diva_xdi_um_cfg_cmd_t *)data = *msg;
466+
length = (*cp_fn) (os_handle, (char *)data + sizeof(*msg),
467+
src + sizeof(*msg), length - sizeof(*msg));
468+
} else {
469+
length = (*cp_fn) (os_handle, data, src, length);
470+
}
463471
if (length > 0) {
464472
if ((*(a->interface.cmd_proc))
465473
(a, (diva_xdi_um_cfg_cmd_t *) data, length)) {

drivers/isdn/hardware/eicon/diva.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,11 @@ int diva_xdi_read(void *adapter, void *os_handle, void __user *dst,
2020
int max_length, divas_xdi_copy_to_user_fn_t cp_fn);
2121

2222
int diva_xdi_write(void *adapter, void *os_handle, const void __user *src,
23-
int length, divas_xdi_copy_from_user_fn_t cp_fn);
23+
int length, void *msg,
24+
divas_xdi_copy_from_user_fn_t cp_fn);
2425

2526
void *diva_xdi_open_adapter(void *os_handle, const void __user *src,
26-
int length,
27+
int length, void *msg,
2728
divas_xdi_copy_from_user_fn_t cp_fn);
2829

2930
void diva_xdi_close_adapter(void *adapter, void *os_handle);

drivers/isdn/hardware/eicon/divasmain.c

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -591,19 +591,22 @@ static int divas_release(struct inode *inode, struct file *file)
591591
static ssize_t divas_write(struct file *file, const char __user *buf,
592592
size_t count, loff_t *ppos)
593593
{
594+
diva_xdi_um_cfg_cmd_t msg;
594595
int ret = -EINVAL;
595596

596597
if (!file->private_data) {
597598
file->private_data = diva_xdi_open_adapter(file, buf,
598-
count,
599+
count, &msg,
599600
xdi_copy_from_user);
600-
}
601-
if (!file->private_data) {
602-
return (-ENODEV);
601+
if (!file->private_data)
602+
return (-ENODEV);
603+
ret = diva_xdi_write(file->private_data, file,
604+
buf, count, &msg, xdi_copy_from_user);
605+
} else {
606+
ret = diva_xdi_write(file->private_data, file,
607+
buf, count, NULL, xdi_copy_from_user);
603608
}
604609

605-
ret = diva_xdi_write(file->private_data, file,
606-
buf, count, xdi_copy_from_user);
607610
switch (ret) {
608611
case -1: /* Message should be removed from rx mailbox first */
609612
ret = -EBUSY;
@@ -622,11 +625,12 @@ static ssize_t divas_write(struct file *file, const char __user *buf,
622625
static ssize_t divas_read(struct file *file, char __user *buf,
623626
size_t count, loff_t *ppos)
624627
{
628+
diva_xdi_um_cfg_cmd_t msg;
625629
int ret = -EINVAL;
626630

627631
if (!file->private_data) {
628632
file->private_data = diva_xdi_open_adapter(file, buf,
629-
count,
633+
count, &msg,
630634
xdi_copy_from_user);
631635
}
632636
if (!file->private_data) {

drivers/net/ethernet/amd/pcnet32.c

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1552,22 +1552,26 @@ pcnet32_probe_pci(struct pci_dev *pdev, const struct pci_device_id *ent)
15521552
if (!ioaddr) {
15531553
if (pcnet32_debug & NETIF_MSG_PROBE)
15541554
pr_err("card has no PCI IO resources, aborting\n");
1555-
return -ENODEV;
1555+
err = -ENODEV;
1556+
goto err_disable_dev;
15561557
}
15571558

15581559
err = pci_set_dma_mask(pdev, PCNET32_DMA_MASK);
15591560
if (err) {
15601561
if (pcnet32_debug & NETIF_MSG_PROBE)
15611562
pr_err("architecture does not support 32bit PCI busmaster DMA\n");
1562-
return err;
1563+
goto err_disable_dev;
15631564
}
15641565
if (!request_region(ioaddr, PCNET32_TOTAL_SIZE, "pcnet32_probe_pci")) {
15651566
if (pcnet32_debug & NETIF_MSG_PROBE)
15661567
pr_err("io address range already allocated\n");
1567-
return -EBUSY;
1568+
err = -EBUSY;
1569+
goto err_disable_dev;
15681570
}
15691571

15701572
err = pcnet32_probe1(ioaddr, 1, pdev);
1573+
1574+
err_disable_dev:
15711575
if (err < 0)
15721576
pci_disable_device(pdev);
15731577

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2747,11 +2747,11 @@ static int enic_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
27472747
pci_set_master(pdev);
27482748

27492749
/* Query PCI controller on system for DMA addressing
2750-
* limitation for the device. Try 64-bit first, and
2750+
* limitation for the device. Try 47-bit first, and
27512751
* fail to 32-bit.
27522752
*/
27532753

2754-
err = pci_set_dma_mask(pdev, DMA_BIT_MASK(64));
2754+
err = pci_set_dma_mask(pdev, DMA_BIT_MASK(47));
27552755
if (err) {
27562756
err = pci_set_dma_mask(pdev, DMA_BIT_MASK(32));
27572757
if (err) {
@@ -2765,10 +2765,10 @@ static int enic_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
27652765
goto err_out_release_regions;
27662766
}
27672767
} else {
2768-
err = pci_set_consistent_dma_mask(pdev, DMA_BIT_MASK(64));
2768+
err = pci_set_consistent_dma_mask(pdev, DMA_BIT_MASK(47));
27692769
if (err) {
27702770
dev_err(dev, "Unable to obtain %u-bit DMA "
2771-
"for consistent allocations, aborting\n", 64);
2771+
"for consistent allocations, aborting\n", 47);
27722772
goto err_out_release_regions;
27732773
}
27742774
using_dac = 1;

drivers/net/ethernet/freescale/fec_main.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
// SPDX-License-Identifier: GPL-2.0+
12
/*
23
* Fast Ethernet Controller (FEC) driver for Motorola MPC8xx.
34
* Copyright (c) 1997 Dan Malek (dmalek@jlc.net)

drivers/net/ethernet/freescale/fec_ptp.c

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,8 @@
1+
// SPDX-License-Identifier: GPL-2.0
12
/*
23
* Fast Ethernet Controller (ENET) PTP driver for MX6x.
34
*
45
* Copyright (C) 2012 Freescale Semiconductor, Inc.
5-
*
6-
* This program is free software; you can redistribute it and/or modify it
7-
* under the terms and conditions of the GNU General Public License,
8-
* version 2, as published by the Free Software Foundation.
9-
*
10-
* This program is distributed in the hope it will be useful, but WITHOUT
11-
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
12-
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
13-
* more details.
14-
*
15-
* You should have received a copy of the GNU General Public License along with
16-
* this program; if not, write to the Free Software Foundation, Inc.,
17-
* 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
186
*/
197

208
#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt

drivers/net/ethernet/ibm/ibmvnic.c

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -796,9 +796,11 @@ static int ibmvnic_login(struct net_device *netdev)
796796
struct ibmvnic_adapter *adapter = netdev_priv(netdev);
797797
unsigned long timeout = msecs_to_jiffies(30000);
798798
int retry_count = 0;
799+
bool retry;
799800
int rc;
800801

801802
do {
803+
retry = false;
802804
if (retry_count > IBMVNIC_MAX_QUEUES) {
803805
netdev_warn(netdev, "Login attempts exceeded\n");
804806
return -1;
@@ -822,6 +824,9 @@ static int ibmvnic_login(struct net_device *netdev)
822824
retry_count++;
823825
release_sub_crqs(adapter, 1);
824826

827+
retry = true;
828+
netdev_dbg(netdev,
829+
"Received partial success, retrying...\n");
825830
adapter->init_done_rc = 0;
826831
reinit_completion(&adapter->init_done);
827832
send_cap_queries(adapter);
@@ -849,7 +854,7 @@ static int ibmvnic_login(struct net_device *netdev)
849854
netdev_warn(netdev, "Adapter login failed\n");
850855
return -1;
851856
}
852-
} while (adapter->init_done_rc == PARTIALSUCCESS);
857+
} while (retry);
853858

854859
/* handle pending MAC address changes after successful login */
855860
if (adapter->mac_change_pending) {
@@ -2617,18 +2622,21 @@ static int enable_scrq_irq(struct ibmvnic_adapter *adapter,
26172622
{
26182623
struct device *dev = &adapter->vdev->dev;
26192624
unsigned long rc;
2620-
u64 val;
26212625

26222626
if (scrq->hw_irq > 0x100000000ULL) {
26232627
dev_err(dev, "bad hw_irq = %lx\n", scrq->hw_irq);
26242628
return 1;
26252629
}
26262630

2627-
val = (0xff000000) | scrq->hw_irq;
2628-
rc = plpar_hcall_norets(H_EOI, val);
2629-
if (rc)
2630-
dev_err(dev, "H_EOI FAILED irq 0x%llx. rc=%ld\n",
2631-
val, rc);
2631+
if (adapter->resetting &&
2632+
adapter->reset_reason == VNIC_RESET_MOBILITY) {
2633+
u64 val = (0xff000000) | scrq->hw_irq;
2634+
2635+
rc = plpar_hcall_norets(H_EOI, val);
2636+
if (rc)
2637+
dev_err(dev, "H_EOI FAILED irq 0x%llx. rc=%ld\n",
2638+
val, rc);
2639+
}
26322640

26332641
rc = plpar_hcall_norets(H_VIOCTL, adapter->vdev->unit_address,
26342642
H_ENABLE_VIO_INTERRUPT, scrq->hw_irq, 0, 0);

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

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -43,12 +43,12 @@
4343
#include "fw.h"
4444

4545
/*
46-
* We allocate in as big chunks as we can, up to a maximum of 256 KB
47-
* per chunk.
46+
* We allocate in page size (default 4KB on many archs) chunks to avoid high
47+
* order memory allocations in fragmented/high usage memory situation.
4848
*/
4949
enum {
50-
MLX4_ICM_ALLOC_SIZE = 1 << 18,
51-
MLX4_TABLE_CHUNK_SIZE = 1 << 18
50+
MLX4_ICM_ALLOC_SIZE = PAGE_SIZE,
51+
MLX4_TABLE_CHUNK_SIZE = PAGE_SIZE,
5252
};
5353

5454
static void mlx4_free_icm_pages(struct mlx4_dev *dev, struct mlx4_icm_chunk *chunk)
@@ -398,9 +398,11 @@ int mlx4_init_icm_table(struct mlx4_dev *dev, struct mlx4_icm_table *table,
398398
u64 size;
399399

400400
obj_per_chunk = MLX4_TABLE_CHUNK_SIZE / obj_size;
401+
if (WARN_ON(!obj_per_chunk))
402+
return -EINVAL;
401403
num_icm = (nobj + obj_per_chunk - 1) / obj_per_chunk;
402404

403-
table->icm = kcalloc(num_icm, sizeof(*table->icm), GFP_KERNEL);
405+
table->icm = kvzalloc(num_icm * sizeof(*table->icm), GFP_KERNEL);
404406
if (!table->icm)
405407
return -ENOMEM;
406408
table->virt = virt;
@@ -446,7 +448,7 @@ int mlx4_init_icm_table(struct mlx4_dev *dev, struct mlx4_icm_table *table,
446448
mlx4_free_icm(dev, table->icm[i], use_coherent);
447449
}
448450

449-
kfree(table->icm);
451+
kvfree(table->icm);
450452

451453
return -ENOMEM;
452454
}
@@ -462,5 +464,5 @@ void mlx4_cleanup_icm_table(struct mlx4_dev *dev, struct mlx4_icm_table *table)
462464
mlx4_free_icm(dev, table->icm[i], table->coherent);
463465
}
464466

465-
kfree(table->icm);
467+
kvfree(table->icm);
466468
}

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ int mlx4_do_bond(struct mlx4_dev *dev, bool enable)
172172
list_add_tail(&dev_ctx->list, &priv->ctx_list);
173173
spin_unlock_irqrestore(&priv->ctx_lock, flags);
174174

175-
mlx4_dbg(dev, "Inrerface for protocol %d restarted with when bonded mode is %s\n",
175+
mlx4_dbg(dev, "Interface for protocol %d restarted with bonded mode %s\n",
176176
dev_ctx->intf->protocol, enable ?
177177
"enabled" : "disabled");
178178
}

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -393,11 +393,11 @@ struct mlx4_qp *mlx4_qp_lookup(struct mlx4_dev *dev, u32 qpn)
393393
struct mlx4_qp_table *qp_table = &mlx4_priv(dev)->qp_table;
394394
struct mlx4_qp *qp;
395395

396-
spin_lock(&qp_table->lock);
396+
spin_lock_irq(&qp_table->lock);
397397

398398
qp = __mlx4_qp_lookup(dev, qpn);
399399

400-
spin_unlock(&qp_table->lock);
400+
spin_unlock_irq(&qp_table->lock);
401401
return qp;
402402
}
403403

0 commit comments

Comments
 (0)