Skip to content

Commit 399bd66

Browse files
committed
Merge tag 'net-5.19-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net
Pull networking fixes from Paolo Abeni: "Including fixes from bpf and netfilter. Current release - regressions: - netfilter: cttimeout: fix slab-out-of-bounds read in cttimeout_net_exit Current release - new code bugs: - bpf: ftrace: keep address offset in ftrace_lookup_symbols - bpf: force cookies array to follow symbols sorting Previous releases - regressions: - ipv4: ping: fix bind address validity check - tipc: fix use-after-free read in tipc_named_reinit - eth: veth: add updating of trans_start Previous releases - always broken: - sock: redo the psock vs ULP protection check - netfilter: nf_dup_netdev: fix skb_under_panic - bpf: fix request_sock leak in sk lookup helpers - eth: igb: fix a use-after-free issue in igb_clean_tx_ring - eth: ice: prohibit improper channel config for DCB - eth: at803x: fix null pointer dereference on AR9331 phy - eth: virtio_net: fix xdp_rxq_info bug after suspend/resume Misc: - eth: hinic: replace memcpy() with direct assignment" * tag 'net-5.19-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net: (47 commits) net: openvswitch: fix parsing of nw_proto for IPv6 fragments sock: redo the psock vs ULP protection check Revert "net/tls: fix tls_sk_proto_close executed repeatedly" virtio_net: fix xdp_rxq_info bug after suspend/resume igb: Make DMA faster when CPU is active on the PCIe link net: dsa: qca8k: reduce mgmt ethernet timeout net: dsa: qca8k: reset cpu port on MTU change MAINTAINERS: Add a maintainer for OCP Time Card hinic: Replace memcpy() with direct assignment Revert "drivers/net/ethernet/neterion/vxge: Fix a use-after-free bug in vxge-main.c" net: phy: smsc: Disable Energy Detect Power-Down in interrupt mode ice: ethtool: Prohibit improper channel config for DCB ice: ethtool: advertise 1000M speeds properly ice: Fix switchdev rules book keeping ice: ignore protocol field in GTP offload netfilter: nf_dup_netdev: add and use recursion counter netfilter: nf_dup_netdev: do not push mac header a second time selftests: netfilter: correct PKTGEN_SCRIPT_PATHS in nft_concat_range.sh net/tls: fix tls_sk_proto_close executed repeatedly erspan: do not assume transport header is always set ...
2 parents f410c3e + 12378a5 commit 399bd66

Some content is hidden

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

47 files changed

+617
-215
lines changed

MAINTAINERS

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -3662,7 +3662,7 @@ BPF JIT for ARM
36623662
M: Shubham Bansal <[email protected]>
36633663
36643664
3665-
S: Maintained
3665+
S: Odd Fixes
36663666
F: arch/arm/net/
36673667

36683668
BPF JIT for ARM64
@@ -3686,14 +3686,15 @@ BPF JIT for NFP NICs
36863686
M: Jakub Kicinski <[email protected]>
36873687
36883688
3689-
S: Supported
3689+
S: Odd Fixes
36903690
F: drivers/net/ethernet/netronome/nfp/bpf/
36913691

36923692
BPF JIT for POWERPC (32-BIT AND 64-BIT)
36933693
M: Naveen N. Rao <[email protected]>
3694+
M: Michael Ellerman <[email protected]>
36943695
36953696
3696-
S: Maintained
3697+
S: Supported
36973698
F: arch/powerpc/net/
36983699

36993700
BPF JIT for RISC-V (32-bit)
@@ -3719,22 +3720,22 @@ M: Heiko Carstens <[email protected]>
37193720
M: Vasily Gorbik <[email protected]>
37203721
37213722
3722-
S: Maintained
3723+
S: Supported
37233724
F: arch/s390/net/
37243725
X: arch/s390/net/pnet.c
37253726

37263727
BPF JIT for SPARC (32-BIT AND 64-BIT)
37273728
M: David S. Miller <[email protected]>
37283729
37293730
3730-
S: Maintained
3731+
S: Odd Fixes
37313732
F: arch/sparc/net/
37323733

37333734
BPF JIT for X86 32-BIT
37343735
M: Wang YanQing <[email protected]>
37353736
37363737
3737-
S: Maintained
3738+
S: Odd Fixes
37383739
F: arch/x86/net/bpf_jit_comp32.c
37393740

37403741
BPF JIT for X86 64-BIT
@@ -3757,6 +3758,19 @@ F: include/linux/bpf_lsm.h
37573758
F: kernel/bpf/bpf_lsm.c
37583759
F: security/bpf/
37593760

