Skip to content

Commit 36024fc

Browse files
committed
Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net
Pull networking fixes from David Miller: 1) Don't corrupt xfrm_interface parms before validation, from Nicolas Dichtel. 2) Revert use of usb-wakeup in btusb, from Mario Limonciello. 3) Block ipv6 packets in bridge netfilter if ipv6 is disabled, from Leonardo Bras. 4) IPS_OFFLOAD not honored in ctnetlink, from Pablo Neira Ayuso. 5) Missing ULP check in sock_map, from John Fastabend. 6) Fix receive statistic handling in forcedeth, from Zhu Yanjun. 7) Fix length of SKB allocated in 6pack driver, from Christophe JAILLET. 8) ip6_route_info_create() returns an error pointer, not NULL. From Maciej Żenczykowski. 9) Only add RDS sock to the hashes after rs_transport is set, from Ka-Cheong Poon. 10) Don't double clean TX descriptors in ixgbe, from Ilya Maximets. 11) Presence of transmit IPSEC offload in an SKB is not tested for correctly in ixgbe and ixgbevf. From Steffen Klassert and Jeff Kirsher. 12) Need rcu_barrier() when register_netdevice() takes one of the notifier based failure paths, from Subash Abhinov Kasiviswanathan. 13) Fix leak in sctp_do_bind(), from Mao Wenan. * git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net: (72 commits) cdc_ether: fix rndis support for Mediatek based smartphones sctp: destroy bucket if failed to bind addr sctp: remove redundant assignment when call sctp_get_port_local sctp: change return type of sctp_get_port_local ixgbevf: Fix secpath usage for IPsec Tx offload sctp: Fix the link time qualifier of 'sctp_ctrlsock_exit()' ixgbe: Fix secpath usage for IPsec TX offload. net: qrtr: fix memort leak in qrtr_tun_write_iter net: Fix null de-reference of device refcount ipv6: Fix the link time qualifier of 'ping_v6_proc_exit_net()' tun: fix use-after-free when register netdev failed tcp: fix tcp_ecn_withdraw_cwr() to clear TCP_ECN_QUEUE_CWR ixgbe: fix double clean of Tx descriptors with xdp ixgbe: Prevent u8 wrapping of ITR value to something less than 10us mlx4: fix spelling mistake "veify" -> "verify" net: hns3: fix spelling mistake "undeflow" -> "underflow" net: lmc: fix spelling mistake "runnin" -> "running" NFC: st95hf: fix spelling mistake "receieve" -> "receive" net/rds: An rds_sock is added too early to the hash table mac80211: Do not send Layer 2 Update frame before authorization ...
2 parents 1c4c5e2 + 4d7ffcf commit 36024fc

File tree

67 files changed

+443
-289
lines changed

Some content is hidden

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

67 files changed

+443
-289
lines changed

MAINTAINERS

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17699,8 +17699,7 @@ F: include/uapi/linux/dqblk_xfs.h
1769917699
F: include/uapi/linux/fsmap.h
1770017700

1770117701
XILINX AXI ETHERNET DRIVER
17702-
M: Anirudha Sarangi <[email protected]>
17703-
M: John Linn <[email protected]>
17702+
M: Radhey Shyam Pandey <[email protected]>
1770417703
S: Maintained
1770517704
F: drivers/net/ethernet/xilinx/xilinx_axienet*
1770617705

drivers/bluetooth/bpa10x.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -337,7 +337,7 @@ static int bpa10x_send_frame(struct hci_dev *hdev, struct sk_buff *skb)
337337

338338
usb_free_urb(urb);
339339

340-
return 0;
340+
return err;
341341
}
342342

343343
static int bpa10x_set_diag(struct hci_dev *hdev, bool enable)

drivers/bluetooth/btusb.c

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -384,6 +384,9 @@ static const struct usb_device_id blacklist_table[] = {
384384
{ USB_DEVICE(0x13d3, 0x3526), .driver_info = BTUSB_REALTEK },
385385
{ USB_DEVICE(0x0b05, 0x185c), .driver_info = BTUSB_REALTEK },
386386

387+
/* Additional Realtek 8822CE Bluetooth devices */
388+
{ USB_DEVICE(0x04ca, 0x4005), .driver_info = BTUSB_REALTEK },
389+
387390
/* Silicon Wave based devices */
388391
{ USB_DEVICE(0x0c10, 0x0000), .driver_info = BTUSB_SWAVE },
389392

@@ -1170,10 +1173,6 @@ static int btusb_open(struct hci_dev *hdev)
11701173
}
11711174

