Skip to content

Commit

Permalink
Merge tag 'net-5.11-rc5' 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:
 "Networking fixes for 5.11-rc5, including fixes from bpf, wireless, and
  can trees.

  Current release - regressions:

   - nfc: nci: fix the wrong NCI_CORE_INIT parameters

  Current release - new code bugs:

   - bpf: allow empty module BTFs

  Previous releases - regressions:

   - bpf: fix signed_{sub,add32}_overflows type handling

   - tcp: do not mess with cloned skbs in tcp_add_backlog()

   - bpf: prevent double bpf_prog_put call from bpf_tracing_prog_attach

   - bpf: don't leak memory in bpf getsockopt when optlen == 0

   - tcp: fix potential use-after-free due to double kfree()

   - mac80211: fix encryption issues with WEP

   - devlink: use right genl user_ptr when handling port param get/set

   - ipv6: set multicast flag on the multicast route

   - tcp: fix TCP_USER_TIMEOUT with zero window

  Previous releases - always broken:

   - bpf: local storage helpers should check nullness of owner ptr passed

   - mac80211: fix incorrect strlen of .write in debugfs

   - cls_flower: call nla_ok() before nla_next()

   - skbuff: back tiny skbs with kmalloc() in __netdev_alloc_skb() too"

* tag 'net-5.11-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net: (52 commits)
  net: systemport: free dev before on error path
  net: usb: cdc_ncm: don't spew notifications
  net: mscc: ocelot: Fix multicast to the CPU port
  tcp: Fix potential use-after-free due to double kfree()
  bpf: Fix signed_{sub,add32}_overflows type handling
  can: peak_usb: fix use after free bugs
  can: vxcan: vxcan_xmit: fix use after free bug
  can: dev: can_restart: fix use after free bug
  tcp: fix TCP socket rehash stats mis-accounting
  net: dsa: b53: fix an off by one in checking "vlan->vid"
  tcp: do not mess with cloned skbs in tcp_add_backlog()
  selftests: net: fib_tests: remove duplicate log test
  net: nfc: nci: fix the wrong NCI_CORE_INIT parameters
  sh_eth: Fix power down vs. is_opened flag ordering
  net: Disable NETIF_F_HW_TLS_RX when RXCSUM is disabled
  netfilter: rpfilter: mask ecn bits before fib lookup
  udp: mask TOS bits in udp_v4_early_demux()
  xsk: Clear pool even for inactive queues
  bpf: Fix helper bpf_map_peek_elem_proto pointing to wrong callback
  sh_eth: Make PHY access aware of Runtime PM to fix reboot crash
  ...
  • Loading branch information
torvalds committed Jan 20, 2021
2 parents 2e4ceed + 535d315 commit 75439bc
Show file tree
Hide file tree
Showing 57 changed files with 380 additions and 252 deletions.
2 changes: 2 additions & 0 deletions .mailmap
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,8 @@ Bart Van Assche <[email protected]> <[email protected]>
Ben Gardner <[email protected]>
Ben M Cahill <[email protected]>
Björn Steinbrink <[email protected]>
Björn Töpel <[email protected]> <[email protected]>
Björn Töpel <[email protected]> <[email protected]>
Boris Brezillon <[email protected]> <[email protected]>
Boris Brezillon <[email protected]> <[email protected]>
Boris Brezillon <[email protected]> <[email protected]>
Expand Down
3 changes: 3 additions & 0 deletions Documentation/networking/tls-offload.rst
Original file line number Diff line number Diff line change
Expand Up @@ -534,3 +534,6 @@ offload. Hence, TLS TX device feature flag requires TX csum offload being set.
Disabling the latter implies clearing the former. Disabling TX checksum offload
should not affect old connections, and drivers should make sure checksum
calculation does not break for them.
Similarly, device-offloaded TLS decryption implies doing RXCSUM. If the user
does not want to enable RX csum offload, TLS RX device feature is disabled
as well.
4 changes: 2 additions & 2 deletions MAINTAINERS
Original file line number Diff line number Diff line change
Expand Up @@ -3334,7 +3334,7 @@ F: arch/riscv/net/
X: arch/riscv/net/bpf_jit_comp64.c