3761+
BPF L7 FRAMEWORK
3762+
M: John Fastabend <[email protected]>
3763+
M: Jakub Sitnicki <[email protected]>
3764+
3765+
3766+
S: Maintained
3767+
F: include/linux/skmsg.h
3768+
F: net/core/skmsg.c
3769+
F: net/core/sock_map.c
3770+
F: net/ipv4/tcp_bpf.c
3771+
F: net/ipv4/udp_bpf.c
3772+
F: net/unix/unix_bpf.c
3773+
37603774
BPFTOOL
37613775
M: Quentin Monnet <[email protected]>
37623776
@@ -11098,20 +11112,6 @@ S: Maintained
1109811112
F: include/net/l3mdev.h
1109911113
F: net/l3mdev
1110011114

11101-
L7 BPF FRAMEWORK
11102-
M: John Fastabend <[email protected]>
11103-
M: Daniel Borkmann <[email protected]>
11104-
M: Jakub Sitnicki <[email protected]>
11105-
11106-
11107-
S: Maintained
11108-
F: include/linux/skmsg.h
11109-
F: net/core/skmsg.c
11110-
F: net/core/sock_map.c
11111-
F: net/ipv4/tcp_bpf.c
11112-
F: net/ipv4/udp_bpf.c
11113-
F: net/unix/unix_bpf.c
11114-
1111511115
LANDLOCK SECURITY MODULE
1111611116
M: Mickaël Salaün <[email protected]>
1111711117
@@ -13954,7 +13954,6 @@ F: net/ipv6/tcp*.c
1395413954
NETWORKING [TLS]
1395513955
M: Boris Pismenny <[email protected]>
1395613956
M: John Fastabend <[email protected]>
13957-
M: Daniel Borkmann <[email protected]>
1395813957
M: Jakub Kicinski <[email protected]>
1395913958
1396013959
S: Maintained
@@ -14871,6 +14870,7 @@ F: include/dt-bindings/
1487114870

1487214871
OPENCOMPUTE PTP CLOCK DRIVER
1487314872
M: Jonathan Lemon <[email protected]>
14873+
M: Vadim Fedorenko <[email protected]>
1487414874
1487514875
S: Maintained
1487614876
F: drivers/ptp/ptp_ocp.c

