Skip to content

Commit 66ae043

Browse files
committed
Merge tag 'net-6.1-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net
Pull networking fixes from Jakub Kicinski: "Including fixes from netfilter, and wifi. Current release - regressions: - Revert "net/sched: taprio: make qdisc_leaf() see the per-netdev-queue pfifo child qdiscs", it may cause crashes when the qdisc is reconfigured - inet: ping: fix splat due to packet allocation refactoring in inet - tcp: clean up kernel listener's reqsk in inet_twsk_purge(), fix UAF due to races when per-netns hash table is used Current release - new code bugs: - eth: adin1110: check in netdev_event that netdev belongs to driver - fixes for PTR_ERR() vs NULL bugs in driver code, from Dan and co. Previous releases - regressions: - ipv4: handle attempt to delete multipath route when fib_info contains an nh reference, avoid oob access - wifi: fix handful of bugs in the new Multi-BSSID code - wifi: mt76: fix rate reporting / throughput regression on mt7915 and newer, fix checksum offload - wifi: iwlwifi: mvm: fix double list_add at iwl_mvm_mac_wake_tx_queue (other cases) - wifi: mac80211: do not drop packets smaller than the LLC-SNAP header on fast-rx Previous releases - always broken: - ieee802154: don't warn zero-sized raw_sendmsg() - ipv6: ping: fix wrong checksum for large frames - mctp: prevent double key removal and unref - tcp/udp: fix memory leaks and races around IPV6_ADDRFORM - hv_netvsc: fix race between VF offering and VF association message Misc: - remove -Warray-bounds silencing in the drivers, compilers fixed" * tag 'net-6.1-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net: (73 commits) sunhme: fix an IS_ERR() vs NULL check in probe net: marvell: prestera: fix a couple NULL vs IS_ERR() checks kcm: avoid potential race in kcm_tx_work tcp: Clean up kernel listener's reqsk in inet_twsk_purge() net: phy: micrel: Fixes FIELD_GET assertion openvswitch: add nf_ct_is_confirmed check before assigning the helper tcp: Fix data races around icsk->icsk_af_ops. ipv6: Fix data races around sk->sk_prot. tcp/udp: Call inet6_destroy_sock() in IPv6 sk->sk_destruct(). udp: Call inet6_destroy_sock() in setsockopt(IPV6_ADDRFORM). tcp/udp: Fix memory leak in ipv6_renew_options(). mctp: prevent double key removal and unref selftests: netfilter: Fix nft_fib.sh for all.rp_filter=1 netfilter: rpfilter/fib: Populate flowic_l3mdev field selftests: netfilter: Test reverse path filtering net/mlx5: Make ASO poll CQ usable in atomic context tcp: cdg: allow tcp_cdg_release() to be called multiple times inet: ping: fix recent breakage ipv6: ping: fix wrong checksum for large frames net: ethernet: ti: am65-cpsw: set correct devlink flavour for unused ports ...
2 parents d6f04f2 + 99df45c commit 66ae043

Some content is hidden

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

88 files changed

+684
-275
lines changed

Documentation/networking/phy.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ required delays, as defined per the RGMII standard, several options may be
120120
available:
121121

122122
* Some SoCs may offer a pin pad/mux/controller capable of configuring a given
123-
set of pins'strength, delays, and voltage; and it may be a suitable
123+
set of pins' strength, delays, and voltage; and it may be a suitable
124124
option to insert the expected 2ns RGMII delay.
125125