BPF JIT for RISC-V (64-bit)
M: Björn Töpel <bjorn[email protected]>
M: Björn Töpel <bjorn@kernel.org>
L: [email protected]
L: [email protected]
S: Maintained
Expand Down Expand Up @@ -19416,7 +19416,7 @@ F: drivers/net/ethernet/*/*/*xdp*
K: (?:\b|_)xdp(?:\b|_)

XDP SOCKETS (AF_XDP)
M: Björn Töpel <bjorn[email protected]>
M: Björn Töpel <bjorn@kernel.org>
M: Magnus Karlsson <[email protected]>
R: Jonathan Lemon <[email protected]>
L: [email protected]
Expand Down
4 changes: 2 additions & 2 deletions drivers/net/can/dev.c
Original file line number Diff line number Diff line change
Expand Up @@ -592,11 +592,11 @@ static void can_restart(struct net_device *dev)

cf->can_id |= CAN_ERR_RESTARTED;

netif_rx_ni(skb);

stats->rx_packets++;
stats->rx_bytes += cf->len;

netif_rx_ni(skb);

restart:
netdev_dbg(dev, "restarted\n");
priv->can_stats.restarts++;
Expand Down
8 changes: 4 additions & 4 deletions drivers/net/can/usb/peak_usb/pcan_usb_fd.c
Original file line number Diff line number Diff line change
Expand Up @@ -514,11 +514,11 @@ static int pcan_usb_fd_decode_canmsg(struct pcan_usb_fd_if *usb_if,
else
memcpy(cfd->data, rm->d, cfd->len);

peak_usb_netif_rx(skb, &usb_if->time_ref, le32_to_cpu(rm->ts_low));

netdev->stats.rx_packets++;
netdev->stats.rx_bytes += cfd->len;

peak_usb_netif_rx(skb, &usb_if->time_ref, le32_to_cpu(rm->ts_low));

return 0;
}

Expand Down Expand Up @@ -580,11 +580,11 @@ static int pcan_usb_fd_decode_status(struct pcan_usb_fd_if *usb_if,
if (!skb)
return -ENOMEM;

peak_usb_netif_rx(skb, &usb_if->time_ref, le32_to_cpu(sm->ts_low));

netdev->stats.rx_packets++;
netdev->stats.rx_bytes += cf->len;

peak_usb_netif_rx(skb, &usb_if->time_ref, le32_to_cpu(sm->ts_low));

return 0;
}

Expand Down
6 changes: 4 additions & 2 deletions drivers/net/can/vxcan.c
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ static netdev_tx_t vxcan_xmit(struct sk_buff *skb, struct net_device *dev)
struct net_device *peer;
struct canfd_frame *cfd = (struct canfd_frame *)skb->data;
struct net_device_stats *peerstats, *srcstats = &dev->stats;
u8 len;

if (can_dropped_invalid_skb(dev, skb))
return NETDEV_TX_OK;
Expand All @@ -61,12 +62,13 @@ static netdev_tx_t vxcan_xmit(struct sk_buff *skb, struct net_device *dev)
skb->dev = peer;
skb->ip_summed = CHECKSUM_UNNECESSARY;

len = cfd->len;
if (netif_rx_ni(skb) == NET_RX_SUCCESS) {
srcstats->tx_packets++;
srcstats->tx_bytes += cfd->len;
srcstats->tx_bytes += len;
peerstats = &peer->stats;
peerstats->rx_packets++;
peerstats->rx_bytes += cfd->len;
peerstats->rx_bytes += len;
}

out_unlock:
Expand Down
2 changes: 1 addition & 1 deletion drivers/net/dsa/b53/b53_common.c
Original file line number Diff line number Diff line change
Expand Up @@ -1404,7 +1404,7 @@ int b53_vlan_prepare(struct dsa_switch *ds, int port,
!(vlan->flags & BRIDGE_VLAN_INFO_UNTAGGED))
return -EINVAL;

if (vlan->vid_end > dev->num_vlans)
if (vlan->vid_end >= dev->num_vlans)
return -ERANGE;

