Skip to content

Commit

Permalink
Merge tag 'net-5.16-rc2' of git://git.kernel.org/pub/scm/linux/kernel…
Browse files Browse the repository at this point in the history
…/git/netdev/net

Pull networking fixes from Jakub Kicinski:
 "Including fixes from bpf, mac80211.

  Current release - regressions:

   - devlink: don't throw an error if flash notification sent before
     devlink visible

   - page_pool: Revert "page_pool: disable dma mapping support...",
     turns out there are active arches who need it

  Current release - new code bugs:

   - amt: cancel delayed_work synchronously in amt_fini()

  Previous releases - regressions:

   - xsk: fix crash on double free in buffer pool

   - bpf: fix inner map state pruning regression causing program
     rejections

   - mac80211: drop check for DONT_REORDER in __ieee80211_select_queue,
     preventing mis-selecting the best effort queue

   - mac80211: do not access the IV when it was stripped

   - mac80211: fix radiotap header generation, off-by-one

   - nl80211: fix getting radio statistics in survey dump

   - e100: fix device suspend/resume

  Previous releases - always broken:

   - tcp: fix uninitialized access in skb frags array for Rx 0cp

   - bpf: fix toctou on read-only map's constant scalar tracking

   - bpf: forbid bpf_ktime_get_coarse_ns and bpf_timer_* in tracing
     progs

   - tipc: only accept encrypted MSG_CRYPTO msgs

   - smc: transfer remaining wait queue entries during fallback, fix
     missing wake ups

   - udp: validate checksum in udp_read_sock() (when sockmap is used)

   - sched: act_mirred: drop dst for the direction from egress to
     ingress

   - virtio_net_hdr_to_skb: count transport header in UFO, prevent
     allowing bad skbs into the stack

   - nfc: reorder the logic in nfc_{un,}register_device, fix unregister

   - ipsec: check return value of ipv6_skip_exthdr

   - usb: r8152: add MAC passthrough support for more Lenovo Docks"

* tag 'net-5.16-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net: (96 commits)
  ptp: ocp: Fix a couple NULL vs IS_ERR() checks
  net: ethernet: dec: tulip: de4x5: fix possible array overflows in type3_infoblock()
  net: tulip: de4x5: fix the problem that the array 'lp->phy[8]' may be out of bound
  ipv6: check return value of ipv6_skip_exthdr
  e100: fix device suspend/resume
  devlink: Don't throw an error if flash notification sent before devlink visible
  page_pool: Revert "page_pool: disable dma mapping support..."
  ethernet: hisilicon: hns: hns_dsaf_misc: fix a possible array overflow in hns_dsaf_ge_srst_by_port()
  octeontx2-af: debugfs: don't corrupt user memory
  NFC: add NCI_UNREG flag to eliminate the race
  NFC: reorder the logic in nfc_{un,}register_device
  NFC: reorganize the functions in nci_request
  tipc: check for null after calling kmemdup
  i40e: Fix display error code in dmesg
  i40e: Fix creation of first queue by omitting it if is not power of two
  i40e: Fix warning message and call stack during rmmod i40e driver
  i40e: Fix ping is lost after configuring ADq on VF
  i40e: Fix changing previously set num_queue_pairs for PFs
  i40e: Fix NULL ptr dereference on VSI filter sync
  i40e: Fix correct max_pkt_size on VF RX queue
  ...
  • Loading branch information
Linus Torvalds committed Nov 18, 2021
2 parents 6fdf886 + c7521d3 commit 8d0112a
Show file tree
Hide file tree
Showing 102 changed files with 1,314 additions and 507 deletions.
4 changes: 2 additions & 2 deletions MAINTAINERS
Original file line number Diff line number Diff line change
Expand Up @@ -3733,7 +3733,7 @@ F: drivers/scsi/bnx2i/
BROADCOM BNX2X 10 GIGABIT ETHERNET DRIVER
M: Ariel Elior <aelior@marvell.com>
M: Sudarsana Kalluru <skalluru@marvell.com>
M: GR-everest-linux-l2@marvell.com
M: Manish Chopra <manishc@marvell.com>
L: netdev@vger.kernel.org
S: Supported
F: drivers/net/ethernet/broadcom/bnx2x/
Expand Down Expand Up @@ -15593,7 +15593,7 @@ F: drivers/scsi/qedi/