11721175
data->intf->needs_remote_wakeup = 1;
1173-
/* device specific wakeup source enabled and required for USB
1174-
* remote wakeup while host is suspended
1175-
*/
1176-
device_wakeup_enable(&data->udev->dev);
11771176

11781177
if (test_and_set_bit(BTUSB_INTR_RUNNING, &data->flags))
11791178
goto done;
@@ -1238,7 +1237,6 @@ static int btusb_close(struct hci_dev *hdev)
12381237
goto failed;
12391238

12401239
data->intf->needs_remote_wakeup = 0;
1241-
device_wakeup_disable(&data->udev->dev);
12421240
usb_autopm_put_interface(data->intf);
12431241

12441242
failed:

drivers/bluetooth/hci_qca.c

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -309,13 +309,14 @@ static void qca_wq_awake_device(struct work_struct *work)
309309
ws_awake_device);
310310
struct hci_uart *hu = qca->hu;
311311
unsigned long retrans_delay;
312+
unsigned long flags;
312313

313314
BT_DBG("hu %p wq awake device", hu);
314315

315316
/* Vote for serial clock */
316317
serial_clock_vote(HCI_IBS_TX_VOTE_CLOCK_ON, hu);
317318

318-
spin_lock(&qca->hci_ibs_lock);
319+
spin_lock_irqsave(&qca->hci_ibs_lock, flags);
319320

320321
/* Send wake indication to device */
321322
if (send_hci_ibs_cmd(HCI_IBS_WAKE_IND, hu) < 0)
@@ -327,7 +328,7 @@ static void qca_wq_awake_device(struct work_struct *work)
327328
retrans_delay = msecs_to_jiffies(qca->wake_retrans);
328329
mod_timer(&qca->wake_retrans_timer, jiffies + retrans_delay);
329330

330-
spin_unlock(&qca->hci_ibs_lock);
331+
spin_unlock_irqrestore(&qca->hci_ibs_lock, flags);
331332

332333
/* Actually send the packets */
333334
hci_uart_tx_wakeup(hu);
@@ -338,12 +339,13 @@ static void qca_wq_awake_rx(struct work_struct *work)
338339
struct qca_data *qca = container_of(work, struct qca_data,
339340
ws_awake_rx);
340341
struct hci_uart *hu = qca->hu;
342+
unsigned long flags;
341343

342344
BT_DBG("hu %p wq awake rx", hu);
343345

344346
serial_clock_vote(HCI_IBS_RX_VOTE_CLOCK_ON, hu);
345347

346-
spin_lock(&qca->hci_ibs_lock);
348+
spin_lock_irqsave(&qca->hci_ibs_lock, flags);
347349
qca->rx_ibs_state = HCI_IBS_RX_AWAKE;
348350

349351
/* Always acknowledge device wake up,
@@ -354,7 +356,7 @@ static void qca_wq_awake_rx(struct work_struct *work)
354356

355357
qca->ibs_sent_wacks++;
356358

357-
spin_unlock(&qca->hci_ibs_lock);
359+
spin_unlock_irqrestore(&qca->hci_ibs_lock, flags);
358360

359361
/* Actually send the packets */
360362
hci_uart_tx_wakeup(hu);