arch/x86/net/bpf_jit_comp.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1420,8 +1420,9 @@ st: if (is_imm8(insn->off))
14201420
case BPF_JMP | BPF_CALL:
14211421
func = (u8 *) __bpf_call_base + imm32;
14221422
if (tail_call_reachable) {
1423+
/* mov rax, qword ptr [rbp - rounded_stack_depth - 8] */
14231424
EMIT3_off32(0x48, 0x8B, 0x85,
1424-
-(bpf_prog->aux->stack_depth + 8));
1425+
-round_up(bpf_prog->aux->stack_depth, 8) - 8);
14251426
if (!imm32 || emit_call(&prog, func, image + addrs[i - 1] + 7))
14261427
return -EINVAL;
14271428
} else {

drivers/net/bonding/bond_main.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3684,9 +3684,11 @@ static void bond_activebackup_arp_mon(struct bonding *bond)
36843684
if (!rtnl_trylock())
36853685
return;
36863686

3687-
if (should_notify_peers)
3687+
if (should_notify_peers) {
3688+
bond->send_peer_notif--;
36883689
call_netdevice_notifiers(NETDEV_NOTIFY_PEERS,
36893690
bond->dev);
3691+
}
36903692
if (should_notify_rtnl) {
36913693
bond_slave_state_notify(bond);
36923694
bond_slave_link_notify(bond);

drivers/net/dsa/qca8k.c

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2334,6 +2334,7 @@ static int
23342334
qca8k_port_change_mtu(struct dsa_switch *ds, int port, int new_mtu)
23352335
{
23362336
struct qca8k_priv *priv = ds->priv;
2337+
int ret;
23372338

23382339
/* We have only have a general MTU setting.
23392340
* DSA always set the CPU port's MTU to the largest MTU of the slave
@@ -2344,8 +2345,27 @@ qca8k_port_change_mtu(struct dsa_switch *ds, int port, int new_mtu)
23442345
if (!dsa_is_cpu_port(ds, port))
23452346
return 0;
23462347

2348+
/* To change the MAX_FRAME_SIZE the cpu ports must be off or
2349+
* the switch panics.
2350+
* Turn off both cpu ports before applying the new value to prevent
2351+
* this.
2352+
*/
2353+
if (priv->port_enabled_map & BIT(0))
2354+
qca8k_port_set_status(priv, 0, 0);
2355+
2356+
if (priv->port_enabled_map & BIT(6))
2357+
qca8k_port_set_status(priv, 6, 0);
2358+
23472359
/* Include L2 header / FCS length */
2348-
return qca8k_write(priv, QCA8K_MAX_FRAME_SIZE, new_mtu + ETH_HLEN + ETH_FCS_LEN);
2360+
ret = qca8k_write(priv, QCA8K_MAX_FRAME_SIZE, new_mtu + ETH_HLEN + ETH_FCS_LEN);
2361+
2362+
if (priv->port_enabled_map & BIT(0))
2363+
qca8k_port_set_status(priv, 0, 1);
2364+
2365+
if (priv->port_enabled_map & BIT(6))
2366+
qca8k_port_set_status(priv, 6, 1);
2367+
2368+
return ret;
23492369
}
23502370

23512371
static int

drivers/net/dsa/qca8k.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515

1616
#define QCA8K_ETHERNET_MDIO_PRIORITY 7
1717
#define QCA8K_ETHERNET_PHY_PRIORITY 6
18-
#define QCA8K_ETHERNET_TIMEOUT 100
18+
#define QCA8K_ETHERNET_TIMEOUT 5
1919

2020
#define QCA8K_NUM_PORTS 7
2121
#define QCA8K_NUM_CPU_PORTS 2

drivers/net/ethernet/huawei/hinic/hinic_devlink.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,7 @@ static bool check_image_valid(struct hinic_devlink_priv *priv, const u8 *buf,
4343

4444
for (i = 0; i < fw_image->fw_info.fw_section_cnt; i++) {
4545
len += fw_image->fw_section_info[i].fw_section_len;
46-
memcpy(&host_image->image_section_info[i],
47-
&fw_image->fw_section_info[i],
48-
sizeof(struct fw_section_info_st));
46+
host_image->image_section_info[i] = fw_image->fw_section_info[i];
4947
}
5048

5149
if (len != fw_image->fw_len ||

drivers/net/ethernet/intel/ice/ice_ethtool.c

Lines changed: 48 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2189,6 +2189,42 @@ ice_setup_autoneg(struct ice_port_info *p, struct ethtool_link_ksettings *ks,
21892189
return err;
21902190
}
21912191

2192+
/**
2193+
* ice_set_phy_type_from_speed - set phy_types based on speeds
2194+
* and advertised modes
2195+
* @ks: ethtool link ksettings struct
2196+
* @phy_type_low: pointer to the lower part of phy_type
2197+
* @phy_type_high: pointer to the higher part of phy_type
2198+
* @adv_link_speed: targeted link speeds bitmap
2199+
*/
2200+
static void
2201+
ice_set_phy_type_from_speed(const struct ethtool_link_ksettings *ks,
2202+
u64 *phy_type_low, u64 *phy_type_high,
2203+
u16 adv_link_speed)
2204+
{
2205+
/* Handle 1000M speed in a special way because ice_update_phy_type
2206+
* enables all link modes, but having mixed copper and optical
2207+
* standards is not supported.
2208+
*/
2209+
adv_link_speed &= ~ICE_AQ_LINK_SPEED_1000MB;
2210+
2211+
if (ethtool_link_ksettings_test_link_mode(ks, advertising,
2212+
1000baseT_Full))
2213+
*phy_type_low |= ICE_PHY_TYPE_LOW_1000BASE_T |
2214+
ICE_PHY_TYPE_LOW_1G_SGMII;
2215+
2216+
if (ethtool_link_ksettings_test_link_mode(ks, advertising,
2217+
1000baseKX_Full))
2218+
*phy_type_low |= ICE_PHY_TYPE_LOW_1000BASE_KX;
2219+
2220+
if (ethtool_link_ksettings_test_link_mode(ks, advertising,
2221+
1000baseX_Full))
2222+
*phy_type_low |= ICE_PHY_TYPE_LOW_1000BASE_SX |
2223+
ICE_PHY_TYPE_LOW_1000BASE_LX;
2224+
2225+
ice_update_phy_type(phy_type_low, phy_type_high, adv_link_speed);
2226+
}
2227+
21922228
/**
21932229
* ice_set_link_ksettings - Set Speed and Duplex
21942230
* @netdev: network interface device structure
@@ -2320,7 +2356,8 @@ ice_set_link_ksettings(struct net_device *netdev,
23202356
adv_link_speed = curr_link_speed;
23212357

23222358
/* Convert the advertise link speeds to their corresponded PHY_TYPE */
2323-
ice_update_phy_type(&phy_type_low, &phy_type_high, adv_link_speed);
2359+
ice_set_phy_type_from_speed(ks, &phy_type_low, &phy_type_high,
2360+
adv_link_speed);
23242361

23252362
if (!autoneg_changed && adv_link_speed == curr_link_speed) {
23262363
netdev_info(netdev, "Nothing changed, exiting without setting anything.\n");
@@ -3470,6 +3507,16 @@ static int ice_set_channels(struct net_device *dev, struct ethtool_channels *ch)
34703507
new_rx = ch->combined_count + ch->rx_count;
34713508
new_tx = ch->combined_count + ch->tx_count;
34723509

3510+
if (new_rx < vsi->tc_cfg.numtc) {
3511+
netdev_err(dev, "Cannot set less Rx channels, than Traffic Classes you have (%u)\n",
3512+
vsi->tc_cfg.numtc);
3513+
return -EINVAL;
3514+
}
3515+
if (new_tx < vsi->tc_cfg.numtc) {
3516+
netdev_err(dev, "Cannot set less Tx channels, than Traffic Classes you have (%u)\n",
3517+
vsi->tc_cfg.numtc);
3518+
return -EINVAL;
3519+
}
34733520
if (new_rx > ice_get_max_rxq(pf)) {
34743521
netdev_err(dev, "Maximum allowed Rx channels is %d\n",
34753522
ice_get_max_rxq(pf));

drivers/net/ethernet/intel/ice/ice_lib.c

Lines changed: 37 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -909,7 +909,7 @@ static void ice_set_dflt_vsi_ctx(struct ice_hw *hw, struct ice_vsi_ctx *ctxt)
909909
* @vsi: the VSI being configured
910910
* @ctxt: VSI context structure
911911
*/
912-
static void ice_vsi_setup_q_map(struct ice_vsi *vsi, struct ice_vsi_ctx *ctxt)
912+
static int ice_vsi_setup_q_map(struct ice_vsi *vsi, struct ice_vsi_ctx *ctxt)
913913
{
914914
u16 offset = 0, qmap = 0, tx_count = 0, pow = 0;
915915
u16 num_txq_per_tc, num_rxq_per_tc;
@@ -982,7 +982,18 @@ static void ice_vsi_setup_q_map(struct ice_vsi *vsi, struct ice_vsi_ctx *ctxt)
982982
else
983983
vsi->num_rxq = num_rxq_per_tc;
984984

985+
if (vsi->num_rxq > vsi->alloc_rxq) {
986+
dev_err(ice_pf_to_dev(vsi->back), "Trying to use more Rx queues (%u), than were allocated (%u)!\n",
987+
vsi->num_rxq, vsi->alloc_rxq);
988+
return -EINVAL;
989+
}
990+
985991
vsi->num_txq = tx_count;
992+
if (vsi->num_txq > vsi->alloc_txq) {
993+
dev_err(ice_pf_to_dev(vsi->back), "Trying to use more Tx queues (%u), than were allocated (%u)!\n",
994+
vsi->num_txq, vsi->alloc_txq);
995+
return -EINVAL;
996+
}
986997

987998
if (vsi->type == ICE_VSI_VF && vsi->num_txq != vsi->num_rxq) {
988999
dev_dbg(ice_pf_to_dev(vsi->back), "VF VSI should have same number of Tx and Rx queues. Hence making them equal\n");
@@ -1000,6 +1011,8 @@ static void ice_vsi_setup_q_map(struct ice_vsi *vsi, struct ice_vsi_ctx *ctxt)
10001011
*/
10011012
ctxt->info.q_mapping[0] = cpu_to_le16(vsi->rxq_map[0]);
10021013
ctxt->info.q_mapping[1] = cpu_to_le16(vsi->num_rxq);
1014+
1015+
return 0;
10031016
}
10041017

10051018
/**
@@ -1187,7 +1200,10 @@ static int ice_vsi_init(struct ice_vsi *vsi, bool init_vsi)
11871200
if (vsi->type == ICE_VSI_CHNL) {
11881201
ice_chnl_vsi_setup_q_map(vsi, ctxt);
11891202
} else {
1190-
ice_vsi_setup_q_map(vsi, ctxt);
1203+
ret = ice_vsi_setup_q_map(vsi, ctxt);
1204+
if (ret)
1205+
goto out;
1206+
11911207
if (!init_vsi) /* means VSI being updated */
11921208
/* must to indicate which section of VSI context are
11931209
* being modified
@@ -3464,7 +3480,7 @@ void ice_vsi_cfg_netdev_tc(struct ice_vsi *vsi, u8 ena_tc)
34643480
*
34653481
* Prepares VSI tc_config to have queue configurations based on MQPRIO options.
34663482
*/
3467-
static void
3483+
static int
34683484
ice_vsi_setup_q_map_mqprio(struct ice_vsi *vsi, struct ice_vsi_ctx *ctxt,
34693485
u8 ena_tc)
34703486
{
@@ -3513,7 +3529,18 @@ ice_vsi_setup_q_map_mqprio(struct ice_vsi *vsi, struct ice_vsi_ctx *ctxt,
35133529

35143530
/* Set actual Tx/Rx queue pairs */
35153531
vsi->num_txq = offset + qcount_tx;
3532+
if (vsi->num_txq > vsi->alloc_txq) {
3533+
dev_err(ice_pf_to_dev(vsi->back), "Trying to use more Tx queues (%u), than were allocated (%u)!\n",
3534+
vsi->num_txq, vsi->alloc_txq);
3535+
return -EINVAL;
3536+
}
3537+
35163538
vsi->num_rxq = offset + qcount_rx;
3539+
if (vsi->num_rxq > vsi->alloc_rxq) {
3540+
dev_err(ice_pf_to_dev(vsi->back), "Trying to use more Rx queues (%u), than were allocated (%u)!\n",
3541+
vsi->num_rxq, vsi->alloc_rxq);
3542+
return -EINVAL;
3543+
}
35173544

35183545
/* Setup queue TC[0].qmap for given VSI context */
35193546
ctxt->info.tc_mapping[0] = cpu_to_le16(qmap);
@@ -3531,6 +3558,8 @@ ice_vsi_setup_q_map_mqprio(struct ice_vsi *vsi, struct ice_vsi_ctx *ctxt,
35313558
dev_dbg(ice_pf_to_dev(vsi->back), "vsi->num_rxq = %d\n", vsi->num_rxq);
35323559
dev_dbg(ice_pf_to_dev(vsi->back), "all_numtc %u, all_enatc: 0x%04x, tc_cfg.numtc %u\n",
35333560
vsi->all_numtc, vsi->all_enatc, vsi->tc_cfg.numtc);
3561+
3562+
return 0;
35343563
}
35353564

35363565
/**
@@ -3580,9 +3609,12 @@ int ice_vsi_cfg_tc(struct ice_vsi *vsi, u8 ena_tc)
35803609

35813610
if (vsi->type == ICE_VSI_PF &&
35823611
test_bit(ICE_FLAG_TC_MQPRIO, pf->flags))
3583-
ice_vsi_setup_q_map_mqprio(vsi, ctx, ena_tc);
3612+
ret = ice_vsi_setup_q_map_mqprio(vsi, ctx, ena_tc);
35843613
else
3585-
ice_vsi_setup_q_map(vsi, ctx);
3614+
ret = ice_vsi_setup_q_map(vsi, ctx);
3615+
3616+
if (ret)
3617+
goto out;
35863618

35873619
/* must to indicate which section of VSI context are being modified */
35883620
ctx->info.valid_sections = cpu_to_le16(ICE_AQ_VSI_PROP_RXQ_MAP_VALID);

drivers/net/ethernet/intel/ice/ice_tc_lib.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -524,6 +524,7 @@ ice_eswitch_add_tc_fltr(struct ice_vsi *vsi, struct ice_tc_flower_fltr *fltr)
524524
*/
525525
fltr->rid = rule_added.rid;
526526
fltr->rule_id = rule_added.rule_id;
527+
fltr->dest_id = rule_added.vsi_handle;
527528

528529
exit:
529530
kfree(list);
@@ -993,7 +994,9 @@ ice_parse_cls_flower(struct net_device *filter_dev, struct ice_vsi *vsi,
993994
n_proto_key = ntohs(match.key->n_proto);
994995
n_proto_mask = ntohs(match.mask->n_proto);
995996

996-
if (n_proto_key == ETH_P_ALL || n_proto_key == 0) {
997+
if (n_proto_key == ETH_P_ALL || n_proto_key == 0 ||
998+
fltr->tunnel_type == TNL_GTPU ||
999+
fltr->tunnel_type == TNL_GTPC) {
9971000
n_proto_key = 0;
9981001
n_proto_mask = 0;
9991002
} else {

0 commit comments

Comments
 (0)