Skip to content

Commit b949c21

Browse files
committed
Merge tag 'net-5.17-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net
Pull networking fixes from Jakub Kicinski: "Including fixes from can, xfrm, wifi, bluetooth, and netfilter. Lots of various size fixes, the length of the tag speaks for itself. Most of the 5.17-relevant stuff comes from xfrm, wifi and bt trees which had been lagging as you pointed out previously. But there's also a larger than we'd like portion of fixes for bugs from previous releases. Three more fixes still under discussion, including and xfrm revert for uAPI error. Current release - regressions: - iwlwifi: don't advertise TWT support, prevent FW crash - xfrm: fix the if_id check in changelink - xen/netfront: destroy queues before real_num_tx_queues is zeroed - bluetooth: fix not checking MGMT cmd pending queue, make scanning work again Current release - new code bugs: - mptcp: make SIOCOUTQ accurate for fallback socket - bluetooth: access skb->len after null check - bluetooth: hci_sync: fix not using conn_timeout - smc: fix cleanup when register ULP fails - dsa: restore error path of dsa_tree_change_tag_proto - iwlwifi: fix build error for IWLMEI - iwlwifi: mvm: propagate error from request_ownership to the user Previous releases - regressions: - xfrm: fix pMTU regression when reported pMTU is too small - xfrm: fix TCP MSS calculation when pMTU is close to 1280 - bluetooth: fix bt_skb_sendmmsg not allocating partial chunks - ipv6: ensure we call ipv6_mc_down() at most once, prevent leaks - ipv6: prevent leaks in igmp6 when input queues get full - fix up skbs delta_truesize in UDP GRO frag_list - eth: e1000e: fix possible HW unit hang after an s0ix exit - eth: e1000e: correct NVM checksum verification flow - ptp: ocp: fix large time adjustments Previous releases - always broken: - tcp: make tcp_read_sock() more robust in presence of urgent data - xfrm: distinguishing SAs and SPs by if_id in xfrm_migrate - xfrm: fix xfrm_migrate issues when address family changes - dcb: flush lingering app table entries for unregistered devices - smc: fix unexpected SMC_CLC_DECL_ERR_REGRMB error - mac80211: fix EAPoL rekey fail in 802.3 rx path - mac80211: fix forwarded mesh frames AC & queue selection - netfilter: nf_queue: fix socket access races and bugs - batman-adv: fix ToCToU iflink problems and check the result belongs to the expected net namespace - can: gs_usb, etas_es58x: fix opened_channel_cnt's accounting - can: rcar_canfd: register the CAN device when fully ready - eth: igb, igc: phy: drop premature return leaking HW semaphore - eth: ixgbe: xsk: change !netif_carrier_ok() handling in ixgbe_xmit_zc(), prevent live lock when link goes down - eth: stmmac: only enable DMA interrupts when ready - eth: sparx5: move vlan checks before any changes are made - eth: iavf: fix races around init, removal, resets and vlan ops - ibmvnic: more reset flow fixes Misc: - eth: fix return value of __setup handlers" * tag 'net-5.17-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net: (92 commits) ipv6: fix skb drops in igmp6_event_query() and igmp6_event_report() net: dsa: make dsa_tree_change_tag_proto actually unwind the tag proto change ixgbe: xsk: change !netif_carrier_ok() handling in ixgbe_xmit_zc() selftests: mlxsw: resource_scale: Fix return value selftests: mlxsw: tc_police_scale: Make test more robust net: dcb: disable softirqs in dcbnl_flush_dev() bnx2: Fix an error message sfc: extend the locking on mcdi->seqno net/smc: fix unexpected SMC_CLC_DECL_ERR_REGRMB error cause by server net/smc: fix unexpected SMC_CLC_DECL_ERR_REGRMB error generated by client net: arcnet: com20020: Fix null-ptr-deref in com20020pci_probe() tcp: make tcp_read_sock() more robust bpf, sockmap: Do not ignore orig_len parameter net: ipa: add an interconnect dependency net: fix up skbs delta_truesize in UDP GRO frag_list iwlwifi: mvm: return value for request_ownership nl80211: Update bss channel on channel switch for P2P_CLIENT iwlwifi: fix build error for IWLMEI ptp: ocp: Add ptp_ocp_adjtime_coarse for large adjustments batman-adv: Don't expect inter-netns unique iflink indices ...
2 parents e58bd49 + 2d3916f commit b949c21

Some content is hidden

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

84 files changed

+988
-343
lines changed

drivers/atm/firestream.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1676,6 +1676,8 @@ static int fs_init(struct fs_dev *dev)
16761676
dev->hw_base = pci_resource_start(pci_dev, 0);
16771677

