Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge tag 'net-6.17-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net

Pull networking fixes from Jakub Kicinski:
"Including fixes from wireless. No known regressions at this point.

Current release - fix to a fix:

- eth: Revert "net/mlx5e: Update and set Xon/Xoff upon port speed set"

- wifi: iwlwifi: pcie: fix byte count table for 7000/8000 devices

- net: clear sk->sk_ino in sk_set_socket(sk, NULL), fix CRIU

Previous releases - regressions:

- bonding: set random address only when slaves already exist

- rxrpc: fix untrusted unsigned subtract

- eth:
- ice: fix Rx page leak on multi-buffer frames
- mlx5: don't return mlx5_link_info table when speed is unknown

Previous releases - always broken:

- tls: make sure to abort the stream if headers are bogus

- tcp: fix null-deref when using TCP-AO with TCP_REPAIR

- dpll: fix skipping last entry in clock quality level reporting

- eth: qed: don't collect too many protection override GRC elements,
fix memory corruption"

* tag 'net-6.17-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net: (51 commits)
octeontx2-pf: Fix use-after-free bugs in otx2_sync_tstamp()
cnic: Fix use-after-free bugs in cnic_delete_task
devlink rate: Remove unnecessary 'static' from a couple places
MAINTAINERS: update sundance entry
net: liquidio: fix overflow in octeon_init_instr_queue()
net: clear sk->sk_ino in sk_set_socket(sk, NULL)
Revert "net/mlx5e: Update and set Xon/Xoff upon port speed set"
selftests: tls: test skb copy under mem pressure and OOB
tls: make sure to abort the stream if headers are bogus
selftest: packetdrill: Add tcp_fastopen_server_reset-after-disconnect.pkt.
tcp: Clear tcp_sk(sk)->fastopen_rsk in tcp_disconnect().
octeon_ep: fix VF MAC address lifecycle handling
selftests: bonding: add vlan over bond testing
bonding: don't set oif to bond dev when getting NS target destination
net: rfkill: gpio: Fix crash due to dereferencering uninitialized pointer
net/mlx5e: Add a miss level for ipsec crypto offload
net/mlx5e: Harden uplink netdev access against device unbind
MAINTAINERS: make the DPLL entry cover drivers
doc/netlink: Fix typos in operation attributes
igc: don't fail igc_probe() on LED setup error
...