126126
* Modifying the PCB design to include a fixed delay (e.g: using a specifically

MAINTAINERS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18670,6 +18670,7 @@ F: drivers/misc/sgi-xp/
1867018670
SHARED MEMORY COMMUNICATIONS (SMC) SOCKETS
1867118671
M: Karsten Graul <[email protected]>
1867218672
M: Wenjia Zhang <[email protected]>
18673+
M: Jan Karcher <[email protected]>
1867318674
1867418675
S: Supported
1867518676
W: http://www.ibm.com/developerworks/linux/linux390/

drivers/isdn/hardware/mISDN/hfcpci.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2345,8 +2345,7 @@ HFC_init(void)
23452345
static void __exit
23462346
HFC_cleanup(void)
23472347
{
2348-
if (timer_pending(&hfc_tl))
2349-
del_timer_sync(&hfc_tl);
2348+
del_timer_sync(&hfc_tl);
23502349

23512350
pci_unregister_driver(&hfc_driver);
23522351
}

drivers/net/can/usb/kvaser_usb/kvaser_usb.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -178,6 +178,8 @@ struct kvaser_usb_dev_cfg {
178178
extern const struct kvaser_usb_dev_ops kvaser_usb_hydra_dev_ops;
179179
extern const struct kvaser_usb_dev_ops kvaser_usb_leaf_dev_ops;
180180

181+
void kvaser_usb_unlink_tx_urbs(struct kvaser_usb_net_priv *priv);
182+
181183
int kvaser_usb_recv_cmd(const struct kvaser_usb *dev, void *cmd, int len,
182184
int *actual_len);
183185

drivers/net/can/usb/kvaser_usb/kvaser_usb_core.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -477,7 +477,7 @@ static void kvaser_usb_reset_tx_urb_contexts(struct kvaser_usb_net_priv *priv)
477477
/* This method might sleep. Do not call it in the atomic context
478478
* of URB completions.
479479
*/
480-
static void kvaser_usb_unlink_tx_urbs(struct kvaser_usb_net_priv *priv)
480+
void kvaser_usb_unlink_tx_urbs(struct kvaser_usb_net_priv *priv)
481481
{
482482
usb_kill_anchored_urbs(&priv->tx_submitted);
483483
kvaser_usb_reset_tx_urb_contexts(priv);
@@ -729,6 +729,7 @@ static int kvaser_usb_init_one(struct kvaser_usb *dev, int channel)
729729
init_usb_anchor(&priv->tx_submitted);
730730
init_completion(&priv->start_comp);
731731
init_completion(&priv->stop_comp);
732+
init_completion(&priv->flush_comp);
732733
priv->can.ctrlmode_supported = 0;
733734

734735
priv->dev = dev;

drivers/net/can/usb/kvaser_usb/kvaser_usb_hydra.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1916,7 +1916,7 @@ static int kvaser_usb_hydra_flush_queue(struct kvaser_usb_net_priv *priv)
19161916
{
19171917
int err;
19181918

1919-
init_completion(&priv->flush_comp);
1919+
reinit_completion(&priv->flush_comp);
19201920

19211921
err = kvaser_usb_hydra_send_simple_cmd(priv->dev, CMD_FLUSH_QUEUE,
19221922
priv->channel);

drivers/net/can/usb/kvaser_usb/kvaser_usb_leaf.c

Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -310,6 +310,38 @@ struct kvaser_cmd {
310310
} u;
311311
} __packed;
312312

313+
#define CMD_SIZE_ANY 0xff
314+
#define kvaser_fsize(field) sizeof_field(struct kvaser_cmd, field)
315+
316+
static const u8 kvaser_usb_leaf_cmd_sizes_leaf[] = {
317+
[CMD_START_CHIP_REPLY] = kvaser_fsize(u.simple),
318+
[CMD_STOP_CHIP_REPLY] = kvaser_fsize(u.simple),
319+
[CMD_GET_CARD_INFO_REPLY] = kvaser_fsize(u.cardinfo),
320+
[CMD_TX_ACKNOWLEDGE] = kvaser_fsize(u.tx_acknowledge_header),
321+
[CMD_GET_SOFTWARE_INFO_REPLY] = kvaser_fsize(u.leaf.softinfo),
322+
[CMD_RX_STD_MESSAGE] = kvaser_fsize(u.leaf.rx_can),
323+
[CMD_RX_EXT_MESSAGE] = kvaser_fsize(u.leaf.rx_can),
324+
[CMD_LEAF_LOG_MESSAGE] = kvaser_fsize(u.leaf.log_message),
325+
[CMD_CHIP_STATE_EVENT] = kvaser_fsize(u.leaf.chip_state_event),
326+
[CMD_CAN_ERROR_EVENT] = kvaser_fsize(u.leaf.error_event),
327+
/* ignored events: */
328+
[CMD_FLUSH_QUEUE_REPLY] = CMD_SIZE_ANY,
329+
};
330+
331+
static const u8 kvaser_usb_leaf_cmd_sizes_usbcan[] = {
332+
[CMD_START_CHIP_REPLY] = kvaser_fsize(u.simple),
333+
[CMD_STOP_CHIP_REPLY] = kvaser_fsize(u.simple),
334+
[CMD_GET_CARD_INFO_REPLY] = kvaser_fsize(u.cardinfo),
335+
[CMD_TX_ACKNOWLEDGE] = kvaser_fsize(u.tx_acknowledge_header),
336+
[CMD_GET_SOFTWARE_INFO_REPLY] = kvaser_fsize(u.usbcan.softinfo),
337+
[CMD_RX_STD_MESSAGE] = kvaser_fsize(u.usbcan.rx_can),
338+
[CMD_RX_EXT_MESSAGE] = kvaser_fsize(u.usbcan.rx_can),
339+
[CMD_CHIP_STATE_EVENT] = kvaser_fsize(u.usbcan.chip_state_event),
340+
[CMD_CAN_ERROR_EVENT] = kvaser_fsize(u.usbcan.error_event),
341+
/* ignored events: */
342+
[CMD_USBCAN_CLOCK_OVERFLOW_EVENT] = CMD_SIZE_ANY,
343+
};
344+
313345
/* Summary of a kvaser error event, for a unified Leaf/Usbcan error
314346
* handling. Some discrepancies between the two families exist:
315347
*
@@ -397,6 +429,43 @@ static const struct kvaser_usb_dev_cfg kvaser_usb_leaf_imx_dev_cfg_32mhz = {
397429
.bittiming_const = &kvaser_usb_flexc_bittiming_const,
398430
};
399431

432+
static int kvaser_usb_leaf_verify_size(const struct kvaser_usb *dev,
433+
const struct kvaser_cmd *cmd)
434+
{
435+
/* buffer size >= cmd->len ensured by caller */
436+
u8 min_size = 0;
437+
438+
switch (dev->driver_info->family) {
439+
case KVASER_LEAF:
440+
if (cmd->id < ARRAY_SIZE(kvaser_usb_leaf_cmd_sizes_leaf))
441+
min_size = kvaser_usb_leaf_cmd_sizes_leaf[cmd->id];
442+
break;
443+
case KVASER_USBCAN:
444+
if (cmd->id < ARRAY_SIZE(kvaser_usb_leaf_cmd_sizes_usbcan))
445+
min_size = kvaser_usb_leaf_cmd_sizes_usbcan[cmd->id];
446+
break;
447+
}
448+
449+
if (min_size == CMD_SIZE_ANY)
450+
return 0;
451+
452+
if (min_size) {
453+
min_size += CMD_HEADER_LEN;
454+
if (cmd->len >= min_size)
455+
return 0;
456+
457+
dev_err_ratelimited(&dev->intf->dev,
458+
"Received command %u too short (size %u, needed %u)",
459+
cmd->id, cmd->len, min_size);
460+
return -EIO;
461+
}
462+
463+
dev_warn_ratelimited(&dev->intf->dev,
464+
"Unhandled command (%d, size %d)\n",
465+
cmd->id, cmd->len);
466+
return -EINVAL;
467+
}
468+
400469
static void *
401470
kvaser_usb_leaf_frame_to_cmd(const struct kvaser_usb_net_priv *priv,
402471
const struct sk_buff *skb, int *cmd_len,
@@ -502,6 +571,9 @@ static int kvaser_usb_leaf_wait_cmd(const struct kvaser_usb *dev, u8 id,
502571
end:
503572
kfree(buf);
504573

574+
if (err == 0)
575+
err = kvaser_usb_leaf_verify_size(dev, cmd);
576+
505577
return err;
506578
}
507579

@@ -1133,6 +1205,9 @@ static void kvaser_usb_leaf_stop_chip_reply(const struct kvaser_usb *dev,
11331205
static void kvaser_usb_leaf_handle_command(const struct kvaser_usb *dev,
11341206
const struct kvaser_cmd *cmd)
11351207
{
1208+
if (kvaser_usb_leaf_verify_size(dev, cmd) < 0)
1209+
return;
1210+
11361211
switch (cmd->id) {
11371212
case CMD_START_CHIP_REPLY:
11381213
kvaser_usb_leaf_start_chip_reply(dev, cmd);
@@ -1351,9 +1426,13 @@ static int kvaser_usb_leaf_set_mode(struct net_device *netdev,
13511426

13521427
switch (mode) {
13531428
case CAN_MODE_START:
1429+
kvaser_usb_unlink_tx_urbs(priv);
1430+
13541431
err = kvaser_usb_leaf_simple_cmd_async(priv, CMD_START_CHIP);
13551432
if (err)
13561433
return err;
1434+
1435+
priv->can.state = CAN_STATE_ERROR_ACTIVE;
13571436
break;
13581437
default:
13591438
return -EOPNOTSUPP;

drivers/net/ethernet/adi/adin1110.c

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1169,6 +1169,11 @@ static int adin1110_port_bridge_leave(struct adin1110_port_priv *port_priv,
11691169
return ret;
11701170
}
11711171

1172+
static bool adin1110_port_dev_check(const struct net_device *dev)
1173+
{
1174+
return dev->netdev_ops == &adin1110_netdev_ops;
1175+
}
1176+
11721177
static int adin1110_netdevice_event(struct notifier_block *unused,
11731178
unsigned long event, void *ptr)
11741179
{
@@ -1177,6 +1182,9 @@ static int adin1110_netdevice_event(struct notifier_block *unused,
11771182
struct netdev_notifier_changeupper_info *info = ptr;
11781183
int ret = 0;
11791184

1185+
if (!adin1110_port_dev_check(dev))
1186+
return NOTIFY_DONE;
1187+
11801188
switch (event) {
11811189
case NETDEV_CHANGEUPPER:
11821190
if (netif_is_bridge_master(info->upper_dev)) {
@@ -1202,11 +1210,6 @@ static void adin1110_disconnect_phy(void *data)
12021210
phy_disconnect(data);
12031211
}
12041212

1205-
static bool adin1110_port_dev_check(const struct net_device *dev)
1206-
{
1207-
return dev->netdev_ops == &adin1110_netdev_ops;
1208-
}
1209-
12101213
static int adin1110_port_set_forwarding_state(struct adin1110_port_priv *port_priv)
12111214
{
12121215
struct adin1110_priv *priv = port_priv->priv;

drivers/net/ethernet/broadcom/Makefile

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,3 @@ obj-$(CONFIG_BGMAC_BCMA) += bgmac-bcma.o bgmac-bcma-mdio.o
1717
obj-$(CONFIG_BGMAC_PLATFORM) += bgmac-platform.o
1818
obj-$(CONFIG_SYSTEMPORT) += bcmsysport.o
1919
obj-$(CONFIG_BNXT) += bnxt/
20-
21-
# FIXME: temporarily silence -Warray-bounds on non W=1+ builds
22-
ifndef KBUILD_EXTRA_WARN
23-
CFLAGS_tg3.o += -Wno-array-bounds
24-
endif

drivers/net/ethernet/broadcom/bcmsysport.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -484,7 +484,7 @@ struct bcm_rsb {
484484

485485
/* Number of Receive hardware descriptor words */
486486
#define SP_NUM_HW_RX_DESC_WORDS 1024
487-
#define SP_LT_NUM_HW_RX_DESC_WORDS 256
487+
#define SP_LT_NUM_HW_RX_DESC_WORDS 512
488488

489489
/* Internal linked-list RAM size */
490490
#define SP_NUM_TX_DESC 1536

0 commit comments

Comments
 (0)