b53_enable_vlan(dev, true, ds->vlan_filtering);
Expand Down
4 changes: 4 additions & 0 deletions drivers/net/dsa/mv88e6xxx/global1_vtu.c
Original file line number Diff line number Diff line change
Expand Up @@ -351,6 +351,10 @@ int mv88e6250_g1_vtu_getnext(struct mv88e6xxx_chip *chip,
if (err)
return err;

err = mv88e6185_g1_stu_data_read(chip, entry);
if (err)
return err;

/* VTU DBNum[3:0] are located in VTU Operation 3:0
* VTU DBNum[5:4] are located in VTU Operation 9:8
*/
Expand Down
6 changes: 4 additions & 2 deletions drivers/net/ethernet/broadcom/bcmsysport.c
Original file line number Diff line number Diff line change
Expand Up @@ -2503,8 +2503,10 @@ static int bcm_sysport_probe(struct platform_device *pdev)
priv = netdev_priv(dev);

priv->clk = devm_clk_get_optional(&pdev->dev, "sw_sysport");
if (IS_ERR(priv->clk))
return PTR_ERR(priv->clk);
if (IS_ERR(priv->clk)) {
ret = PTR_ERR(priv->clk);
goto err_free_netdev;
}

/* Allocate number of TX rings */
priv->tx_rings = devm_kcalloc(&pdev->dev, txq,
Expand Down
6 changes: 6 additions & 0 deletions drivers/net/ethernet/marvell/octeontx2/af/rvu_cgx.c
Original file line number Diff line number Diff line change
Expand Up @@ -469,6 +469,9 @@ int rvu_mbox_handler_cgx_mac_addr_set(struct rvu *rvu,
int pf = rvu_get_pf(req->hdr.pcifunc);
u8 cgx_id, lmac_id;

if (!is_cgx_config_permitted(rvu, req->hdr.pcifunc))
return -EPERM;

rvu_get_cgx_lmac_id(rvu->pf2cgxlmac_map[pf], &cgx_id, &lmac_id);

cgx_lmac_addr_set(cgx_id, lmac_id, req->mac_addr);
Expand All @@ -485,6 +488,9 @@ int rvu_mbox_handler_cgx_mac_addr_get(struct rvu *rvu,
int rc = 0, i;
u64 cfg;

if (!is_cgx_config_permitted(rvu, req->hdr.pcifunc))
return -EPERM;

rvu_get_cgx_lmac_id(rvu->pf2cgxlmac_map[pf], &cgx_id, &lmac_id);

rsp->hdr.rc = rc;
Expand Down
23 changes: 18 additions & 5 deletions drivers/net/ethernet/mscc/ocelot.c
Original file line number Diff line number Diff line change
Expand Up @@ -60,14 +60,27 @@ int ocelot_mact_learn(struct ocelot *ocelot, int port,
const unsigned char mac[ETH_ALEN],
unsigned int vid, enum macaccess_entry_type type)
{
u32 cmd = ANA_TABLES_MACACCESS_VALID |
ANA_TABLES_MACACCESS_DEST_IDX(port) |
ANA_TABLES_MACACCESS_ENTRYTYPE(type) |
ANA_TABLES_MACACCESS_MAC_TABLE_CMD(MACACCESS_CMD_LEARN);
unsigned int mc_ports;

/* Set MAC_CPU_COPY if the CPU port is used by a multicast entry */
if (type == ENTRYTYPE_MACv4)
mc_ports = (mac[1] << 8) | mac[2];
else if (type == ENTRYTYPE_MACv6)
mc_ports = (mac[0] << 8) | mac[1];
else
mc_ports = 0;

if (mc_ports & BIT(ocelot->num_phys_ports))
cmd |= ANA_TABLES_MACACCESS_MAC_CPU_COPY;

ocelot_mact_select(ocelot, mac, vid);

/* Issue a write command */
ocelot_write(ocelot, ANA_TABLES_MACACCESS_VALID |
ANA_TABLES_MACACCESS_DEST_IDX(port) |
ANA_TABLES_MACACCESS_ENTRYTYPE(type) |
ANA_TABLES_MACACCESS_MAC_TABLE_CMD(MACACCESS_CMD_LEARN),
ANA_TABLES_MACACCESS);
ocelot_write(ocelot, cmd, ANA_TABLES_MACACCESS);

return ocelot_mact_wait_for_completion(ocelot);
}
Expand Down
4 changes: 1 addition & 3 deletions drivers/net/ethernet/mscc/ocelot_net.c
Original file line number Diff line number Diff line change
Expand Up @@ -1042,10 +1042,8 @@ static int ocelot_netdevice_event(struct notifier_block *unused,
struct net_device *dev = netdev_notifier_info_to_dev(ptr);
int ret = 0;

if (!ocelot_netdevice_dev_check(dev))
return 0;

if (event == NETDEV_PRECHANGEUPPER &&
ocelot_netdevice_dev_check(dev) &&
netif_is_lag_master(info->upper_dev)) {
struct netdev_lag_upper_info *lag_upper_info = info->upper_info;
struct netlink_ext_ack *extack;
Expand Down
30 changes: 28 additions & 2 deletions drivers/net/ethernet/renesas/sh_eth.c
Original file line number Diff line number Diff line change
Expand Up @@ -2606,10 +2606,10 @@ static int sh_eth_close(struct net_device *ndev)
/* Free all the skbuffs in the Rx queue and the DMA buffer. */
sh_eth_ring_free(ndev);

pm_runtime_put_sync(&mdp->pdev->dev);

mdp->is_opened = 0;

pm_runtime_put(&mdp->pdev->dev);

return 0;
}

Expand Down Expand Up @@ -3034,6 +3034,28 @@ static int sh_mdio_release(struct sh_eth_private *mdp)
return 0;
}

static int sh_mdiobb_read(struct mii_bus *bus, int phy, int reg)
{
int res;

pm_runtime_get_sync(bus->parent);
res = mdiobb_read(bus, phy, reg);
pm_runtime_put(bus->parent);

return res;
}

static int sh_mdiobb_write(struct mii_bus *bus, int phy, int reg, u16 val)
{
int res;

pm_runtime_get_sync(bus->parent);
res = mdiobb_write(bus, phy, reg, val);
pm_runtime_put(bus->parent);

return res;
}

/* MDIO bus init function */
static int sh_mdio_init(struct sh_eth_private *mdp,
struct sh_eth_plat_data *pd)
Expand All @@ -3058,6 +3080,10 @@ static int sh_mdio_init(struct sh_eth_private *mdp,
if (!mdp->mii_bus)
return -ENOMEM;

/* Wrap accessors with Runtime PM-aware ops */
mdp->mii_bus->read = sh_mdiobb_read;
mdp->mii_bus->write = sh_mdiobb_write;

/* Hook up MII support for ethtool */
mdp->mii_bus->name = "sh_mii";
mdp->mii_bus->parent = dev;
Expand Down
6 changes: 4 additions & 2 deletions drivers/net/mdio/mdio-bitbang.c
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ static int mdiobb_cmd_addr(struct mdiobb_ctrl *ctrl, int phy, u32 addr)
return dev_addr;
}

static int mdiobb_read(struct mii_bus *bus, int phy, int reg)
int mdiobb_read(struct mii_bus *bus, int phy, int reg)
{
struct mdiobb_ctrl *ctrl = bus->priv;
int ret, i;
Expand Down Expand Up @@ -180,8 +180,9 @@ static int mdiobb_read(struct mii_bus *bus, int phy, int reg)
mdiobb_get_bit(ctrl);
return ret;
}
EXPORT_SYMBOL(mdiobb_read);

static int mdiobb_write(struct mii_bus *bus, int phy, int reg, u16 val)
int mdiobb_write(struct mii_bus *bus, int phy, int reg, u16 val)
{
struct mdiobb_ctrl *ctrl = bus->priv;

Expand All @@ -201,6 +202,7 @@ static int mdiobb_write(struct mii_bus *bus, int phy, int reg, u16 val)
mdiobb_get_bit(ctrl);
return 0;
}
EXPORT_SYMBOL(mdiobb_write);

struct mii_bus *alloc_mdio_bitbang(struct mdiobb_ctrl *ctrl)
{
Expand Down
12 changes: 11 additions & 1 deletion drivers/net/usb/cdc_ncm.c
Original file line number Diff line number Diff line change
Expand Up @@ -1827,6 +1827,15 @@ cdc_ncm_speed_change(struct usbnet *dev,
uint32_t rx_speed = le32_to_cpu(data->DLBitRRate);
uint32_t tx_speed = le32_to_cpu(data->ULBitRate);

/* if the speed hasn't changed, don't report it.
* RTL8156 shipped before 2021 sends notification about every 32ms.
*/
if (dev->rx_speed == rx_speed && dev->tx_speed == tx_speed)
return;

dev->rx_speed = rx_speed;
dev->tx_speed = tx_speed;

/*
* Currently the USB-NET API does not support reporting the actual
* device speed. Do print it instead.
Expand Down Expand Up @@ -1867,7 +1876,8 @@ static void cdc_ncm_status(struct usbnet *dev, struct urb *urb)
* USB_CDC_NOTIFY_NETWORK_CONNECTION notification shall be
* sent by device after USB_CDC_NOTIFY_SPEED_CHANGE.
*/
usbnet_link_change(dev, !!event->wValue, 0);
if (netif_carrier_ok(dev->net) != !!event->wValue)
usbnet_link_change(dev, !!event->wValue, 0);
break;

case USB_CDC_NOTIFY_SPEED_CHANGE:
Expand Down
3 changes: 3 additions & 0 deletions include/linux/mdio-bitbang.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,9 @@ struct mdiobb_ctrl {
const struct mdiobb_ops *ops;
};

int mdiobb_read(struct mii_bus *bus, int phy, int reg);
int mdiobb_write(struct mii_bus *bus, int phy, int reg, u16 val);

/* The returned bus is not yet registered with the phy layer. */
struct mii_bus *alloc_mdio_bitbang(struct mdiobb_ctrl *ctrl);

Expand Down
2 changes: 2 additions & 0 deletions include/linux/usb/usbnet.h
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,8 @@ struct usbnet {
# define EVENT_LINK_CHANGE 11
# define EVENT_SET_RX_MODE 12
# define EVENT_NO_IP_ALIGN 13
u32 rx_speed; /* in bps - NOT Mbps */
u32 tx_speed; /* in bps - NOT Mbps */
};

static inline struct usb_driver *driver_of(struct usb_interface *intf)
Expand Down
5 changes: 4 additions & 1 deletion include/net/cfg80211.h
Original file line number Diff line number Diff line change
Expand Up @@ -1756,7 +1756,7 @@ struct cfg80211_sar_specs {


/**
* @struct cfg80211_sar_chan_ranges - sar frequency ranges
* struct cfg80211_sar_freq_ranges - sar frequency ranges
* @start_freq: start range edge frequency
* @end_freq: end range edge frequency
*/
Expand Down Expand Up @@ -3972,6 +3972,8 @@ struct mgmt_frame_regs {
* This callback may sleep.
* @reset_tid_config: Reset TID specific configuration for the peer, for the
* given TIDs. This callback may sleep.
*
* @set_sar_specs: Update the SAR (TX power) settings.
*/
struct cfg80211_ops {
int (*suspend)(struct wiphy *wiphy, struct cfg80211_wowlan *wow);
Expand Down Expand Up @@ -4929,6 +4931,7 @@ struct wiphy_iftype_akm_suites {
* @max_data_retry_count: maximum supported per TID retry count for
* configuration through the %NL80211_TID_CONFIG_ATTR_RETRY_SHORT and
* %NL80211_TID_CONFIG_ATTR_RETRY_LONG attributes
* @sar_capa: SAR control capabilities
*/
struct wiphy {
/* assign these fields before you register the wiphy */
Expand Down
3 changes: 3 additions & 0 deletions include/net/inet_connection_sock.h
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,8 @@ struct inet_connection_sock_af_ops {
* @icsk_ext_hdr_len: Network protocol overhead (IP/IPv6 options)
* @icsk_ack: Delayed ACK control data
* @icsk_mtup; MTU probing control data
* @icsk_probes_tstamp: Probe timestamp (cleared by non-zero window ack)
* @icsk_user_timeout: TCP_USER_TIMEOUT value
*/
struct inet_connection_sock {
/* inet_sock has to be the first member! */
Expand Down Expand Up @@ -129,6 +131,7 @@ struct inet_connection_sock {

u32 probe_timestamp;
} icsk_mtup;
u32 icsk_probes_tstamp;
u32 icsk_user_timeout;

u64 icsk_ca_priv[104 / sizeof(u64)];
Expand Down
1 change: 1 addition & 0 deletions include/net/mac80211.h
Original file line number Diff line number Diff line change
Expand Up @@ -3880,6 +3880,7 @@ enum ieee80211_reconfig_type {
* This callback may sleep.
* @sta_set_4addr: Called to notify the driver when a station starts/stops using
* 4-address mode
* @set_sar_specs: Update the SAR (TX power) settings.
*/
struct ieee80211_ops {
void (*tx)(struct ieee80211_hw *hw,
Expand Down
Loading

0 comments on commit 75439bc

Please sign in to comment.