+640 -179
+4 -5
Documentation/netlink/specs/conntrack.yaml
··· 575 575 - nat-dst 576 576 - timeout 577 577 - mark 578 - - counter-orig 579 - - counter-reply 578 + - counters-orig 579 + - counters-reply 580 580 - use 581 581 - id 582 582 - nat-dst ··· 591 591 request: 592 592 value: 0x101 593 593 attributes: 594 - - nfgen-family 595 594 - mark 596 595 - filter 597 596 - status ··· 607 608 - nat-dst 608 609 - timeout 609 610 - mark 610 - - counter-orig 611 - - counter-reply 611 + - counters-orig 612 + - counters-reply 612 613 - use 613 614 - id 614 615 - nat-dst
+2 -2
Documentation/netlink/specs/mptcp_pm.yaml
··· 28 28 traffic-patterns it can take a long time until the 29 29 MPTCP_EVENT_ESTABLISHED is sent. 30 30 Attributes: token, family, saddr4 | saddr6, daddr4 | daddr6, sport, 31 - dport, server-side. 31 + dport, server-side, [flags]. 32 32 - 33 33 name: established 34 34 doc: >- 35 35 A MPTCP connection is established (can start new subflows). 36 36 Attributes: token, family, saddr4 | saddr6, daddr4 | daddr6, sport, 37 - dport, server-side. 37 + dport, server-side, [flags]. 38 38 - 39 39 name: closed 40 40 doc: >-
+2 -2
MAINTAINERS
··· 7430 7430 F: Documentation/devicetree/bindings/dpll/dpll-device.yaml 7431 7431 F: Documentation/devicetree/bindings/dpll/dpll-pin.yaml 7432 7432 F: Documentation/driver-api/dpll.rst 7433 - F: drivers/dpll/* 7433 + F: drivers/dpll/ 7434 7434 F: include/linux/dpll.h 7435 7435 F: include/uapi/linux/dpll.h 7436 7436 ··· 24259 24259 F: drivers/input/keyboard/sun4i-lradc-keys.c 24260 24260 24261 24261 SUNDANCE NETWORK DRIVER 24262 - M: Denis Kirjanov <dkirjanov@suse.de> 24262 + M: Denis Kirjanov <kirjanov@gmail.com> 24263 24263 L: netdev@vger.kernel.org 24264 24264 S: Maintained 24265 24265 F: drivers/net/ethernet/dlink/sundance.c
+2 -2
drivers/dpll/dpll_netlink.c
··· 211 211 dpll_msg_add_clock_quality_level(struct sk_buff *msg, struct dpll_device *dpll, 212 212 struct netlink_ext_ack *extack) 213 213 { 214 + DECLARE_BITMAP(qls, DPLL_CLOCK_QUALITY_LEVEL_MAX + 1) = { 0 }; 214 215 const struct dpll_device_ops *ops = dpll_device_ops(dpll); 215 - DECLARE_BITMAP(qls, DPLL_CLOCK_QUALITY_LEVEL_MAX) = { 0 }; 216 216 enum dpll_clock_quality_level ql; 217 217 int ret; 218 218 ··· 221 221 ret = ops->clock_quality_level_get(dpll, dpll_priv(dpll), qls, extack); 222 222 if (ret) 223 223 return ret; 224 - for_each_set_bit(ql, qls, DPLL_CLOCK_QUALITY_LEVEL_MAX) 224 + for_each_set_bit(ql, qls, DPLL_CLOCK_QUALITY_LEVEL_MAX + 1) 225 225 if (nla_put_u32(msg, DPLL_A_CLOCK_QUALITY_LEVEL, ql)) 226 226 return -EMSGSIZE; 227 227
+1 -1
drivers/net/bonding/bond_main.c
··· 2132 2132 memcpy(ss.__data, bond_dev->dev_addr, bond_dev->addr_len); 2133 2133 } else if (bond->params.fail_over_mac == BOND_FOM_FOLLOW && 2134 2134 BOND_MODE(bond) == BOND_MODE_ACTIVEBACKUP && 2135 + bond_has_slaves(bond) && 2135 2136 memcmp(slave_dev->dev_addr, bond_dev->dev_addr, bond_dev->addr_len) == 0) { 2136 2137 /* Set slave to random address to avoid duplicate mac 2137 2138 * address in later fail over. ··· 3356 3355 /* Find out through which dev should the packet go */ 3357 3356 memset(&fl6, 0, sizeof(struct flowi6)); 3358 3357 fl6.daddr = targets[i]; 3359 - fl6.flowi6_oif = bond->dev->ifindex; 3360 3358 3361 3359 dst = ip6_route_output(dev_net(bond->dev), NULL, &fl6); 3362 3360 if (dst->error) {
+1 -2
drivers/net/ethernet/broadcom/cnic.c
··· 4230 4230 4231 4231 cnic_bnx2x_delete_wait(dev, 0); 4232 4232 4233 - cancel_delayed_work(&cp->delete_task); 4234 - flush_workqueue(cnic_wq); 4233 + cancel_delayed_work_sync(&cp->delete_task); 4235 4234 4236 4235 if (atomic_read(&cp->iscsi_conn) != 0) 4237 4236 netdev_warn(dev->netdev, "%d iSCSI connections not destroyed\n",
+1 -1
drivers/net/ethernet/cavium/liquidio/request_manager.c
··· 126 126 oct->io_qmask.iq |= BIT_ULL(iq_no); 127 127 128 128 /* Set the 32B/64B mode for each input queue */ 129 - oct->io_qmask.iq64B |= ((conf->instr_type == 64) << iq_no); 129 + oct->io_qmask.iq64B |= ((u64)(conf->instr_type == 64) << iq_no); 130 130 iq->iqcmd_64B = (conf->instr_type == 64); 131 131 132 132 oct->fn_list.setup_iq_regs(oct, iq_no);
+1 -1
drivers/net/ethernet/freescale/dpaa2/dpaa2-switch.c
··· 2736 2736 dev_err(dev, "dpsw_ctrl_if_set_pools() failed\n"); 2737 2737 goto err_get_attr; 2738 2738 } 2739 - ethsw->bpid = dpbp_attrs.id; 2739 + ethsw->bpid = dpbp_attrs.bpid; 2740 2740 2741 2741 return 0; 2742 2742
-3
drivers/net/ethernet/intel/i40e/i40e_txrx.c
··· 948 948 if (!eop_desc) 949 949 break; 950 950 951 - /* prevent any other reads prior to eop_desc */ 952 - smp_rmb(); 953 - 954 951 i40e_trace(clean_tx_irq, tx_ring, tx_desc, tx_buf); 955 952 /* we have caught up to head, no work left to do */ 956 953 if (tx_head == tx_desc)
+34 -46
drivers/net/ethernet/intel/ice/ice_txrx.c
··· 894 894 __skb_fill_page_desc_noacc(sinfo, sinfo->nr_frags++, rx_buf->page, 895 895 rx_buf->page_offset, size); 896 896 sinfo->xdp_frags_size += size; 897 - /* remember frag count before XDP prog execution; bpf_xdp_adjust_tail() 898 - * can pop off frags but driver has to handle it on its own 899 - */ 900 - rx_ring->nr_frags = sinfo->nr_frags; 901 897 902 898 if (page_is_pfmemalloc(rx_buf->page)) 903 899 xdp_buff_set_frag_pfmemalloc(xdp); ··· 964 968 /** 965 969 * ice_get_pgcnts - grab page_count() for gathered fragments 966 970 * @rx_ring: Rx descriptor ring to store the page counts on 971 + * @ntc: the next to clean element (not included in this frame!) 967 972 * 968 973 * This function is intended to be called right before running XDP 969 974 * program so that the page recycling mechanism will be able to take 970 975 * a correct decision regarding underlying pages; this is done in such 971 976 * way as XDP program can change the refcount of page 972 977 */ 973 - static void ice_get_pgcnts(struct ice_rx_ring *rx_ring) 978 + static void ice_get_pgcnts(struct ice_rx_ring *rx_ring, unsigned int ntc) 974 979 { 975 - u32 nr_frags = rx_ring->nr_frags + 1; 976 980 u32 idx = rx_ring->first_desc; 977 981 struct ice_rx_buf *rx_buf; 978 982 u32 cnt = rx_ring->count; 979 983 980 - for (int i = 0; i < nr_frags; i++) { 984 + while (idx != ntc) { 981 985 rx_buf = &rx_ring->rx_buf[idx]; 982 986 rx_buf->pgcnt = page_count(rx_buf->page); 983 987 ··· 1150 1154 } 1151 1155 1152 1156 /** 1153 - * ice_put_rx_mbuf - ice_put_rx_buf() caller, for all frame frags 1157 + * ice_put_rx_mbuf - ice_put_rx_buf() caller, for all buffers in frame 1154 1158 * @rx_ring: Rx ring with all the auxiliary data 1155 1159 * @xdp: XDP buffer carrying linear + frags part 1156 - * @xdp_xmit: XDP_TX/XDP_REDIRECT verdict storage 1157 - * @ntc: a current next_to_clean value to be stored at rx_ring 1160 + * @ntc: the next to clean element (not included in this frame!) 1158 1161 * @verdict: return code from XDP program execution 1159 1162 * 1160 - * Walk through gathered fragments and satisfy internal page 1161 - * recycle mechanism; we take here an action related to verdict 1162 - * returned by XDP program; 1163 + * Called after XDP program is completed, or on error with verdict set to 1164 + * ICE_XDP_CONSUMED. 1165 + * 1166 + * Walk through buffers from first_desc to the end of the frame, releasing 1167 + * buffers and satisfying internal page recycle mechanism. The action depends 1168 + * on verdict from XDP program. 1163 1169 */ 1164 1170 static void ice_put_rx_mbuf(struct ice_rx_ring *rx_ring, struct xdp_buff *xdp, 1165 - u32 *xdp_xmit, u32 ntc, u32 verdict) 1171 + u32 ntc, u32 verdict) 1166 1172 { 1167 - u32 nr_frags = rx_ring->nr_frags + 1; 1168 1173 u32 idx = rx_ring->first_desc; 1169 1174 u32 cnt = rx_ring->count; 1170 - u32 post_xdp_frags = 1; 1171 1175 struct ice_rx_buf *buf; 1172 - int i; 1176 + u32 xdp_frags = 0; 1177 + int i = 0; 1173 1178 1174 1179 if (unlikely(xdp_buff_has_frags(xdp))) 1175 - post_xdp_frags += xdp_get_shared_info_from_buff(xdp)->nr_frags; 1180 + xdp_frags = xdp_get_shared_info_from_buff(xdp)->nr_frags; 1176 1181 1177 - for (i = 0; i < post_xdp_frags; i++) { 1182 + while (idx != ntc) { 1178 1183 buf = &rx_ring->rx_buf[idx]; 1184 + if (++idx == cnt) 1185 + idx = 0; 1179 1186 1180 - if (verdict & (ICE_XDP_TX | ICE_XDP_REDIR)) { 1187 + /* An XDP program could release fragments from the end of the 1188 + * buffer. For these, we need to keep the pagecnt_bias as-is. 1189 + * To do this, only adjust pagecnt_bias for fragments up to 1190 + * the total remaining after the XDP program has run. 1191 + */ 1192 + if (verdict != ICE_XDP_CONSUMED) 1181 1193 ice_rx_buf_adjust_pg_offset(buf, xdp->frame_sz); 1182 - *xdp_xmit |= verdict; 1183 - } else if (verdict & ICE_XDP_CONSUMED) { 1194 + else if (i++ <= xdp_frags) 1184 1195 buf->pagecnt_bias++; 1185 - } else if (verdict == ICE_XDP_PASS) { 1186 - ice_rx_buf_adjust_pg_offset(buf, xdp->frame_sz); 1187 - } 1188 1196 1189 1197 ice_put_rx_buf(rx_ring, buf); 1190 - 1191 - if (++idx == cnt) 1192 - idx = 0; 1193 - } 1194 - /* handle buffers that represented frags released by XDP prog; 1195 - * for these we keep pagecnt_bias as-is; refcount from struct page 1196 - * has been decremented within XDP prog and we do not have to increase 1197 - * the biased refcnt 1198 - */ 1199 - for (; i < nr_frags; i++) { 1200 - buf = &rx_ring->rx_buf[idx]; 1201 - ice_put_rx_buf(rx_ring, buf); 1202 - if (++idx == cnt) 1203 - idx = 0; 1204 1198 } 1205 1199 1206 1200 xdp->data = NULL; 1207 1201 rx_ring->first_desc = ntc; 1208 - rx_ring->nr_frags = 0; 1209 1202 } 1210 1203 1211 1204 /** ··· 1302 1317 /* retrieve a buffer from the ring */ 1303 1318 rx_buf = ice_get_rx_buf(rx_ring, size, ntc); 1304 1319 1320 + /* Increment ntc before calls to ice_put_rx_mbuf() */ 1321 + if (++ntc == cnt) 1322 + ntc = 0; 1323 + 1305 1324 if (!xdp->data) { 1306 1325 void *hard_start; 1307 1326 ··· 1314 1325 xdp_prepare_buff(xdp, hard_start, offset, size, !!offset); 1315 1326 xdp_buff_clear_frags_flag(xdp); 1316 1327 } else if (ice_add_xdp_frag(rx_ring, xdp, rx_buf, size)) { 1317 - ice_put_rx_mbuf(rx_ring, xdp, NULL, ntc, ICE_XDP_CONSUMED); 1328 + ice_put_rx_mbuf(rx_ring, xdp, ntc, ICE_XDP_CONSUMED); 1318 1329 break; 1319 1330 } 1320 - if (++ntc == cnt) 1321 - ntc = 0; 1322 1331 1323 1332 /* skip if it is NOP desc */ 1324 1333 if (ice_is_non_eop(rx_ring, rx_desc)) 1325 1334 continue; 1326 1335 1327 - ice_get_pgcnts(rx_ring); 1336 + ice_get_pgcnts(rx_ring, ntc); 1328 1337 xdp_verdict = ice_run_xdp(rx_ring, xdp, xdp_prog, xdp_ring, rx_desc); 1329 1338 if (xdp_verdict == ICE_XDP_PASS) 1330 1339 goto construct_skb; 1331 1340 total_rx_bytes += xdp_get_buff_len(xdp); 1332 1341 total_rx_pkts++; 1333 1342 1334 - ice_put_rx_mbuf(rx_ring, xdp, &xdp_xmit, ntc, xdp_verdict); 1343 + ice_put_rx_mbuf(rx_ring, xdp, ntc, xdp_verdict); 1344 + xdp_xmit |= xdp_verdict & (ICE_XDP_TX | ICE_XDP_REDIR); 1335 1345 1336 1346 continue; 1337 1347 construct_skb: ··· 1343 1355 rx_ring->ring_stats->rx_stats.alloc_buf_failed++; 1344 1356 xdp_verdict = ICE_XDP_CONSUMED; 1345 1357 } 1346 - ice_put_rx_mbuf(rx_ring, xdp, &xdp_xmit, ntc, xdp_verdict); 1358 + ice_put_rx_mbuf(rx_ring, xdp, ntc, xdp_verdict); 1347 1359 1348 1360 if (!skb) 1349 1361 break;
-1
drivers/net/ethernet/intel/ice/ice_txrx.h
··· 358 358 struct ice_tx_ring *xdp_ring; 359 359 struct ice_rx_ring *next; /* pointer to next ring in q_vector */ 360 360 struct xsk_buff_pool *xsk_pool; 361 - u32 nr_frags; 362 361 u16 max_frame; 363 362 u16 rx_buf_len; 364 363 dma_addr_t dma; /* physical address of ring */
+1
drivers/net/ethernet/intel/igc/igc.h
··· 345 345 /* LEDs */ 346 346 struct mutex led_mutex; 347 347 struct igc_led_classdev *leds; 348 + bool leds_available; 348 349 }; 349 350 350 351 void igc_up(struct igc_adapter *adapter);
+9 -3
drivers/net/ethernet/intel/igc/igc_main.c
··· 7335 7335 7336 7336 if (IS_ENABLED(CONFIG_IGC_LEDS)) { 7337 7337 err = igc_led_setup(adapter); 7338 - if (err) 7339 - goto err_register; 7338 + if (err) { 7339 + netdev_warn_once(netdev, 7340 + "LED init failed (%d); continuing without LED support\n", 7341 + err); 7342 + adapter->leds_available = false; 7343 + } else { 7344 + adapter->leds_available = true; 7345 + } 7340 7346 } 7341 7347 7342 7348 return 0; ··· 7398 7392 cancel_work_sync(&adapter->watchdog_task); 7399 7393 hrtimer_cancel(&adapter->hrtimer); 7400 7394 7401 - if (IS_ENABLED(CONFIG_IGC_LEDS)) 7395 + if (IS_ENABLED(CONFIG_IGC_LEDS) && adapter->leds_available) 7402 7396 igc_led_free(adapter); 7403 7397 7404 7398 /* Release control of h/w to f/w. If f/w is AMT enabled, this
+12 -10
drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
··· 6973 6973 break; 6974 6974 } 6975 6975 6976 + /* Make sure the SWFW semaphore is in a valid state */ 6977 + if (hw->mac.ops.init_swfw_sync) 6978 + hw->mac.ops.init_swfw_sync(hw); 6979 + 6980 + if (hw->mac.type == ixgbe_mac_e610) 6981 + mutex_init(&hw->aci.lock); 6982 + 6976 6983 #ifdef IXGBE_FCOE 6977 6984 /* FCoE support exists, always init the FCoE lock */ 6978 6985 spin_lock_init(&adapter->fcoe.lock); ··· 11650 11643 if (err) 11651 11644 goto err_sw_init; 11652 11645 11653 - /* Make sure the SWFW semaphore is in a valid state */ 11654 - if (hw->mac.ops.init_swfw_sync) 11655 - hw->mac.ops.init_swfw_sync(hw); 11656 - 11657 11646 if (ixgbe_check_fw_error(adapter)) 11658 11647 return ixgbe_recovery_probe(adapter); 11659 11648 ··· 11853 11850 ether_addr_copy(hw->mac.addr, hw->mac.perm_addr); 11854 11851 ixgbe_mac_set_default_filter(adapter); 11855 11852 11856 - if (hw->mac.type == ixgbe_mac_e610) 11857 - mutex_init(&hw->aci.lock); 11858 11853 timer_setup(&adapter->service_timer, ixgbe_service_timer, 0); 11859 11854 11860 11855 if (ixgbe_removed(hw->hw_addr)) { ··· 12008 12007 devl_unlock(adapter->devlink); 12009 12008 ixgbe_release_hw_control(adapter); 12010 12009 ixgbe_clear_interrupt_scheme(adapter); 12010 + err_sw_init: 12011 12011 if (hw->mac.type == ixgbe_mac_e610) 12012 12012 mutex_destroy(&adapter->hw.aci.lock); 12013 - err_sw_init: 12014 12013 ixgbe_disable_sriov(adapter); 12015 12014 adapter->flags2 &= ~IXGBE_FLAG2_SEARCH_FOR_SFP; 12016 12015 iounmap(adapter->io_addr); ··· 12061 12060 set_bit(__IXGBE_REMOVING, &adapter->state); 12062 12061 cancel_work_sync(&adapter->service_task); 12063 12062 12064 - if (adapter->hw.mac.type == ixgbe_mac_e610) { 12063 + if (adapter->hw.mac.type == ixgbe_mac_e610) 12065 12064 ixgbe_disable_link_status_events(adapter); 12066 - mutex_destroy(&adapter->hw.aci.lock); 12067 - } 12068 12065 12069 12066 if (adapter->mii_bus) 12070 12067 mdiobus_unregister(adapter->mii_bus); ··· 12121 12122 bitmap_free(adapter->af_xdp_zc_qps); 12122 12123 disable_dev = !test_and_set_bit(__IXGBE_DISABLED, &adapter->state); 12123 12124 free_netdev(netdev); 12125 + 12126 + if (adapter->hw.mac.type == ixgbe_mac_e610) 12127 + mutex_destroy(&adapter->hw.aci.lock); 12124 12128 12125 12129 if (disable_dev) 12126 12130 pci_disable_device(pdev);
+16
drivers/net/ethernet/marvell/octeon_ep/octep_main.c
··· 1124 1124 return err; 1125 1125 } 1126 1126 1127 + static bool octep_is_vf_valid(struct octep_device *oct, int vf) 1128 + { 1129 + if (vf >= CFG_GET_ACTIVE_VFS(oct->conf)) { 1130 + netdev_err(oct->netdev, "Invalid VF ID %d\n", vf); 1131 + return false; 1132 + } 1133 + 1134 + return true; 1135 + } 1136 + 1127 1137 static int octep_get_vf_config(struct net_device *dev, int vf, 1128 1138 struct ifla_vf_info *ivi) 1129 1139 { 1130 1140 struct octep_device *oct = netdev_priv(dev); 1141 + 1142 + if (!octep_is_vf_valid(oct, vf)) 1143 + return -EINVAL; 1131 1144 1132 1145 ivi->vf = vf; 1133 1146 ether_addr_copy(ivi->mac, oct->vf_info[vf].mac_addr); ··· 1155 1142 { 1156 1143 struct octep_device *oct = netdev_priv(dev); 1157 1144 int err; 1145 + 1146 + if (!octep_is_vf_valid(oct, vf)) 1147 + return -EINVAL; 1158 1148 1159 1149 if (!is_valid_ether_addr(mac)) { 1160 1150 dev_err(&oct->pdev->dev, "Invalid MAC Address %pM\n", mac);
+3
drivers/net/ethernet/marvell/octeon_ep/octep_pfvf_mbox.c
··· 196 196 vf_id); 197 197 return; 198 198 } 199 + ether_addr_copy(oct->vf_info[vf_id].mac_addr, rsp->s_set_mac.mac_addr); 199 200 rsp->s_set_mac.type = OCTEP_PFVF_MBOX_TYPE_RSP_ACK; 200 201 } 201 202 ··· 206 205 { 207 206 int err; 208 207 208 + /* Reset VF-specific information maintained by the PF */ 209 + memset(&oct->vf_info[vf_id], 0, sizeof(struct octep_pfvf_info)); 209 210 err = octep_ctrl_net_dev_remove(oct, vf_id); 210 211 if (err) { 211 212 rsp->s.type = OCTEP_PFVF_MBOX_TYPE_RSP_NACK;
+1 -1
drivers/net/ethernet/marvell/octeontx2/nic/otx2_ptp.c
··· 491 491 if (!ptp) 492 492 return; 493 493 494 - cancel_delayed_work(&pfvf->ptp->synctstamp_work); 494 + cancel_delayed_work_sync(&pfvf->ptp->synctstamp_work); 495 495 496 496 ptp_clock_unregister(ptp->ptp_clock); 497 497 kfree(ptp);
+1
drivers/net/ethernet/mellanox/mlx5/core/en/fs.h
··· 92 92 MLX5E_ACCEL_FS_ESP_FT_LEVEL = MLX5E_INNER_TTC_FT_LEVEL + 1, 93 93 MLX5E_ACCEL_FS_ESP_FT_ERR_LEVEL, 94 94 MLX5E_ACCEL_FS_POL_FT_LEVEL, 95 + MLX5E_ACCEL_FS_POL_MISS_FT_LEVEL, 95 96 MLX5E_ACCEL_FS_ESP_FT_ROCE_LEVEL, 96 97 #endif 97 98 };
+1
drivers/net/ethernet/mellanox/mlx5/core/en_accel/ipsec.h
··· 185 185 u32 family; 186 186 int prio; 187 187 int pol_level; 188 + int pol_miss_level; 188 189 int sa_level; 189 190 int status_level; 190 191 enum mlx5_flow_namespace_type chains_ns;
+2 -1
drivers/net/ethernet/mellanox/mlx5/core/en_accel/ipsec_fs.c
··· 747 747 attr->family = family; 748 748 attr->prio = MLX5E_NIC_PRIO; 749 749 attr->pol_level = MLX5E_ACCEL_FS_POL_FT_LEVEL; 750 + attr->pol_miss_level = MLX5E_ACCEL_FS_POL_MISS_FT_LEVEL; 750 751 attr->sa_level = MLX5E_ACCEL_FS_ESP_FT_LEVEL; 751 752 attr->status_level = MLX5E_ACCEL_FS_ESP_FT_ERR_LEVEL; 752 753 attr->chains_ns = MLX5_FLOW_NAMESPACE_KERNEL; ··· 834 833 835 834 ft_attr.max_fte = 1; 836 835 ft_attr.autogroup.max_num_groups = 1; 837 - ft_attr.level = attr->pol_level; 836 + ft_attr.level = attr->pol_miss_level; 838 837 ft_attr.prio = attr->prio; 839 838 840 839 ft = mlx5_create_auto_grouped_flow_table(attr->ns, &ft_attr);
-2
drivers/net/ethernet/mellanox/mlx5/core/en_main.c
··· 139 139 if (up) { 140 140 netdev_info(priv->netdev, "Link up\n"); 141 141 netif_carrier_on(priv->netdev); 142 - mlx5e_port_manual_buffer_config(priv, 0, priv->netdev->mtu, 143 - NULL, NULL, NULL); 144 142 } else { 145 143 netdev_info(priv->netdev, "Link down\n"); 146 144 netif_carrier_off(priv->netdev);
+22 -5
drivers/net/ethernet/mellanox/mlx5/core/en_rep.c
··· 1506 1506 static int 1507 1507 mlx5e_vport_uplink_rep_load(struct mlx5_core_dev *dev, struct mlx5_eswitch_rep *rep) 1508 1508 { 1509 - struct mlx5e_priv *priv = netdev_priv(mlx5_uplink_netdev_get(dev)); 1510 1509 struct mlx5e_rep_priv *rpriv = mlx5e_rep_to_rep_priv(rep); 1510 + struct net_device *netdev; 1511 + struct mlx5e_priv *priv; 1512 + int err; 1511 1513 1514 + netdev = mlx5_uplink_netdev_get(dev); 1515 + if (!netdev) 1516 + return 0; 1517 + 1518 + priv = netdev_priv(netdev); 1512 1519 rpriv->netdev = priv->netdev; 1513 - return mlx5e_netdev_change_profile(priv, &mlx5e_uplink_rep_profile, 1514 - rpriv); 1520 + err = mlx5e_netdev_change_profile(priv, &mlx5e_uplink_rep_profile, 1521 + rpriv); 1522 + mlx5_uplink_netdev_put(dev, netdev); 1523 + return err; 1515 1524 } 1516 1525 1517 1526 static void ··· 1647 1638 { 1648 1639 struct mlx5e_rep_priv *rpriv = mlx5e_rep_to_rep_priv(rep); 1649 1640 struct net_device *netdev = rpriv->netdev; 1650 - struct mlx5e_priv *priv = netdev_priv(netdev); 1651 - void *ppriv = priv->ppriv; 1641 + struct mlx5e_priv *priv; 1642 + void *ppriv; 1643 + 1644 + if (!netdev) { 1645 + ppriv = rpriv; 1646 + goto free_ppriv; 1647 + } 1648 + 1649 + priv = netdev_priv(netdev); 1650 + ppriv = priv->ppriv; 1652 1651 1653 1652 if (rep->vport == MLX5_VPORT_UPLINK) { 1654 1653 mlx5e_vport_uplink_rep_unload(rpriv);
+1
drivers/net/ethernet/mellanox/mlx5/core/esw/qos.c
··· 1515 1515 speed = lksettings.base.speed; 1516 1516 1517 1517 out: 1518 + mlx5_uplink_netdev_put(mdev, slave); 1518 1519 return speed; 1519 1520 } 1520 1521
+2 -2
drivers/net/ethernet/mellanox/mlx5/core/fs_core.c
··· 114 114 #define ETHTOOL_NUM_PRIOS 11 115 115 #define ETHTOOL_MIN_LEVEL (KERNEL_MIN_LEVEL + ETHTOOL_NUM_PRIOS) 116 116 /* Vlan, mac, ttc, inner ttc, {UDP/ANY/aRFS/accel/{esp, esp_err}}, IPsec policy, 117 - * {IPsec RoCE MPV,Alias table},IPsec RoCE policy 117 + * IPsec policy miss, {IPsec RoCE MPV,Alias table},IPsec RoCE policy 118 118 */ 119 - #define KERNEL_NIC_PRIO_NUM_LEVELS 10 119 + #define KERNEL_NIC_PRIO_NUM_LEVELS 11 120 120 #define KERNEL_NIC_NUM_PRIOS 1 121 121 /* One more level for tc, and one more for promisc */ 122 122 #define KERNEL_MIN_LEVEL (KERNEL_NIC_PRIO_NUM_LEVELS + 2)
+14 -1
drivers/net/ethernet/mellanox/mlx5/core/lib/mlx5.h
··· 47 47 48 48 static inline struct net_device *mlx5_uplink_netdev_get(struct mlx5_core_dev *mdev) 49 49 { 50 - return mdev->mlx5e_res.uplink_netdev; 50 + struct mlx5e_resources *mlx5e_res = &mdev->mlx5e_res; 51 + struct net_device *netdev; 52 + 53 + mutex_lock(&mlx5e_res->uplink_netdev_lock); 54 + netdev = mlx5e_res->uplink_netdev; 55 + netdev_hold(netdev, &mlx5e_res->tracker, GFP_KERNEL); 56 + mutex_unlock(&mlx5e_res->uplink_netdev_lock); 57 + return netdev; 58 + } 59 + 60 + static inline void mlx5_uplink_netdev_put(struct mlx5_core_dev *mdev, 61 + struct net_device *netdev) 62 + { 63 + netdev_put(netdev, &mdev->mlx5e_res.tracker); 51 64 } 52 65 53 66 struct mlx5_sd;
+5 -1
drivers/net/ethernet/mellanox/mlx5/core/port.c
··· 1170 1170 mlx5e_port_get_link_mode_info_arr(mdev, &table, &max_size, 1171 1171 force_legacy); 1172 1172 i = find_first_bit(&temp, max_size); 1173 - if (i < max_size) 1173 + 1174 + /* mlx5e_link_info has holes. Check speed 1175 + * is not zero as indication of one. 1176 + */ 1177 + if (i < max_size && table[i].speed) 1174 1178 return &table[i]; 1175 1179 1176 1180 return NULL;
+6 -7
drivers/net/ethernet/natsemi/ns83820.c
··· 820 820 struct ns83820 *dev = PRIV(ndev); 821 821 struct rx_info *info = &dev->rx_info; 822 822 unsigned next_rx; 823 - int rx_rc, len; 823 + int len; 824 824 u32 cmdsts; 825 825 __le32 *desc; 826 826 unsigned long flags; ··· 881 881 if (likely(CMDSTS_OK & cmdsts)) { 882 882 #endif 883 883 skb_put(skb, len); 884 - if (unlikely(!skb)) 884 + if (unlikely(!skb)) { 885 + ndev->stats.rx_dropped++; 885 886 goto netdev_mangle_me_harder_failed; 887 + } 886 888 if (cmdsts & CMDSTS_DEST_MULTI) 887 889 ndev->stats.multicast++; 888 890 ndev->stats.rx_packets++; ··· 903 901 __vlan_hwaccel_put_tag(skb, htons(ETH_P_IPV6), tag); 904 902 } 905 903 #endif 906 - rx_rc = netif_rx(skb); 907 - if (NET_RX_DROP == rx_rc) { 908 - netdev_mangle_me_harder_failed: 909 - ndev->stats.rx_dropped++; 910 - } 904 + netif_rx(skb); 911 905 } else { 912 906 dev_kfree_skb_irq(skb); 913 907 } 914 908 909 + netdev_mangle_me_harder_failed: 915 910 nr++; 916 911 next_rx = info->next_rx; 917 912 desc = info->descs + (DESC_SIZE * next_rx);
+4 -3
drivers/net/ethernet/qlogic/qed/qed_debug.c
··· 4462 4462 goto out; 4463 4463 } 4464 4464 4465 - /* Add override window info to buffer */ 4465 + /* Add override window info to buffer, preventing buffer overflow */ 4466 4466 override_window_dwords = 4467 - qed_rd(p_hwfn, p_ptt, GRC_REG_NUMBER_VALID_OVERRIDE_WINDOW) * 4468 - PROTECTION_OVERRIDE_ELEMENT_DWORDS; 4467 + min(qed_rd(p_hwfn, p_ptt, GRC_REG_NUMBER_VALID_OVERRIDE_WINDOW) * 4468 + PROTECTION_OVERRIDE_ELEMENT_DWORDS, 4469 + PROTECTION_OVERRIDE_DEPTH_DWORDS); 4469 4470 if (override_window_dwords) { 4470 4471 addr = BYTES_TO_DWORDS(GRC_REG_PROTECTION_OVERRIDE_WINDOW); 4471 4472 offset += qed_grc_dump_addr_range(p_hwfn,
+1 -1
drivers/net/wireless/intel/iwlwifi/pcie/gen1_2/tx.c
··· 2092 2092 break; 2093 2093 } 2094 2094 2095 - if (trans->mac_cfg->device_family >= IWL_DEVICE_FAMILY_9000 && 2095 + if (trans->mac_cfg->device_family >= IWL_DEVICE_FAMILY_7000 && 2096 2096 trans->mac_cfg->device_family < IWL_DEVICE_FAMILY_AX210) 2097 2097 len = DIV_ROUND_UP(len, 4); 2098 2098
+1
include/linux/mlx5/driver.h
··· 663 663 bool tisn_valid; 664 664 } hw_objs; 665 665 struct net_device *uplink_netdev; 666 + netdevice_tracker tracker; 666 667 struct mutex uplink_netdev_lock; 667 668 struct mlx5_crypto_dek_priv *dek_priv; 668 669 };
+9 -2
include/net/dst_metadata.h
··· 3 3 #define __NET_DST_METADATA_H 1 4 4 5 5 #include <linux/skbuff.h> 6 + #include <net/ip.h> 6 7 #include <net/ip_tunnels.h> 7 8 #include <net/macsec.h> 8 9 #include <net/dst.h> ··· 221 220 int md_size) 222 221 { 223 222 const struct iphdr *iph = ip_hdr(skb); 223 + struct metadata_dst *tun_dst; 224 224 225 - return __ip_tun_set_dst(iph->saddr, iph->daddr, iph->tos, iph->ttl, 226 - 0, flags, tunnel_id, md_size); 225 + tun_dst = __ip_tun_set_dst(iph->saddr, iph->daddr, iph->tos, iph->ttl, 226 + 0, flags, tunnel_id, md_size); 227 + 228 + if (tun_dst && (iph->frag_off & htons(IP_DF))) 229 + __set_bit(IP_TUNNEL_DONT_FRAGMENT_BIT, 230 + tun_dst->u.tun_info.key.tun_flags); 231 + return tun_dst; 227 232 } 228 233 229 234 static inline struct metadata_dst *__ipv6_tun_set_dst(const struct in6_addr *saddr,
+3 -2
include/net/sock.h
··· 2061 2061 if (sock) { 2062 2062 WRITE_ONCE(sk->sk_uid, SOCK_INODE(sock)->i_uid); 2063 2063 WRITE_ONCE(sk->sk_ino, SOCK_INODE(sock)->i_ino); 2064 + } else { 2065 + /* Note: sk_uid is unchanged. */ 2066 + WRITE_ONCE(sk->sk_ino, 0); 2064 2067 } 2065 2068 } 2066 2069 ··· 2085 2082 sock_set_flag(sk, SOCK_DEAD); 2086 2083 sk_set_socket(sk, NULL); 2087 2084 sk->sk_wq = NULL; 2088 - /* Note: sk_uid is unchanged. */ 2089 - WRITE_ONCE(sk->sk_ino, 0); 2090 2085 write_unlock_bh(&sk->sk_callback_lock); 2091 2086 } 2092 2087
+2
include/uapi/linux/mptcp.h
··· 31 31 #define MPTCP_INFO_FLAG_FALLBACK _BITUL(0) 32 32 #define MPTCP_INFO_FLAG_REMOTE_KEY_RECEIVED _BITUL(1) 33 33 34 + #define MPTCP_PM_EV_FLAG_DENY_JOIN_ID0 _BITUL(0) 35 + 34 36 #define MPTCP_PM_ADDR_FLAG_SIGNAL (1 << 0) 35 37 #define MPTCP_PM_ADDR_FLAG_SUBFLOW (1 << 1) 36 38 #define MPTCP_PM_ADDR_FLAG_BACKUP (1 << 2)
+2 -2
include/uapi/linux/mptcp_pm.h
··· 16 16 * good time to allocate memory and send ADD_ADDR if needed. Depending on the 17 17 * traffic-patterns it can take a long time until the MPTCP_EVENT_ESTABLISHED 18 18 * is sent. Attributes: token, family, saddr4 | saddr6, daddr4 | daddr6, 19 - * sport, dport, server-side. 19 + * sport, dport, server-side, [flags]. 20 20 * @MPTCP_EVENT_ESTABLISHED: A MPTCP connection is established (can start new 21 21 * subflows). Attributes: token, family, saddr4 | saddr6, daddr4 | daddr6, 22 - * sport, dport, server-side. 22 + * sport, dport, server-side, [flags]. 23 23 * @MPTCP_EVENT_CLOSED: A MPTCP connection has stopped. Attribute: token. 24 24 * @MPTCP_EVENT_ANNOUNCED: A new address has been announced by the peer. 25 25 * Attributes: token, rem_id, family, daddr4 | daddr6 [, dport].
+1 -1
net/core/dev.c
··· 6965 6965 * the kthread. 6966 6966 */ 6967 6967 while (true) { 6968 - if (!test_bit(NAPIF_STATE_SCHED_THREADED, &napi->state)) 6968 + if (!test_bit(NAPI_STATE_SCHED_THREADED, &napi->state)) 6969 6969 break; 6970 6970 6971 6971 msleep(20);
+2 -2
net/devlink/rate.c
··· 34 34 static struct devlink_rate * 35 35 devlink_rate_node_get_by_name(struct devlink *devlink, const char *node_name) 36 36 { 37 - static struct devlink_rate *devlink_rate; 37 + struct devlink_rate *devlink_rate; 38 38 39 39 list_for_each_entry(devlink_rate, &devlink->rate_list, list) { 40 40 if (devlink_rate_is_node(devlink_rate) && ··· 819 819 */ 820 820 void devl_rate_nodes_destroy(struct devlink *devlink) 821 821 { 822 - static struct devlink_rate *devlink_rate, *tmp; 823 822 const struct devlink_ops *ops = devlink->ops; 823 + struct devlink_rate *devlink_rate, *tmp; 824 824 825 825 devl_assert_locked(devlink); 826 826
+2 -2
net/ethtool/common.c
··· 905 905 int err; 906 906 907 907 if (!ops->get_ts_info) 908 - return -ENODEV; 908 + return -EOPNOTSUPP; 909 909 910 910 /* Does ptp comes from netdev */ 911 911 ethtool_init_tsinfo(info); ··· 973 973 int err; 974 974 975 975 err = ethtool_net_get_ts_info_by_phc(dev, info, hwprov_desc); 976 - if (err == -ENODEV) { 976 + if (err == -ENODEV || err == -EOPNOTSUPP) { 977 977 struct phy_device *phy; 978 978 979 979 phy = ethtool_phy_get_ts_info_by_phc(dev, info, hwprov_desc);
+5
net/ipv4/tcp.c
··· 3327 3327 struct inet_connection_sock *icsk = inet_csk(sk); 3328 3328 struct tcp_sock *tp = tcp_sk(sk); 3329 3329 int old_state = sk->sk_state; 3330 + struct request_sock *req; 3330 3331 u32 seq; 3331 3332 3332 3333 if (old_state != TCP_CLOSE) ··· 3443 3442 3444 3443 3445 3444 /* Clean up fastopen related fields */ 3445 + req = rcu_dereference_protected(tp->fastopen_rsk, 3446 + lockdep_sock_is_held(sk)); 3447 + if (req) 3448 + reqsk_fastopen_remove(sk, req, false); 3446 3449 tcp_free_fastopen_req(tp); 3447 3450 inet_clear_bit(DEFER_CONNECT, sk); 3448 3451 tp->fastopen_client_fail = 0;
+3 -1
net/ipv4/tcp_ao.c
··· 1178 1178 if (!ao) 1179 1179 return; 1180 1180 1181 - WRITE_ONCE(ao->risn, tcp_hdr(skb)->seq); 1181 + /* sk with TCP_REPAIR_ON does not have skb in tcp_finish_connect */ 1182 + if (skb) 1183 + WRITE_ONCE(ao->risn, tcp_hdr(skb)->seq); 1182 1184 ao->rcv_sne = 0; 1183 1185 1184 1186 hlist_for_each_entry_rcu(key, &ao->head, node, lockdep_sock_is_held(sk))
+3 -3
net/mptcp/options.c
··· 985 985 return false; 986 986 } 987 987 988 - if (mp_opt->deny_join_id0) 989 - WRITE_ONCE(msk->pm.remote_deny_join_id0, true); 990 - 991 988 if (unlikely(!READ_ONCE(msk->pm.server_side))) 992 989 pr_warn_once("bogus mpc option on established client sk"); 993 990 994 991 set_fully_established: 992 + if (mp_opt->deny_join_id0) 993 + WRITE_ONCE(msk->pm.remote_deny_join_id0, true); 994 + 995 995 mptcp_data_lock((struct sock *)msk); 996 996 __mptcp_subflow_fully_established(msk, subflow, mp_opt); 997 997 mptcp_data_unlock((struct sock *)msk);
+7
net/mptcp/pm_netlink.c
··· 408 408 const struct sock *ssk) 409 409 { 410 410 int err = nla_put_u32(skb, MPTCP_ATTR_TOKEN, READ_ONCE(msk->token)); 411 + u16 flags = 0; 411 412 412 413 if (err) 413 414 return err; 414 415 415 416 if (nla_put_u8(skb, MPTCP_ATTR_SERVER_SIDE, READ_ONCE(msk->pm.server_side))) 417 + return -EMSGSIZE; 418 + 419 + if (READ_ONCE(msk->pm.remote_deny_join_id0)) 420 + flags |= MPTCP_PM_EV_FLAG_DENY_JOIN_ID0; 421 + 422 + if (flags && nla_put_u16(skb, MPTCP_ATTR_FLAGS, flags)) 416 423 return -EMSGSIZE; 417 424 418 425 return mptcp_event_add_subflow(skb, ssk);
+16
net/mptcp/protocol.c
··· 371 371 sk_wake_async(sk, SOCK_WAKE_WAITD, POLL_IN); 372 372 } 373 373 374 + static void mptcp_shutdown_subflows(struct mptcp_sock *msk) 375 + { 376 + struct mptcp_subflow_context *subflow; 377 + 378 + mptcp_for_each_subflow(msk, subflow) { 379 + struct sock *ssk = mptcp_subflow_tcp_sock(subflow); 380 + bool slow; 381 + 382 + slow = lock_sock_fast(ssk); 383 + tcp_shutdown(ssk, SEND_SHUTDOWN); 384 + unlock_sock_fast(ssk, slow); 385 + } 386 + } 387 + 374 388 /* called under the msk socket lock */ 375 389 static bool mptcp_pending_data_fin_ack(struct sock *sk) 376 390 { ··· 409 395 break; 410 396 case TCP_CLOSING: 411 397 case TCP_LAST_ACK: 398 + mptcp_shutdown_subflows(msk); 412 399 mptcp_set_state(sk, TCP_CLOSE); 413 400 break; 414 401 } ··· 578 563 mptcp_set_state(sk, TCP_CLOSING); 579 564 break; 580 565 case TCP_FIN_WAIT2: 566 + mptcp_shutdown_subflows(msk); 581 567 mptcp_set_state(sk, TCP_CLOSE); 582 568 break; 583 569 default:
+4
net/mptcp/subflow.c
··· 883 883 884 884 ctx->subflow_id = 1; 885 885 owner = mptcp_sk(ctx->conn); 886 + 887 + if (mp_opt.deny_join_id0) 888 + WRITE_ONCE(owner->pm.remote_deny_join_id0, true); 889 + 886 890 mptcp_pm_new_connection(owner, child, 1); 887 891 888 892 /* with OoO packets we can reach here without ingress
+12 -8
net/rds/ib_frmr.c
··· 133 133 134 134 ret = ib_map_mr_sg_zbva(frmr->mr, ibmr->sg, ibmr->sg_dma_len, 135 135 &off, PAGE_SIZE); 136 - if (unlikely(ret != ibmr->sg_dma_len)) 137 - return ret < 0 ? ret : -EINVAL; 136 + if (unlikely(ret != ibmr->sg_dma_len)) { 137 + ret = ret < 0 ? ret : -EINVAL; 138 + goto out_inc; 139 + } 138 140 139 - if (cmpxchg(&frmr->fr_state, 140 - FRMR_IS_FREE, FRMR_IS_INUSE) != FRMR_IS_FREE) 141 - return -EBUSY; 141 + if (cmpxchg(&frmr->fr_state, FRMR_IS_FREE, FRMR_IS_INUSE) != FRMR_IS_FREE) { 142 + ret = -EBUSY; 143 + goto out_inc; 144 + } 142 145 143 146 atomic_inc(&ibmr->ic->i_fastreg_inuse_count); 144 147 ··· 169 166 /* Failure here can be because of -ENOMEM as well */ 170 167 rds_transition_frwr_state(ibmr, FRMR_IS_INUSE, FRMR_IS_STALE); 171 168 172 - atomic_inc(&ibmr->ic->i_fastreg_wrs); 173 169 if (printk_ratelimit()) 174 170 pr_warn("RDS/IB: %s returned error(%d)\n", 175 171 __func__, ret); 176 - goto out; 172 + goto out_inc; 177 173 } 178 174 179 175 /* Wait for the registration to complete in order to prevent an invalid ··· 181 179 */ 182 180 wait_event(frmr->fr_reg_done, !frmr->fr_reg); 183 181 184 - out: 182 + return ret; 185 183 184 + out_inc: 185 + atomic_inc(&ibmr->ic->i_fastreg_wrs); 186 186 return ret; 187 187 } 188 188
+2 -2
net/rfkill/rfkill-gpio.c
··· 94 94 static int rfkill_gpio_probe(struct platform_device *pdev) 95 95 { 96 96 struct rfkill_gpio_data *rfkill; 97 - struct gpio_desc *gpio; 97 + const char *type_name = NULL; 98 98 const char *name_property; 99 99 const char *type_property; 100 - const char *type_name; 100 + struct gpio_desc *gpio; 101 101 int ret; 102 102 103 103 if (dmi_check_system(rfkill_gpio_deny_table))
+10 -8
net/rxrpc/rxgk.c
··· 475 475 struct krb5_buffer metadata; 476 476 unsigned int offset = sp->offset, len = sp->len; 477 477 size_t data_offset = 0, data_len = len; 478 - u32 ac; 478 + u32 ac = 0; 479 479 int ret = -ENOMEM; 480 480 481 481 _enter(""); ··· 499 499 ret = rxgk_verify_mic_skb(gk->krb5, gk->rx_Kc, &metadata, 500 500 skb, &offset, &len, &ac); 501 501 kfree(hdr); 502 - if (ret == -EPROTO) { 503 - rxrpc_abort_eproto(call, skb, ac, 504 - rxgk_abort_1_verify_mic_eproto); 502 + if (ret < 0) { 503 + if (ret != -ENOMEM) 504 + rxrpc_abort_eproto(call, skb, ac, 505 + rxgk_abort_1_verify_mic_eproto); 505 506 } else { 506 507 sp->offset = offset; 507 508 sp->len = len; ··· 525 524 struct rxgk_header hdr; 526 525 unsigned int offset = sp->offset, len = sp->len; 527 526 int ret; 528 - u32 ac; 527 + u32 ac = 0; 529 528 530 529 _enter(""); 531 530 532 531 ret = rxgk_decrypt_skb(gk->krb5, gk->rx_enc, skb, &offset, &len, &ac); 533 - if (ret == -EPROTO) 534 - rxrpc_abort_eproto(call, skb, ac, rxgk_abort_2_decrypt_eproto); 535 - if (ret < 0) 532 + if (ret < 0) { 533 + if (ret != -ENOMEM) 534 + rxrpc_abort_eproto(call, skb, ac, rxgk_abort_2_decrypt_eproto); 536 535 goto error; 536 + } 537 537 538 538 if (len < sizeof(hdr)) { 539 539 ret = rxrpc_abort_eproto(call, skb, RXGK_PACKETSHORT,
+20 -9
net/rxrpc/rxgk_app.c
··· 54 54 55 55 _enter(""); 56 56 57 + if (ticket_len < 10 * sizeof(__be32)) 58 + return rxrpc_abort_conn(conn, skb, RXGK_INCONSISTENCY, -EPROTO, 59 + rxgk_abort_resp_short_yfs_tkt); 60 + 57 61 /* Get the session key length */ 58 62 ret = skb_copy_bits(skb, ticket_offset, tmp, sizeof(tmp)); 59 63 if (ret < 0) ··· 191 187 struct key *server_key; 192 188 unsigned int ticket_offset, ticket_len; 193 189 u32 kvno, enctype; 194 - int ret, ec; 190 + int ret, ec = 0; 195 191 196 192 struct { 197 193 __be32 kvno; ··· 199 195 __be32 token_len; 200 196 } container; 201 197 198 + if (token_len < sizeof(container)) 199 + goto short_packet; 200 + 202 201 /* Decode the RXGK_TokenContainer object. This tells us which server 203 202 * key we should be using. We can then fetch the key, get the secret 204 203 * and set up the crypto to extract the token. 205 204 */ 206 205 if (skb_copy_bits(skb, token_offset, &container, sizeof(container)) < 0) 207 - return rxrpc_abort_conn(conn, skb, RXGK_PACKETSHORT, -EPROTO, 208 - rxgk_abort_resp_tok_short); 206 + goto short_packet; 209 207 210 208 kvno = ntohl(container.kvno); 211 209 enctype = ntohl(container.enctype); 212 210 ticket_len = ntohl(container.token_len); 213 211 ticket_offset = token_offset + sizeof(container); 214 212 215 - if (xdr_round_up(ticket_len) > token_len - 3 * 4) 216 - return rxrpc_abort_conn(conn, skb, RXGK_PACKETSHORT, -EPROTO, 217 - rxgk_abort_resp_tok_short); 213 + if (xdr_round_up(ticket_len) > token_len - sizeof(container)) 214 + goto short_packet; 218 215 219 216 _debug("KVNO %u", kvno); 220 217 _debug("ENC %u", enctype); ··· 241 236 &ticket_offset, &ticket_len, &ec); 242 237 crypto_free_aead(token_enc); 243 238 token_enc = NULL; 244 - if (ret < 0) 245 - return rxrpc_abort_conn(conn, skb, ec, ret, 246 - rxgk_abort_resp_tok_dec); 239 + if (ret < 0) { 240 + if (ret != -ENOMEM) 241 + return rxrpc_abort_conn(conn, skb, ec, ret, 242 + rxgk_abort_resp_tok_dec); 243 + } 247 244 248 245 ret = conn->security->default_decode_ticket(conn, skb, ticket_offset, 249 246 ticket_len, _key); ··· 290 283 * also come out this way if the ticket decryption fails. 291 284 */ 292 285 return ret; 286 + 287 + short_packet: 288 + return rxrpc_abort_conn(conn, skb, RXGK_PACKETSHORT, -EPROTO, 289 + rxgk_abort_resp_tok_short); 293 290 }
+12 -2
net/rxrpc/rxgk_common.h
··· 88 88 *_offset += offset; 89 89 *_len = len; 90 90 break; 91 + case -EBADMSG: /* Checksum mismatch. */ 91 92 case -EPROTO: 92 - case -EBADMSG: 93 93 *_error_code = RXGK_SEALEDINCON; 94 94 break; 95 + case -EMSGSIZE: 96 + *_error_code = RXGK_PACKETSHORT; 97 + break; 98 + case -ENOPKG: /* Would prefer RXGK_BADETYPE, but not available for YFS. */ 95 99 default: 100 + *_error_code = RXGK_INCONSISTENCY; 96 101 break; 97 102 } 98 103 ··· 132 127 *_offset += offset; 133 128 *_len = len; 134 129 break; 130 + case -EBADMSG: /* Checksum mismatch */ 135 131 case -EPROTO: 136 - case -EBADMSG: 137 132 *_error_code = RXGK_SEALEDINCON; 138 133 break; 134 + case -EMSGSIZE: 135 + *_error_code = RXGK_PACKETSHORT; 136 + break; 137 + case -ENOPKG: /* Would prefer RXGK_BADETYPE, but not available for YFS. */ 139 138 default: 139 + *_error_code = RXGK_INCONSISTENCY; 140 140 break; 141 141 } 142 142
+1
net/tls/tls.h
··· 141 141 142 142 int wait_on_pending_writer(struct sock *sk, long *timeo); 143 143 void tls_err_abort(struct sock *sk, int err); 144 + void tls_strp_abort_strp(struct tls_strparser *strp, int err); 144 145 145 146 int init_prot_info(struct tls_prot_info *prot, 146 147 const struct tls_crypto_info *crypto_info,
+9 -5
net/tls/tls_strp.c
··· 13 13 14 14 static struct workqueue_struct *tls_strp_wq; 15 15 16 - static void tls_strp_abort_strp(struct tls_strparser *strp, int err) 16 + void tls_strp_abort_strp(struct tls_strparser *strp, int err) 17 17 { 18 18 if (strp->stopped) 19 19 return; ··· 211 211 struct sk_buff *in_skb, unsigned int offset, 212 212 size_t in_len) 213 213 { 214 + unsigned int nfrag = skb->len / PAGE_SIZE; 214 215 size_t len, chunk; 215 216 skb_frag_t *frag; 216 217 int sz; 217 218 218 - frag = &skb_shinfo(skb)->frags[skb->len / PAGE_SIZE]; 219 + if (unlikely(nfrag >= skb_shinfo(skb)->nr_frags)) { 220 + DEBUG_NET_WARN_ON_ONCE(1); 221 + return -EMSGSIZE; 222 + } 223 + 224 + frag = &skb_shinfo(skb)->frags[nfrag]; 219 225 220 226 len = in_len; 221 227 /* First make sure we got the header */ ··· 526 520 tls_strp_load_anchor_with_queue(strp, inq); 527 521 if (!strp->stm.full_len) { 528 522 sz = tls_rx_msg_size(strp, strp->anchor); 529 - if (sz < 0) { 530 - tls_strp_abort_strp(strp, sz); 523 + if (sz < 0) 531 524 return sz; 532 - } 533 525 534 526 strp->stm.full_len = sz; 535 527
+1 -2
net/tls/tls_sw.c
··· 2474 2474 return data_len + TLS_HEADER_SIZE; 2475 2475 2476 2476 read_failure: 2477 - tls_err_abort(strp->sk, ret); 2478 - 2477 + tls_strp_abort_strp(strp, ret); 2479 2478 return ret; 2480 2479 } 2481 2480
+195 -2
tools/testing/selftests/drivers/net/bonding/bond_options.sh
··· 7 7 prio 8 8 arp_validate 9 9 num_grat_arp 10 + fail_over_mac 11 + vlan_over_bond 10 12 " 11 13 12 14 lib_dir=$(dirname "$0") ··· 354 352 355 353 exp_num=$(echo "${param}" | cut -f6 -d ' ') 356 354 active_slave=$(cmd_jq "ip -n ${s_ns} -d -j link show bond0" ".[].linkinfo.info_data.active_slave") 357 - slowwait_for_counter $((exp_num + 5)) $exp_num \ 358 - tc_rule_handle_stats_get "dev s${active_slave#eth} ingress" 101 ".packets" "-n ${g_ns}" 355 + slowwait_for_counter $((exp_num + 5)) $exp_num tc_rule_handle_stats_get \ 356 + "dev s${active_slave#eth} ingress" 101 ".packets" "-n ${g_ns}" &> /dev/null 359 357 360 358 # check result 361 359 real_num=$(tc_rule_handle_stats_get "dev s${active_slave#eth} ingress" 101 ".packets" "-n ${g_ns}") ··· 376 374 garp_test "mode active-backup miimon 10 num_grat_arp $val peer_notify_delay 100" 377 375 log_test "num_grat_arp" "active-backup miimon num_grat_arp $val" 378 376 done 377 + } 378 + 379 + check_all_mac_same() 380 + { 381 + RET=0 382 + # all slaves should have same mac address (with the first port's mac) 383 + local bond_mac=$(ip -n "$s_ns" -j link show bond0 | jq -r '.[]["address"]') 384 + local eth0_mac=$(ip -n "$s_ns" -j link show eth0 | jq -r '.[]["address"]') 385 + local eth1_mac=$(ip -n "$s_ns" -j link show eth1 | jq -r '.[]["address"]') 386 + local eth2_mac=$(ip -n "$s_ns" -j link show eth2 | jq -r '.[]["address"]') 387 + if [ "$bond_mac" != "${mac[0]}" ] || [ "$eth0_mac" != "$bond_mac" ] || \ 388 + [ "$eth1_mac" != "$bond_mac" ] || [ "$eth2_mac" != "$bond_mac" ]; then 389 + RET=1 390 + fi 391 + } 392 + 393 + check_bond_mac_same_with_first() 394 + { 395 + RET=0 396 + # bond mac address should be same with the first added slave 397 + local bond_mac=$(ip -n "$s_ns" -j link show bond0 | jq -r '.[]["address"]') 398 + if [ "$bond_mac" != "${mac[0]}" ]; then 399 + RET=1 400 + fi 401 + } 402 + 403 + check_bond_mac_same_with_active() 404 + { 405 + RET=0 406 + # bond mac address should be same with active slave 407 + local bond_mac=$(ip -n "$s_ns" -j link show bond0 | jq -r '.[]["address"]') 408 + local active_slave=$(cmd_jq "ip -n ${s_ns} -d -j link show bond0" ".[].linkinfo.info_data.active_slave") 409 + local active_slave_mac=$(ip -n "$s_ns" -j link show "$active_slave" | jq -r '.[]["address"]') 410 + if [ "$bond_mac" != "$active_slave_mac" ]; then 411 + RET=1 412 + fi 413 + } 414 + 415 + check_backup_slave_mac_not_change() 416 + { 417 + RET=0 418 + # backup slave's mac address is not changed 419 + if ip -n "$s_ns" -d -j link show type bond_slave | jq -e '.[] 420 + | select(.linkinfo.info_slave_data.state=="BACKUP") 421 + | select(.address != .linkinfo.info_slave_data.perm_hwaddr)' &> /dev/null; then 422 + RET=1 423 + fi 424 + } 425 + 426 + check_backup_slave_mac_inherit() 427 + { 428 + local backup_mac 429 + RET=0 430 + 431 + # backup slaves should use mac[1] or mac[2] 432 + local backup_macs=$(ip -n "$s_ns" -d -j link show type bond_slave | \ 433 + jq -r '.[] | select(.linkinfo.info_slave_data.state=="BACKUP") | .address') 434 + for backup_mac in $backup_macs; do 435 + if [ "$backup_mac" != "${mac[1]}" ] && [ "$backup_mac" != "${mac[2]}" ]; then 436 + RET=1 437 + fi 438 + done 439 + } 440 + 441 + check_first_slave_random_mac() 442 + { 443 + RET=0 444 + # remove the first added slave and added it back 445 + ip -n "$s_ns" link set eth0 nomaster 446 + ip -n "$s_ns" link set eth0 master bond0 447 + 448 + # the first slave should use random mac address 449 + eth0_mac=$(ip -n "$s_ns" -j link show eth0 | jq -r '.[]["address"]') 450 + [ "$eth0_mac" = "${mac[0]}" ] && RET=1 451 + log_test "bond fail_over_mac follow" "random first slave mac" 452 + 453 + # remove the first slave, the permanent MAC address should be restored back 454 + ip -n "$s_ns" link set eth0 nomaster 455 + eth0_mac=$(ip -n "$s_ns" -j link show eth0 | jq -r '.[]["address"]') 456 + [ "$eth0_mac" != "${mac[0]}" ] && RET=1 457 + } 458 + 459 + do_active_backup_failover() 460 + { 461 + local active_slave=$(cmd_jq "ip -n ${s_ns} -d -j link show bond0" ".[].linkinfo.info_data.active_slave") 462 + ip -n ${s_ns} link set ${active_slave} down 463 + slowwait 2 active_slave_changed $active_slave 464 + ip -n ${s_ns} link set ${active_slave} up 465 + } 466 + 467 + fail_over_mac() 468 + { 469 + # Bring down the first interface on the switch to force the bond to 470 + # select another active interface instead of the first one that joined. 471 + ip -n "$g_ns" link set s0 down 472 + 473 + # fail_over_mac none 474 + bond_reset "mode active-backup miimon 100 fail_over_mac 0" 475 + check_all_mac_same 476 + log_test "fail_over_mac 0" "all slaves have same mac" 477 + do_active_backup_failover 478 + check_all_mac_same 479 + log_test "fail_over_mac 0" "failover: all slaves have same mac" 480 + 481 + # fail_over_mac active 482 + bond_reset "mode active-backup miimon 100 fail_over_mac 1" 483 + check_bond_mac_same_with_active 484 + log_test "fail_over_mac 1" "bond mac is same with active slave mac" 485 + check_backup_slave_mac_not_change 486 + log_test "fail_over_mac 1" "backup slave mac is not changed" 487 + do_active_backup_failover 488 + check_bond_mac_same_with_active 489 + log_test "fail_over_mac 1" "failover: bond mac is same with active slave mac" 490 + check_backup_slave_mac_not_change 491 + log_test "fail_over_mac 1" "failover: backup slave mac is not changed" 492 + 493 + # fail_over_mac follow 494 + bond_reset "mode active-backup miimon 100 fail_over_mac 2" 495 + check_bond_mac_same_with_first 496 + log_test "fail_over_mac 2" "bond mac is same with first slave mac" 497 + check_bond_mac_same_with_active 498 + log_test "fail_over_mac 2" "bond mac is same with active slave mac" 499 + check_backup_slave_mac_inherit 500 + log_test "fail_over_mac 2" "backup slave mac inherit" 501 + do_active_backup_failover 502 + check_bond_mac_same_with_first 503 + log_test "fail_over_mac 2" "failover: bond mac is same with first slave mac" 504 + check_bond_mac_same_with_active 505 + log_test "fail_over_mac 2" "failover: bond mac is same with active slave mac" 506 + check_backup_slave_mac_inherit 507 + log_test "fail_over_mac 2" "failover: backup slave mac inherit" 508 + check_first_slave_random_mac 509 + log_test "fail_over_mac 2" "first slave mac random" 510 + } 511 + 512 + vlan_over_bond_arp() 513 + { 514 + local mode="$1" 515 + RET=0 516 + 517 + bond_reset "mode $mode arp_interval 100 arp_ip_target 192.0.3.10" 518 + ip -n "${s_ns}" link add bond0.3 link bond0 type vlan id 3 519 + ip -n "${s_ns}" link set bond0.3 up 520 + ip -n "${s_ns}" addr add 192.0.3.1/24 dev bond0.3 521 + ip -n "${s_ns}" addr add 2001:db8::3:1/64 dev bond0.3 522 + 523 + slowwait_for_counter 5 5 tc_rule_handle_stats_get \ 524 + "dev eth0.3 ingress" 101 ".packets" "-n ${c_ns}" &> /dev/null || RET=1 525 + log_test "vlan over bond arp" "$mode" 526 + } 527 + 528 + vlan_over_bond_ns() 529 + { 530 + local mode="$1" 531 + RET=0 532 + 533 + if skip_ns; then 534 + log_test_skip "vlan_over_bond ns" "$mode" 535 + return 0 536 + fi 537 + 538 + bond_reset "mode $mode arp_interval 100 ns_ip6_target 2001:db8::3:10" 539 + ip -n "${s_ns}" link add bond0.3 link bond0 type vlan id 3 540 + ip -n "${s_ns}" link set bond0.3 up 541 + ip -n "${s_ns}" addr add 192.0.3.1/24 dev bond0.3 542 + ip -n "${s_ns}" addr add 2001:db8::3:1/64 dev bond0.3 543 + 544 + slowwait_for_counter 5 5 tc_rule_handle_stats_get \ 545 + "dev eth0.3 ingress" 102 ".packets" "-n ${c_ns}" &> /dev/null || RET=1 546 + log_test "vlan over bond ns" "$mode" 547 + } 548 + 549 + vlan_over_bond() 550 + { 551 + # add vlan 3 for client 552 + ip -n "${c_ns}" link add eth0.3 link eth0 type vlan id 3 553 + ip -n "${c_ns}" link set eth0.3 up 554 + ip -n "${c_ns}" addr add 192.0.3.10/24 dev eth0.3 555 + ip -n "${c_ns}" addr add 2001:db8::3:10/64 dev eth0.3 556 + 557 + # Add tc rule to check the vlan pkts 558 + tc -n "${c_ns}" qdisc add dev eth0.3 clsact 559 + tc -n "${c_ns}" filter add dev eth0.3 ingress protocol arp \ 560 + handle 101 flower skip_hw arp_op request \ 561 + arp_sip 192.0.3.1 arp_tip 192.0.3.10 action pass 562 + tc -n "${c_ns}" filter add dev eth0.3 ingress protocol ipv6 \ 563 + handle 102 flower skip_hw ip_proto icmpv6 \ 564 + type 135 src_ip 2001:db8::3:1 action pass 565 + 566 + vlan_over_bond_arp "active-backup" 567 + vlan_over_bond_ns "active-backup" 379 568 } 380 569 381 570 trap cleanup EXIT
+3
tools/testing/selftests/drivers/net/bonding/bond_topo_2d1c.sh
··· 39 39 s_ip6="2001:db8::1" 40 40 c_ip6="2001:db8::10" 41 41 g_ip6="2001:db8::254" 42 + mac[0]="00:0a:0b:0c:0d:01" 43 + mac[1]="00:0a:0b:0c:0d:02" 42 44 43 45 gateway_create() 44 46 { ··· 64 62 65 63 for i in $(seq 0 1); do 66 64 ip -n ${s_ns} link add eth${i} type veth peer name s${i} netns ${g_ns} 65 + ip -n "${s_ns}" link set "eth${i}" addr "${mac[$i]}" 67 66 68 67 ip -n ${g_ns} link set s${i} up 69 68 ip -n ${g_ns} link set s${i} master br0
+2
tools/testing/selftests/drivers/net/bonding/bond_topo_3d1c.sh
··· 26 26 # +-------------------------------------+ 27 27 28 28 source bond_topo_2d1c.sh 29 + mac[2]="00:0a:0b:0c:0d:03" 29 30 30 31 setup_prepare() 31 32 { ··· 37 36 # Add the extra device as we use 3 down links for bond0 38 37 local i=2 39 38 ip -n ${s_ns} link add eth${i} type veth peer name s${i} netns ${g_ns} 39 + ip -n "${s_ns}" link set "eth${i}" addr "${mac[$i]}" 40 40 ip -n ${g_ns} link set s${i} up 41 41 ip -n ${g_ns} link set s${i} master br0 42 42 ip -n ${s_ns} link set eth${i} master bond0
+1
tools/testing/selftests/drivers/net/bonding/config
··· 10 10 CONFIG_NET_SCH_INGRESS=y 11 11 CONFIG_NLMON=y 12 12 CONFIG_VETH=y 13 + CONFIG_VLAN_8021Q=m
+6 -5
tools/testing/selftests/net/mptcp/mptcp_connect.c
··· 1093 1093 struct pollfd polls; 1094 1094 socklen_t salen; 1095 1095 int remotesock; 1096 + int err = 0; 1096 1097 int fd = 0; 1097 1098 1098 1099 again: ··· 1126 1125 SOCK_TEST_TCPULP(remotesock, 0); 1127 1126 1128 1127 memset(&winfo, 0, sizeof(winfo)); 1129 - copyfd_io(fd, remotesock, 1, true, &winfo); 1128 + err = copyfd_io(fd, remotesock, 1, true, &winfo); 1130 1129 } else { 1131 1130 perror("accept"); 1132 1131 return 1; ··· 1135 1134 if (cfg_input) 1136 1135 close(fd); 1137 1136 1138 - if (--cfg_repeat > 0) 1137 + if (!err && --cfg_repeat > 0) 1139 1138 goto again; 1140 1139 1141 - return 0; 1140 + return err; 1142 1141 } 1143 1142 1144 1143 static void init_rng(void) ··· 1248 1247 else 1249 1248 xerror("bad family"); 1250 1249 1251 - strcpy(cmd, "ss -M | grep -q "); 1250 + strcpy(cmd, "ss -Mnt | grep -q "); 1252 1251 cmdlen = strlen(cmd); 1253 1252 if (!inet_ntop(addr.ss_family, raw_addr, &cmd[cmdlen], 1254 1253 sizeof(cmd) - cmdlen)) ··· 1258 1257 1259 1258 /* 1260 1259 * wait until the pending data is completely flushed and all 1261 - * the MPTCP sockets reached the closed status. 1260 + * the sockets reached the closed status. 1262 1261 * disconnect will bypass/ignore/drop any pending data. 1263 1262 */ 1264 1263 for (i = 0; ; i += msec_sleep) {
+5 -1
tools/testing/selftests/net/mptcp/mptcp_connect.sh
··· 211 211 done 212 212 fi 213 213 214 + if $capture; then 215 + rndh="${ns1:4}" 216 + mptcp_lib_pr_info "Packet capture files will have this prefix: ${rndh}-" 217 + fi 218 + 214 219 set_ethtool_flags() { 215 220 local ns="$1" 216 221 local dev="$2" ··· 366 361 367 362 if $capture; then 368 363 local capuser 369 - local rndh="${connector_ns:4}" 370 364 if [ -z $SUDO_USER ] ; then 371 365 capuser="" 372 366 else
+1 -1
tools/testing/selftests/net/mptcp/mptcp_lib.sh
··· 384 384 mptcp_lib_print_file_err() { 385 385 ls -l "${1}" 1>&2 386 386 echo "Trailing bytes are: " 387 - tail -c 27 "${1}" 387 + tail -c 32 "${1}" | od -x | head -n2 388 388 } 389 389 390 390 # $1: input file ; $2: output file ; $3: what kind of file
+10 -6
tools/testing/selftests/net/mptcp/mptcp_sockopt.c
··· 667 667 668 668 do_getsockopts(&s, fd, ret, ret2); 669 669 if (s.mptcpi_rcv_delta != (uint64_t)ret + 1) 670 - xerror("mptcpi_rcv_delta %" PRIu64 ", expect %" PRIu64, s.mptcpi_rcv_delta, ret + 1, s.mptcpi_rcv_delta - ret); 670 + xerror("mptcpi_rcv_delta %" PRIu64 ", expect %" PRIu64 ", diff %" PRId64, 671 + s.mptcpi_rcv_delta, ret + 1, s.mptcpi_rcv_delta - (ret + 1)); 671 672 672 673 /* be nice when running on top of older kernel */ 673 674 if (s.pkt_stats_avail) { 674 675 if (s.last_sample.mptcpi_bytes_sent != ret2) 675 - xerror("mptcpi_bytes_sent %" PRIu64 ", expect %" PRIu64, 676 + xerror("mptcpi_bytes_sent %" PRIu64 ", expect %" PRIu64 677 + ", diff %" PRId64, 676 678 s.last_sample.mptcpi_bytes_sent, ret2, 677 679 s.last_sample.mptcpi_bytes_sent - ret2); 678 680 if (s.last_sample.mptcpi_bytes_received != ret) 679 - xerror("mptcpi_bytes_received %" PRIu64 ", expect %" PRIu64, 681 + xerror("mptcpi_bytes_received %" PRIu64 ", expect %" PRIu64 682 + ", diff %" PRId64, 680 683 s.last_sample.mptcpi_bytes_received, ret, 681 684 s.last_sample.mptcpi_bytes_received - ret); 682 685 if (s.last_sample.mptcpi_bytes_acked != ret) 683 - xerror("mptcpi_bytes_acked %" PRIu64 ", expect %" PRIu64, 684 - s.last_sample.mptcpi_bytes_acked, ret2, 685 - s.last_sample.mptcpi_bytes_acked - ret2); 686 + xerror("mptcpi_bytes_acked %" PRIu64 ", expect %" PRIu64 687 + ", diff %" PRId64, 688 + s.last_sample.mptcpi_bytes_acked, ret, 689 + s.last_sample.mptcpi_bytes_acked - ret); 686 690 } 687 691 688 692 close(fd);
+7
tools/testing/selftests/net/mptcp/pm_nl_ctl.c
··· 188 188 fprintf(stderr, ",error:%u", *(__u8 *)RTA_DATA(attrs)); 189 189 else if (attrs->rta_type == MPTCP_ATTR_SERVER_SIDE) 190 190 fprintf(stderr, ",server_side:%u", *(__u8 *)RTA_DATA(attrs)); 191 + else if (attrs->rta_type == MPTCP_ATTR_FLAGS) { 192 + __u16 flags = *(__u16 *)RTA_DATA(attrs); 193 + 194 + /* only print when present, easier */ 195 + if (flags & MPTCP_PM_EV_FLAG_DENY_JOIN_ID0) 196 + fprintf(stderr, ",deny_join_id0:1"); 197 + } 191 198 192 199 attrs = RTA_NEXT(attrs, msg_len); 193 200 }
+11 -3
tools/testing/selftests/net/mptcp/userspace_pm.sh
··· 201 201 is_v6="v4" 202 202 fi 203 203 204 + # set this on the client side only: will not affect the rest 205 + ip netns exec "$ns2" sysctl -q net.mptcp.allow_join_initial_addr_port=0 206 + 204 207 :>"$client_evts" 205 208 :>"$server_evts" 206 209 ··· 226 223 local client_token 227 224 local client_port 228 225 local client_serverside 226 + local client_nojoin 229 227 local server_token 230 228 local server_serverside 229 + local server_nojoin 231 230 232 231 client_token=$(mptcp_lib_evts_get_info token "$client_evts") 233 232 client_port=$(mptcp_lib_evts_get_info sport "$client_evts") 234 233 client_serverside=$(mptcp_lib_evts_get_info server_side "$client_evts") 234 + client_nojoin=$(mptcp_lib_evts_get_info deny_join_id0 "$client_evts") 235 235 server_token=$(mptcp_lib_evts_get_info token "$server_evts") 236 236 server_serverside=$(mptcp_lib_evts_get_info server_side "$server_evts") 237 + server_nojoin=$(mptcp_lib_evts_get_info deny_join_id0 "$server_evts") 237 238 238 239 print_test "Established IP${is_v6} MPTCP Connection ns2 => ns1" 239 - if [ "$client_token" != "" ] && [ "$server_token" != "" ] && [ "$client_serverside" = 0 ] && 240 - [ "$server_serverside" = 1 ] 240 + if [ "${client_token}" != "" ] && [ "${server_token}" != "" ] && 241 + [ "${client_serverside}" = 0 ] && [ "${server_serverside}" = 1 ] && 242 + [ "${client_nojoin:-0}" = 0 ] && [ "${server_nojoin:-0}" = 1 ] 241 243 then 242 244 test_pass 243 245 print_title "Connection info: ${client_addr}:${client_port} -> ${connect_addr}:${app_port}" 244 246 else 245 - test_fail "Expected tokens (c:${client_token} - s:${server_token}) and server (c:${client_serverside} - s:${server_serverside})" 247 + test_fail "Expected tokens (c:${client_token} - s:${server_token}), server (c:${client_serverside} - s:${server_serverside}), nojoin (c:${client_nojoin} - s:${server_nojoin})" 246 248 mptcp_lib_result_print_all_tap 247 249 exit ${KSFT_FAIL} 248 250 fi
+81 -7
tools/testing/selftests/net/openvswitch/openvswitch.sh
··· 25 25 nat_related_v4 ip4-nat-related: ICMP related matches work with SNAT 26 26 netlink_checks ovsnl: validate netlink attrs and settings 27 27 upcall_interfaces ovs: test the upcall interfaces 28 + tunnel_metadata ovs: test extraction of tunnel metadata 28 29 drop_reason drop: test drop reasons are emitted 29 30 psample psample: Sampling packets with psample" 30 31 ··· 114 113 } 115 114 116 115 ovs_add_if () { 117 - info "Adding IF to DP: br:$2 if:$3" 118 - if [ "$4" != "-u" ]; then 119 - ovs_sbx "$1" python3 $ovs_base/ovs-dpctl.py add-if "$2" "$3" \ 120 - || return 1 116 + info "Adding IF to DP: br:$3 if:$4 ($2)" 117 + if [ "$5" != "-u" ]; then 118 + ovs_sbx "$1" python3 $ovs_base/ovs-dpctl.py add-if \ 119 + -t "$2" "$3" "$4" || return 1 121 120 else 122 121 python3 $ovs_base/ovs-dpctl.py add-if \ 123 - -u "$2" "$3" >$ovs_dir/$3.out 2>$ovs_dir/$3.err & 122 + -u -t "$2" "$3" "$4" >$ovs_dir/$4.out 2>$ovs_dir/$4.err & 124 123 pid=$! 125 124 on_exit "ovs_sbx $1 kill -TERM $pid 2>/dev/null" 126 125 fi ··· 167 166 fi 168 167 169 168 if [ "$7" != "-u" ]; then 170 - ovs_add_if "$1" "$2" "$4" || return 1 169 + ovs_add_if "$1" "netdev" "$2" "$4" || return 1 171 170 else 172 - ovs_add_if "$1" "$2" "$4" -u || return 1 171 + ovs_add_if "$1" "netdev" "$2" "$4" -u || return 1 173 172 fi 174 173 175 174 if [ $TRACING -eq 1 ]; then ··· 754 753 >$ovs_dir/arping.stdout 2>$ovs_dir/arping.stderr 755 754 756 755 grep -E "MISS upcall\[0/yes\]: .*arp\(sip=172.31.110.1,tip=172.31.110.20,op=1,sha=" $ovs_dir/left0.out >/dev/null 2>&1 || return 1 756 + return 0 757 + } 758 + 759 + ovs_add_kernel_tunnel() { 760 + local sbxname=$1; shift 761 + local ns=$1; shift 762 + local tnl_type=$1; shift 763 + local name=$1; shift 764 + local addr=$1; shift 765 + 766 + info "setting up kernel ${tnl_type} tunnel ${name}" 767 + ovs_sbx "${sbxname}" ip -netns ${ns} link add dev ${name} type ${tnl_type} $* || return 1 768 + on_exit "ovs_sbx ${sbxname} ip -netns ${ns} link del ${name} >/dev/null 2>&1" 769 + ovs_sbx "${sbxname}" ip -netns ${ns} addr add dev ${name} ${addr} || return 1 770 + ovs_sbx "${sbxname}" ip -netns ${ns} link set dev ${name} mtu 1450 up || return 1 771 + } 772 + 773 + test_tunnel_metadata() { 774 + which arping >/dev/null 2>&1 || return $ksft_skip 775 + 776 + sbxname="test_tunnel_metadata" 777 + sbx_add "${sbxname}" || return 1 778 + 779 + info "setting up new DP" 780 + ovs_add_dp "${sbxname}" tdp0 -V 2:1 || return 1 781 + 782 + ovs_add_netns_and_veths "${sbxname}" tdp0 tns left0 l0 \ 783 + 172.31.110.1/24 || return 1 784 + 785 + info "removing veth interface from openvswitch and setting IP" 786 + ovs_del_if "${sbxname}" tdp0 left0 || return 1 787 + ovs_sbx "${sbxname}" ip addr add 172.31.110.2/24 dev left0 || return 1 788 + ovs_sbx "${sbxname}" ip link set left0 up || return 1 789 + 790 + info "setting up tunnel port in openvswitch" 791 + ovs_add_if "${sbxname}" "vxlan" tdp0 ovs-vxlan0 -u || return 1 792 + on_exit "ovs_sbx ${sbxname} ip link del ovs-vxlan0" 793 + ovs_wait ip link show ovs-vxlan0 &>/dev/null || return 1 794 + ovs_sbx "${sbxname}" ip link set ovs-vxlan0 up || return 1 795 + 796 + configs=$(echo ' 797 + 1 172.31.221.1/24 1155332 32 set udpcsum flags\(df\|csum\) 798 + 2 172.31.222.1/24 1234567 45 set noudpcsum flags\(df\) 799 + 3 172.31.223.1/24 1020304 23 unset udpcsum flags\(csum\) 800 + 4 172.31.224.1/24 1357986 15 unset noudpcsum' | sed '/^$/d') 801 + 802 + while read -r i addr id ttl df csum flags; do 803 + ovs_add_kernel_tunnel "${sbxname}" tns vxlan vxlan${i} ${addr} \ 804 + remote 172.31.110.2 id ${id} dstport 4789 \ 805 + ttl ${ttl} df ${df} ${csum} || return 1 806 + done <<< "${configs}" 807 + 808 + ovs_wait grep -q 'listening on upcall packet handler' \ 809 + ${ovs_dir}/ovs-vxlan0.out || return 1 810 + 811 + info "sending arping" 812 + for i in 1 2 3 4; do 813 + ovs_sbx "${sbxname}" ip netns exec tns \ 814 + arping -I vxlan${i} 172.31.22${i}.2 -c 1 \ 815 + >${ovs_dir}/arping.stdout 2>${ovs_dir}/arping.stderr 816 + done 817 + 818 + info "checking that received decapsulated packets carry correct metadata" 819 + while read -r i addr id ttl df csum flags; do 820 + arp_hdr="arp\\(sip=172.31.22${i}.1,tip=172.31.22${i}.2,op=1,sha=" 821 + addrs="src=172.31.110.1,dst=172.31.110.2" 822 + ports="tp_src=[0-9]*,tp_dst=4789" 823 + tnl_md="tunnel\\(tun_id=${id},${addrs},ttl=${ttl},${ports},${flags}\\)" 824 + 825 + ovs_sbx "${sbxname}" grep -qE "MISS upcall.*${tnl_md}.*${arp_hdr}" \ 826 + ${ovs_dir}/ovs-vxlan0.out || return 1 827 + done <<< "${configs}" 828 + 757 829 return 0 758 830 } 759 831
+26
tools/testing/selftests/net/packetdrill/tcp_fastopen_server_reset-after-disconnect.pkt
··· 1 + // SPDX-License-Identifier: GPL-2.0 2 + `./defaults.sh 3 + ./set_sysctls.py /proc/sys/net/ipv4/tcp_fastopen=0x602 /proc/sys/net/ipv4/tcp_timestamps=0` 4 + 5 + 0 socket(..., SOCK_STREAM|SOCK_NONBLOCK, IPPROTO_TCP) = 3 6 + +0 setsockopt(3, SOL_SOCKET, SO_REUSEADDR, [1], 4) = 0 7 + +0 bind(3, ..., ...) = 0 8 + +0 listen(3, 1) = 0 9 + 10 + +0 < S 0:10(10) win 32792 <mss 1460,nop,nop,sackOK> 11 + +0 > S. 0:0(0) ack 11 win 65535 <mss 1460,nop,nop,sackOK> 12 + 13 + // sk->sk_state is TCP_SYN_RECV 14 + +.1 accept(3, ..., ...) = 4 15 + 16 + // tcp_disconnect() sets sk->sk_state to TCP_CLOSE 17 + +0 connect(4, AF_UNSPEC, ...) = 0 18 + +0 > R. 1:1(0) ack 11 win 65535 19 + 20 + // connect() sets sk->sk_state to TCP_SYN_SENT 21 + +0 fcntl(4, F_SETFL, O_RDWR|O_NONBLOCK) = 0 22 + +0 connect(4, ..., ...) = -1 EINPROGRESS (Operation is now in progress) 23 + +0 > S 0:0(0) win 65535 <mss 1460,nop,nop,sackOK,nop,wscale 8> 24 + 25 + // tp->fastopen_rsk must be NULL 26 + +1 > S 0:0(0) win 65535 <mss 1460,nop,nop,sackOK,nop,wscale 8>
+16
tools/testing/selftests/net/tls.c
··· 2770 2770 } 2771 2771 } 2772 2772 2773 + /* Use OOB+large send to trigger copy mode due to memory pressure. 2774 + * OOB causes a short read. 2775 + */ 2776 + TEST_F(tls_err, oob_pressure) 2777 + { 2778 + char buf[1<<16]; 2779 + int i; 2780 + 2781 + memrnd(buf, sizeof(buf)); 2782 + 2783 + EXPECT_EQ(send(self->fd2, buf, 5, MSG_OOB), 5); 2784 + EXPECT_EQ(send(self->fd2, buf, sizeof(buf), 0), sizeof(buf)); 2785 + for (i = 0; i < 64; i++) 2786 + EXPECT_EQ(send(self->fd2, buf, 5, MSG_OOB), 5); 2787 + } 2788 + 2773 2789 TEST(non_established) { 2774 2790 struct tls12_crypto_info_aes_gcm_256 tls12; 2775 2791 struct sockaddr_in addr;