QLOGIC QL4xxx ETHERNET DRIVER
M: Ariel Elior <aelior@marvell.com>
M: GR-everest-linux-l2@marvell.com
M: Manish Chopra <manishc@marvell.com>
L: netdev@vger.kernel.org
S: Supported
F: drivers/net/ethernet/qlogic/qed/
Expand Down
2 changes: 1 addition & 1 deletion drivers/net/amt.c
Original file line number Diff line number Diff line change
Expand Up @@ -3286,7 +3286,7 @@ static void __exit amt_fini(void)
{
rtnl_link_unregister(&amt_link_ops);
unregister_netdevice_notifier(&amt_notifier_block);
cancel_delayed_work(&source_gc_wq);
cancel_delayed_work_sync(&source_gc_wq);
__amt_source_gc_work();
destroy_workqueue(amt_wq);
}
Expand Down
10 changes: 10 additions & 0 deletions drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_utils.c
Original file line number Diff line number Diff line change
Expand Up @@ -559,6 +559,11 @@ int hw_atl_utils_fw_rpc_wait(struct aq_hw_s *self,
goto err_exit;

if (fw.len == 0xFFFFU) {
if (sw.len > sizeof(self->rpc)) {
printk(KERN_INFO "Invalid sw len: %x\n", sw.len);
err = -EINVAL;
goto err_exit;
}
err = hw_atl_utils_fw_rpc_call(self, sw.len);
if (err < 0)
goto err_exit;
Expand All @@ -567,6 +572,11 @@ int hw_atl_utils_fw_rpc_wait(struct aq_hw_s *self,

if (rpc) {
if (fw.len) {
if (fw.len > sizeof(self->rpc)) {
printk(KERN_INFO "Invalid fw len: %x\n", fw.len);
err = -EINVAL;
goto err_exit;
}
err =
hw_atl_utils_fw_downld_dwords(self,
self->rpc_addr,
Expand Down
6 changes: 3 additions & 3 deletions drivers/net/ethernet/asix/ax88796c_main.h
Original file line number Diff line number Diff line change
Expand Up @@ -127,9 +127,9 @@ struct ax88796c_device {
#define AX_PRIV_FLAGS_MASK (AX_CAP_COMP)

unsigned long flags;
#define EVENT_INTR BIT(0)
#define EVENT_TX BIT(1)
#define EVENT_SET_MULTI BIT(2)
#define EVENT_INTR 0
#define EVENT_TX 1
#define EVENT_SET_MULTI 2

};

Expand Down
4 changes: 3 additions & 1 deletion drivers/net/ethernet/broadcom/bnx2x/bnx2x_init_ops.h
Original file line number Diff line number Diff line change
Expand Up @@ -635,11 +635,13 @@ static int bnx2x_ilt_client_mem_op(struct bnx2x *bp, int cli_num,
{
int i, rc;
struct bnx2x_ilt *ilt = BP_ILT(bp);
struct ilt_client_info *ilt_cli = &ilt->clients[cli_num];
struct ilt_client_info *ilt_cli;

if (!ilt || !ilt->lines)
return -1;

ilt_cli = &ilt->clients[cli_num];

if (ilt_cli->flags & (ILT_CLIENT_SKIP_INIT | ILT_CLIENT_SKIP_MEM))
return 0;

Expand Down
10 changes: 10 additions & 0 deletions drivers/net/ethernet/broadcom/bnxt/bnxt.h
Original file line number Diff line number Diff line change
Expand Up @@ -2258,6 +2258,16 @@ static inline void bnxt_db_write(struct bnxt *bp, struct bnxt_db_info *db,
}
}

/* Must hold rtnl_lock */
static inline bool bnxt_sriov_cfg(struct bnxt *bp)
{
#if defined(CONFIG_BNXT_SRIOV)
return BNXT_PF(bp) && (bp->pf.active_vfs || bp->sriov_cfg);
#else
return false;
#endif
}

extern const u16 bnxt_lhint_arr[];

int bnxt_alloc_rx_data(struct bnxt *bp, struct bnxt_rx_ring_info *rxr,
Expand Down
9 changes: 5 additions & 4 deletions drivers/net/ethernet/broadcom/bnxt/bnxt_devlink.c
Original file line number Diff line number Diff line change
Expand Up @@ -360,7 +360,7 @@ bnxt_dl_livepatch_report_err(struct bnxt *bp, struct netlink_ext_ack *extack,
NL_SET_ERR_MSG_MOD(extack, "Live patch already applied");
break;
default:
netdev_err(bp->dev, "Unexpected live patch error: %hhd\n", err);
netdev_err(bp->dev, "Unexpected live patch error: %d\n", err);
NL_SET_ERR_MSG_MOD(extack, "Failed to activate live patch");
break;
}
Expand Down Expand Up @@ -441,12 +441,13 @@ static int bnxt_dl_reload_down(struct devlink *dl, bool netns_change,

switch (action) {
case DEVLINK_RELOAD_ACTION_DRIVER_REINIT: {
if (BNXT_PF(bp) && bp->pf.active_vfs) {
rtnl_lock();
if (bnxt_sriov_cfg(bp)) {
NL_SET_ERR_MSG_MOD(extack,
"reload is unsupported when VFs are allocated");
"reload is unsupported while VFs are allocated or being configured");
rtnl_unlock();
return -EOPNOTSUPP;
}
rtnl_lock();
if (bp->dev->reg_state == NETREG_UNREGISTERED) {
rtnl_unlock();
return -ENODEV;
Expand Down
2 changes: 1 addition & 1 deletion drivers/net/ethernet/broadcom/bnxt/bnxt_tc.c
Original file line number Diff line number Diff line change
Expand Up @@ -1868,7 +1868,7 @@ static int bnxt_tc_setup_indr_block_cb(enum tc_setup_type type,
struct flow_cls_offload *flower = type_data;
struct bnxt *bp = priv->bp;

if (flower->common.chain_index)
if (!tc_cls_can_offload_and_chain0(bp->dev, type_data))
return -EOPNOTSUPP;

switch (type) {
Expand Down
34 changes: 21 additions & 13 deletions drivers/net/ethernet/dec/tulip/de4x5.c
Original file line number Diff line number Diff line change
Expand Up @@ -4709,6 +4709,10 @@ type3_infoblock(struct net_device *dev, u_char count, u_char *p)
lp->ibn = 3;
lp->active = *p++;
if (MOTO_SROM_BUG) lp->active = 0;
/* if (MOTO_SROM_BUG) statement indicates lp->active could
* be 8 (i.e. the size of array lp->phy) */
if (WARN_ON(lp->active >= ARRAY_SIZE(lp->phy)))
return -EINVAL;
lp->phy[lp->active].gep = (*p ? p : NULL); p += (2 * (*p) + 1);
lp->phy[lp->active].rst = (*p ? p : NULL); p += (2 * (*p) + 1);
lp->phy[lp->active].mc = get_unaligned_le16(p); p += 2;
Expand Down Expand Up @@ -5000,19 +5004,23 @@ mii_get_phy(struct net_device *dev)
}
if ((j == limit) && (i < DE4X5_MAX_MII)) {
for (k=0; k < DE4X5_MAX_PHY && lp->phy[k].id; k++);
lp->phy[k].addr = i;
lp->phy[k].id = id;
lp->phy[k].spd.reg = GENERIC_REG; /* ANLPA register */
lp->phy[k].spd.mask = GENERIC_MASK; /* 100Mb/s technologies */
lp->phy[k].spd.value = GENERIC_VALUE; /* TX & T4, H/F Duplex */
lp->mii_cnt++;
lp->active++;
printk("%s: Using generic MII device control. If the board doesn't operate,\nplease mail the following dump to the author:\n", dev->name);
j = de4x5_debug;
de4x5_debug |= DEBUG_MII;
de4x5_dbg_mii(dev, k);
de4x5_debug = j;
printk("\n");
if (k < DE4X5_MAX_PHY) {
lp->phy[k].addr = i;
lp->phy[k].id = id;
lp->phy[k].spd.reg = GENERIC_REG; /* ANLPA register */
lp->phy[k].spd.mask = GENERIC_MASK; /* 100Mb/s technologies */
lp->phy[k].spd.value = GENERIC_VALUE; /* TX & T4, H/F Duplex */
lp->mii_cnt++;
lp->active++;
printk("%s: Using generic MII device control. If the board doesn't operate,\nplease mail the following dump to the author:\n", dev->name);
j = de4x5_debug;
de4x5_debug |= DEBUG_MII;
de4x5_dbg_mii(dev, k);
de4x5_debug = j;
printk("\n");
} else {
goto purgatory;
}
}
}
purgatory:
Expand Down
4 changes: 2 additions & 2 deletions drivers/net/ethernet/freescale/dpaa2/dpaa2-eth.c
Original file line number Diff line number Diff line change
Expand Up @@ -4550,10 +4550,10 @@ static int dpaa2_eth_remove(struct fsl_mc_device *ls_dev)

fsl_mc_portal_free(priv->mc_io);

free_netdev(net_dev);

dev_dbg(net_dev->dev.parent, "Removed interface %s\n", net_dev->name);

free_netdev(net_dev);

return 0;
}

Expand Down
4 changes: 4 additions & 0 deletions drivers/net/ethernet/hisilicon/hns/hns_dsaf_misc.c
Original file line number Diff line number Diff line change
Expand Up @@ -400,6 +400,10 @@ static void hns_dsaf_ge_srst_by_port(struct dsaf_device *dsaf_dev, u32 port,
return;

if (!HNS_DSAF_IS_DEBUG(dsaf_dev)) {
/* DSAF_MAX_PORT_NUM is 6, but DSAF_GE_NUM is 8.
We need check to prevent array overflow */
if (port >= DSAF_MAX_PORT_NUM)
return;
reg_val_1 = 0x1 << port;
port_rst_off = dsaf_dev->mac_cb[port]->port_rst_off;
/* there is difference between V1 and V2 in register.*/
Expand Down
18 changes: 13 additions & 5 deletions drivers/net/ethernet/intel/e100.c
Original file line number Diff line number Diff line change
Expand Up @@ -3003,9 +3003,10 @@ static void __e100_shutdown(struct pci_dev *pdev, bool *enable_wake)
struct net_device *netdev = pci_get_drvdata(pdev);
struct nic *nic = netdev_priv(netdev);

netif_device_detach(netdev);

if (netif_running(netdev))
e100_down(nic);
netif_device_detach(netdev);

if ((nic->flags & wol_magic) | e100_asf(nic)) {
/* enable reverse auto-negotiation */
Expand All @@ -3022,7 +3023,7 @@ static void __e100_shutdown(struct pci_dev *pdev, bool *enable_wake)
*enable_wake = false;
}

pci_clear_master(pdev);
pci_disable_device(pdev);
}

static int __e100_power_off(struct pci_dev *pdev, bool wake)
Expand All @@ -3042,15 +3043,21 @@ static int __maybe_unused e100_suspend(struct device *dev_d)

__e100_shutdown(to_pci_dev(dev_d), &wake);

device_wakeup_disable(dev_d);

return 0;
}

static int __maybe_unused e100_resume(struct device *dev_d)
{
struct net_device *netdev = dev_get_drvdata(dev_d);
struct nic *nic = netdev_priv(netdev);
int err;

err = pci_enable_device(to_pci_dev(dev_d));
if (err) {
netdev_err(netdev, "Resume cannot enable PCI device, aborting\n");
return err;
}
pci_set_master(to_pci_dev(dev_d));

/* disable reverse auto-negotiation */
if (nic->phy == phy_82552_v) {
Expand All @@ -3062,10 +3069,11 @@ static int __maybe_unused e100_resume(struct device *dev_d)
smartspeed & ~(E100_82552_REV_ANEG));
}

netif_device_attach(netdev);
if (netif_running(netdev))
e100_up(nic);

netif_device_attach(netdev);

return 0;
}

Expand Down
2 changes: 2 additions & 0 deletions drivers/net/ethernet/intel/i40e/i40e.h
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,7 @@ enum i40e_vsi_state_t {
__I40E_VSI_OVERFLOW_PROMISC,
__I40E_VSI_REINIT_REQUESTED,
__I40E_VSI_DOWN_REQUESTED,
__I40E_VSI_RELEASING,
/* This must be last as it determines the size of the BITMAP */
__I40E_VSI_STATE_SIZE__,
};
Expand Down Expand Up @@ -1247,6 +1248,7 @@ void i40e_ptp_restore_hw_time(struct i40e_pf *pf);
void i40e_ptp_init(struct i40e_pf *pf);
void i40e_ptp_stop(struct i40e_pf *pf);
int i40e_ptp_alloc_pins(struct i40e_pf *pf);
int i40e_update_adq_vsi_queues(struct i40e_vsi *vsi, int vsi_offset);
int i40e_is_vsi_uplink_mode_veb(struct i40e_vsi *vsi);
i40e_status i40e_get_partition_bw_setting(struct i40e_pf *pf);
i40e_status i40e_set_partition_bw_setting(struct i40e_pf *pf);
Expand Down
Loading

0 comments on commit 8d0112a

Please sign in to comment.