drivers/isdn/capi/capi.c

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -688,6 +688,9 @@ capi_write(struct file *file, const char __user *buf, size_t count, loff_t *ppos
688688
if (!cdev->ap.applid)
689689
return -ENODEV;
690690

691+
if (count < CAPIMSG_BASELEN)
692+
return -EINVAL;
693+
691694
skb = alloc_skb(count, GFP_USER);
692695
if (!skb)
693696
return -ENOMEM;
@@ -698,7 +701,8 @@ capi_write(struct file *file, const char __user *buf, size_t count, loff_t *ppos
698701
}
699702
mlen = CAPIMSG_LEN(skb->data);
700703
if (CAPIMSG_CMD(skb->data) == CAPI_DATA_B3_REQ) {
701-
if ((size_t)(mlen + CAPIMSG_DATALEN(skb->data)) != count) {
704+
if (count < CAPI_DATA_B3_REQ_LEN ||
705+
(size_t)(mlen + CAPIMSG_DATALEN(skb->data)) != count) {
702706
kfree_skb(skb);
703707
return -EINVAL;
704708
}
@@ -711,6 +715,10 @@ capi_write(struct file *file, const char __user *buf, size_t count, loff_t *ppos
711715
CAPIMSG_SETAPPID(skb->data, cdev->ap.applid);
712716

713717
if (CAPIMSG_CMD(skb->data) == CAPI_DISCONNECT_B3_RESP) {
718+
if (count < CAPI_DISCONNECT_B3_RESP_LEN) {
719+
kfree_skb(skb);
720+
return -EINVAL;
721+
}
714722
mutex_lock(&cdev->lock);
715723
capincci_free(cdev, CAPIMSG_NCCI(skb->data));
716724
mutex_unlock(&cdev->lock);

drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_err.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ static const struct hclge_hw_error hclge_igu_egu_tnl_int[] = {
9898
.reset_level = HNAE3_GLOBAL_RESET },
9999
{ .int_msk = BIT(1), .msg = "rx_stp_fifo_overflow",
100100
.reset_level = HNAE3_GLOBAL_RESET },
101-
{ .int_msk = BIT(2), .msg = "rx_stp_fifo_undeflow",
101+
{ .int_msk = BIT(2), .msg = "rx_stp_fifo_underflow",
102102
.reset_level = HNAE3_GLOBAL_RESET },
103103
{ .int_msk = BIT(3), .msg = "tx_buf_overflow",
104104
.reset_level = HNAE3_GLOBAL_RESET },

drivers/net/ethernet/ibm/ibmvnic.c

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1984,8 +1984,11 @@ static void __ibmvnic_reset(struct work_struct *work)
19841984
rwi = get_next_rwi(adapter);
19851985
while (rwi) {
19861986
if (adapter->state == VNIC_REMOVING ||
1987-
adapter->state == VNIC_REMOVED)
1988-
goto out;
1987+
adapter->state == VNIC_REMOVED) {
1988+
kfree(rwi);
1989+
rc = EBUSY;
1990+
break;
1991+
}
19891992

19901993
if (adapter->force_reset_recovery) {
19911994
adapter->force_reset_recovery = false;
@@ -2011,7 +2014,7 @@ static void __ibmvnic_reset(struct work_struct *work)
20112014
netdev_dbg(adapter->netdev, "Reset failed\n");
20122015
free_all_rwi(adapter);
20132016
}
2014-
out:
2017+
20152018
adapter->resetting = false;
20162019
if (we_lock_rtnl)
20172020
rtnl_unlock();

drivers/net/ethernet/intel/ixgbe/ixgbe_main.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@
3636
#include <net/vxlan.h>
3737
#include <net/mpls.h>
3838
#include <net/xdp_sock.h>
39+
#include <net/xfrm.h>
3940

4041
#include "ixgbe.h"
4142
#include "ixgbe_common.h"
@@ -2621,7 +2622,7 @@ static void ixgbe_update_itr(struct ixgbe_q_vector *q_vector,
26212622
/* 16K ints/sec to 9.2K ints/sec */
26222623
avg_wire_size *= 15;
26232624
avg_wire_size += 11452;
2624-
} else if (avg_wire_size <= 1980) {
2625+
} else if (avg_wire_size < 1968) {
26252626
/* 9.2K ints/sec to 8K ints/sec */
26262627
avg_wire_size *= 5;
26272628
avg_wire_size += 22420;
@@ -2654,6 +2655,8 @@ static void ixgbe_update_itr(struct ixgbe_q_vector *q_vector,
26542655
case IXGBE_LINK_SPEED_2_5GB_FULL:
26552656
case IXGBE_LINK_SPEED_1GB_FULL:
26562657
case IXGBE_LINK_SPEED_10_FULL:
2658+
if (avg_wire_size > 8064)
2659+
avg_wire_size = 8064;
26572660
itr += DIV_ROUND_UP(avg_wire_size,
26582661
IXGBE_ITR_ADAPTIVE_MIN_INC * 64) *
26592662
IXGBE_ITR_ADAPTIVE_MIN_INC;
@@ -8695,7 +8698,7 @@ netdev_tx_t ixgbe_xmit_frame_ring(struct sk_buff *skb,
86958698
#endif /* IXGBE_FCOE */
86968699

86978700
#ifdef CONFIG_IXGBE_IPSEC
8698-
if (secpath_exists(skb) &&
8701+
if (xfrm_offload(skb) &&
86998702
!ixgbe_ipsec_tx(tx_ring, first, &ipsec_tx))
87008703
goto out_drop;
87018704
#endif

drivers/net/ethernet/intel/ixgbe/ixgbe_xsk.c

Lines changed: 11 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -633,19 +633,17 @@ static void ixgbe_clean_xdp_tx_buffer(struct ixgbe_ring *tx_ring,
633633
bool ixgbe_clean_xdp_tx_irq(struct ixgbe_q_vector *q_vector,
634634
struct ixgbe_ring *tx_ring, int napi_budget)
635635
{
636+
u16 ntc = tx_ring->next_to_clean, ntu = tx_ring->next_to_use;
636637
unsigned int total_packets = 0, total_bytes = 0;
637-
u32 i = tx_ring->next_to_clean, xsk_frames = 0;
638-
unsigned int budget = q_vector->tx.work_limit;
639638
struct xdp_umem *umem = tx_ring->xsk_umem;
640639
union ixgbe_adv_tx_desc *tx_desc;
641640
struct ixgbe_tx_buffer *tx_bi;
642-
bool xmit_done;
641+
u32 xsk_frames = 0;
643642

644-
tx_bi = &tx_ring->tx_buffer_info[i];
645-
tx_desc = IXGBE_TX_DESC(tx_ring, i);
646-
i -= tx_ring->count;
643+
tx_bi = &tx_ring->tx_buffer_info[ntc];
644+
tx_desc = IXGBE_TX_DESC(tx_ring, ntc);
647645

648-
do {
646+
while (ntc != ntu) {
649647
if (!(tx_desc->wb.status & cpu_to_le32(IXGBE_TXD_STAT_DD)))
650648
break;
651649

@@ -661,22 +659,18 @@ bool ixgbe_clean_xdp_tx_irq(struct ixgbe_q_vector *q_vector,
661659

662660
tx_bi++;
663661
tx_desc++;
664-
i++;
665-
if (unlikely(!i)) {
666-
i -= tx_ring->count;
662+
ntc++;
663+
if (unlikely(ntc == tx_ring->count)) {
664+
ntc = 0;
667665
tx_bi = tx_ring->tx_buffer_info;
668666
tx_desc = IXGBE_TX_DESC(tx_ring, 0);
669667
}
670668

671669
/* issue prefetch for next Tx descriptor */
672670
prefetch(tx_desc);
671+
}
673672

674-
/* update budget accounting */
675-
budget--;
676-
} while (likely(budget));
677-
678-
i += tx_ring->count;
679-
tx_ring->next_to_clean = i;
673+
tx_ring->next_to_clean = ntc;
680674

681675
u64_stats_update_begin(&tx_ring->syncp);
682676
tx_ring->stats.bytes += total_bytes;
@@ -688,8 +682,7 @@ bool ixgbe_clean_xdp_tx_irq(struct ixgbe_q_vector *q_vector,
688682
if (xsk_frames)
689683
xsk_umem_complete_tx(umem, xsk_frames);
690684

691-
xmit_done = ixgbe_xmit_zc(tx_ring, q_vector->tx.work_limit);
692-
return budget > 0 && xmit_done;
685+
return ixgbe_xmit_zc(tx_ring, q_vector->tx.work_limit);
693686
}
694687

695688
int ixgbe_xsk_async_xmit(struct net_device *dev, u32 qid)

drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
#include <linux/bpf.h>
3131
#include <linux/bpf_trace.h>
3232
#include <linux/atomic.h>
33+
#include <net/xfrm.h>
3334

3435
#include "ixgbevf.h"
3536

@@ -4161,7 +4162,7 @@ static int ixgbevf_xmit_frame_ring(struct sk_buff *skb,
41614162
first->protocol = vlan_get_protocol(skb);
41624163

41634164
#ifdef CONFIG_IXGBEVF_IPSEC
4164-
if (secpath_exists(skb) && !ixgbevf_ipsec_tx(tx_ring, first, &ipsec_tx))
4165+
if (xfrm_offload(skb) && !ixgbevf_ipsec_tx(tx_ring, first, &ipsec_tx))
41654166
goto out_drop;
41664167
#endif
41674168
tso = ixgbevf_tso(tx_ring, first, &hdr_len, &ipsec_tx);

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2240,7 +2240,7 @@ static int mlx4_validate_optimized_steering(struct mlx4_dev *dev)
22402240
for (i = 1; i <= dev->caps.num_ports; i++) {
22412241
if (mlx4_dev_port(dev, i, &port_cap)) {
22422242
mlx4_err(dev,
2243-
"QUERY_DEV_CAP command failed, can't veify DMFS high rate steering.\n");
2243+
"QUERY_DEV_CAP command failed, can't verify DMFS high rate steering.\n");
22442244
} else if ((dev->caps.dmfs_high_steer_mode !=
22452245
MLX4_STEERING_DMFS_A0_DEFAULT) &&
22462246
(port_cap.dmfs_optimized_state ==

drivers/net/ethernet/natsemi/sonic.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -232,9 +232,9 @@ static int sonic_send_packet(struct sk_buff *skb, struct net_device *dev)
232232

233233
laddr = dma_map_single(lp->device, skb->data, length, DMA_TO_DEVICE);
234234
if (!laddr) {
235-
printk(KERN_ERR "%s: failed to map tx DMA buffer.\n", dev->name);
236-
dev_kfree_skb(skb);
237-
return NETDEV_TX_BUSY;
235+
pr_err_ratelimited("%s: failed to map tx DMA buffer.\n", dev->name);
236+
dev_kfree_skb_any(skb);
237+
return NETDEV_TX_OK;
238238
}
239239

240240
sonic_tda_put(dev, entry, SONIC_TD_STATUS, 0); /* clear status */

drivers/net/ethernet/netronome/nfp/flower/cmsg.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -260,9 +260,6 @@ nfp_flower_cmsg_process_one_rx(struct nfp_app *app, struct sk_buff *skb)
260260

261261
type = cmsg_hdr->type;
262262
switch (type) {
263-
case NFP_FLOWER_CMSG_TYPE_PORT_REIFY:
264-
nfp_flower_cmsg_portreify_rx(app, skb);
265-
break;
266263
case NFP_FLOWER_CMSG_TYPE_PORT_MOD:
267264
nfp_flower_cmsg_portmod_rx(app, skb);
268265
break;
@@ -328,8 +325,7 @@ nfp_flower_queue_ctl_msg(struct nfp_app *app, struct sk_buff *skb, int type)
328325
struct nfp_flower_priv *priv = app->priv;
329326
struct sk_buff_head *skb_head;
330327

331-
if (type == NFP_FLOWER_CMSG_TYPE_PORT_REIFY ||
332-
type == NFP_FLOWER_CMSG_TYPE_PORT_MOD)
328+
if (type == NFP_FLOWER_CMSG_TYPE_PORT_MOD)
333329
skb_head = &priv->cmsg_skbs_high;
334330
else
335331
skb_head = &priv->cmsg_skbs_low;
@@ -368,6 +364,10 @@ void nfp_flower_cmsg_rx(struct nfp_app *app, struct sk_buff *skb)
368364
} else if (cmsg_hdr->type == NFP_FLOWER_CMSG_TYPE_TUN_NEIGH) {
369365
/* Acks from the NFP that the route is added - ignore. */
370366
dev_consume_skb_any(skb);
367+
} else if (cmsg_hdr->type == NFP_FLOWER_CMSG_TYPE_PORT_REIFY) {
368+
/* Handle REIFY acks outside wq to prevent RTNL conflict. */
369+
nfp_flower_cmsg_portreify_rx(app, skb);
370+
dev_consume_skb_any(skb);
371371
} else {
372372
nfp_flower_queue_ctl_msg(app, skb, cmsg_hdr->type);
373373
}

0 commit comments

Comments
 (0)