16781678
dev->base = ioremap(dev->hw_base, 0x1000);
1679+
if (!dev->base)
1680+
return 1;
16791681

16801682
reset_chip (dev);
16811683

drivers/net/arcnet/com20020-pci.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,9 @@ static int com20020pci_probe(struct pci_dev *pdev,
138138
return -ENOMEM;
139139

140140
ci = (struct com20020_pci_card_info *)id->driver_data;
141+
if (!ci)
142+
return -EINVAL;
143+
141144
priv->ci = ci;
142145
mm = &ci->misc_map;
143146

drivers/net/can/rcar/rcar_canfd.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1715,15 +1715,15 @@ static int rcar_canfd_channel_probe(struct rcar_canfd_global *gpriv, u32 ch,
17151715

17161716
netif_napi_add(ndev, &priv->napi, rcar_canfd_rx_poll,
17171717
RCANFD_NAPI_WEIGHT);
1718+
spin_lock_init(&priv->tx_lock);
1719+
devm_can_led_init(ndev);
1720+
gpriv->ch[priv->channel] = priv;
17181721
err = register_candev(ndev);
17191722
if (err) {
17201723
dev_err(&pdev->dev,
17211724
"register_candev() failed, error %d\n", err);
17221725
goto fail_candev;
17231726
}
1724-
spin_lock_init(&priv->tx_lock);
1725-
devm_can_led_init(ndev);
1726-
gpriv->ch[priv->channel] = priv;
17271727
dev_info(&pdev->dev, "device registered (channel %u)\n", priv->channel);
17281728
return 0;
17291729

drivers/net/can/usb/etas_es58x/es58x_core.c

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1787,7 +1787,7 @@ static int es58x_open(struct net_device *netdev)
17871787
struct es58x_device *es58x_dev = es58x_priv(netdev)->es58x_dev;
17881788
int ret;
17891789

1790-
if (atomic_inc_return(&es58x_dev->opened_channel_cnt) == 1) {
1790+
if (!es58x_dev->opened_channel_cnt) {
17911791
ret = es58x_alloc_rx_urbs(es58x_dev);
17921792
if (ret)
17931793
return ret;
@@ -1805,12 +1805,13 @@ static int es58x_open(struct net_device *netdev)
18051805
if (ret)
18061806
goto free_urbs;
18071807

1808+
es58x_dev->opened_channel_cnt++;
18081809
netif_start_queue(netdev);
18091810

18101811
return ret;
18111812

18121813
free_urbs:
1813-
if (atomic_dec_and_test(&es58x_dev->opened_channel_cnt))
1814+
if (!es58x_dev->opened_channel_cnt)
18141815
es58x_free_urbs(es58x_dev);
18151816
netdev_err(netdev, "%s: Could not open the network device: %pe\n",
18161817
__func__, ERR_PTR(ret));
@@ -1845,7 +1846,8 @@ static int es58x_stop(struct net_device *netdev)
18451846

18461847
es58x_flush_pending_tx_msg(netdev);
18471848

1848-
if (atomic_dec_and_test(&es58x_dev->opened_channel_cnt))
1849+
es58x_dev->opened_channel_cnt--;
1850+
if (!es58x_dev->opened_channel_cnt)
18491851
es58x_free_urbs(es58x_dev);
18501852

18511853
return 0;
@@ -2215,7 +2217,6 @@ static struct es58x_device *es58x_init_es58x_dev(struct usb_interface *intf,
22152217
init_usb_anchor(&es58x_dev->tx_urbs_idle);
22162218
init_usb_anchor(&es58x_dev->tx_urbs_busy);
22172219
atomic_set(&es58x_dev->tx_urbs_idle_cnt, 0);
2218-
atomic_set(&es58x_dev->opened_channel_cnt, 0);
22192220
usb_set_intfdata(intf, es58x_dev);
22202221

22212222
es58x_dev->rx_pipe = usb_rcvbulkpipe(es58x_dev->udev,

drivers/net/can/usb/etas_es58x/es58x_core.h

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -373,8 +373,6 @@ struct es58x_operators {
373373
* queue wake/stop logic should prevent this URB from getting
374374
* empty. Please refer to es58x_get_tx_urb() for more details.
375375
* @tx_urbs_idle_cnt: number of urbs in @tx_urbs_idle.
376-
* @opened_channel_cnt: number of channels opened (c.f. es58x_open()
377-
* and es58x_stop()).
378376
* @ktime_req_ns: kernel timestamp when es58x_set_realtime_diff_ns()
379377
* was called.
380378
* @realtime_diff_ns: difference in nanoseconds between the clocks of
@@ -384,6 +382,10 @@ struct es58x_operators {
384382
* in RX branches.
385383
* @rx_max_packet_size: Maximum length of bulk-in URB.
386384
* @num_can_ch: Number of CAN channel (i.e. number of elements of @netdev).
385+
* @opened_channel_cnt: number of channels opened. Free of race
386+
* conditions because its two users (net_device_ops:ndo_open()
387+
* and net_device_ops:ndo_close()) guarantee that the network
388+
* stack big kernel lock (a.k.a. rtnl_mutex) is being hold.
387389
* @rx_cmd_buf_len: Length of @rx_cmd_buf.
388390
* @rx_cmd_buf: The device might split the URB commands in an
389391
* arbitrary amount of pieces. This buffer is used to concatenate
@@ -406,7 +408,6 @@ struct es58x_device {
406408
struct usb_anchor tx_urbs_busy;
407409
struct usb_anchor tx_urbs_idle;
408410
atomic_t tx_urbs_idle_cnt;
409-
atomic_t opened_channel_cnt;
410411

411412
u64 ktime_req_ns;
412413
s64 realtime_diff_ns;
@@ -415,6 +416,7 @@ struct es58x_device {
415416

416417
u16 rx_max_packet_size;
417418
u8 num_can_ch;
419+
u8 opened_channel_cnt;
418420

419421
u16 rx_cmd_buf_len;
420422
union es58x_urb_cmd rx_cmd_buf;

drivers/net/can/usb/gs_usb.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -191,8 +191,8 @@ struct gs_can {
191191
struct gs_usb {
192192
struct gs_can *canch[GS_MAX_INTF];
193193
struct usb_anchor rx_submitted;
194-
atomic_t active_channels;
195194
struct usb_device *udev;
195+
u8 active_channels;
196196
};
197197

198198
/* 'allocate' a tx context.
@@ -589,7 +589,7 @@ static int gs_can_open(struct net_device *netdev)
589589
if (rc)
590590
return rc;
591591

592-
if (atomic_add_return(1, &parent->active_channels) == 1) {
592+
if (!parent->active_channels) {
593593
for (i = 0; i < GS_MAX_RX_URBS; i++) {
594594
struct urb *urb;
595595
u8 *buf;
@@ -690,6 +690,7 @@ static int gs_can_open(struct net_device *netdev)
690690

691691
dev->can.state = CAN_STATE_ERROR_ACTIVE;
692692

693+
parent->active_channels++;
693694
if (!(dev->can.ctrlmode & CAN_CTRLMODE_LISTENONLY))
694695
netif_start_queue(netdev);
695696

@@ -705,7 +706,8 @@ static int gs_can_close(struct net_device *netdev)
705706
netif_stop_queue(netdev);
706707

707708
/* Stop polling */
708-
if (atomic_dec_and_test(&parent->active_channels))
709+
parent->active_channels--;
710+
if (!parent->active_channels)
709711
usb_kill_anchored_urbs(&parent->rx_submitted);
710712

711713
/* Stop sending URBs */
@@ -984,8 +986,6 @@ static int gs_usb_probe(struct usb_interface *intf,
984986

985987
init_usb_anchor(&dev->rx_submitted);
986988

987-
atomic_set(&dev->active_channels, 0);
988-
989989
usb_set_intfdata(intf, dev);
990990
dev->udev = interface_to_usbdev(intf);
991991

drivers/net/ethernet/broadcom/bnx2.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8216,7 +8216,7 @@ bnx2_init_board(struct pci_dev *pdev, struct net_device *dev)
82168216
rc = dma_set_coherent_mask(&pdev->dev, persist_dma_mask);
82178217
if (rc) {
82188218
dev_err(&pdev->dev,
8219-
"pci_set_consistent_dma_mask failed, aborting\n");
8219+
"dma_set_coherent_mask failed, aborting\n");
82208220
goto err_out_unmap;
82218221
}
82228222
} else if ((rc = dma_set_mask(&pdev->dev, DMA_BIT_MASK(32))) != 0) {

drivers/net/ethernet/chelsio/cxgb3/t3_hw.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3613,6 +3613,8 @@ int t3_prep_adapter(struct adapter *adapter, const struct adapter_info *ai,
36133613
MAC_STATS_ACCUM_SECS : (MAC_STATS_ACCUM_SECS * 10);
36143614
adapter->params.pci.vpd_cap_addr =
36153615
pci_find_capability(adapter->pdev, PCI_CAP_ID_VPD);
3616+
if (!adapter->params.pci.vpd_cap_addr)
3617+
return -ENODEV;
36163618
ret = get_vpd_params(adapter, &adapter->params.vpd);
36173619
if (ret < 0)
36183620
return ret;

0 commit comments

Comments
 (0)