Skip to content

Commit 50fb587

Browse files
committed
Merge tag 'net-6.4-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net
Pull networking fixes from Paolo Abeni: "Including fixes from bluetooth and bpf. Current release - regressions: - net: fix skb leak in __skb_tstamp_tx() - eth: mtk_eth_soc: fix QoS on DSA MAC on non MTK_NETSYS_V2 SoCs Current release - new code bugs: - handshake: - fix sock->file allocation - fix handshake_dup() ref counting - bluetooth: - fix potential double free caused by hci_conn_unlink - fix UAF in hci_conn_hash_flush Previous releases - regressions: - core: fix stack overflow when LRO is disabled for virtual interfaces - tls: fix strparser rx issues - bpf: - fix many sockmap/TCP related issues - fix a memory leak in the LRU and LRU_PERCPU hash maps - init the offload table earlier - eth: mlx5e: - do as little as possible in napi poll when budget is 0 - fix using eswitch mapping in nic mode - fix deadlock in tc route query code Previous releases - always broken: - udplite: fix NULL pointer dereference in __sk_mem_raise_allocated() - raw: fix output xfrm lookup wrt protocol - smc: reset connection when trying to use SMCRv2 fails - phy: mscc: enable VSC8501/2 RGMII RX clock - eth: octeontx2-pf: fix TSOv6 offload - eth: cdc_ncm: deal with too low values of dwNtbOutMaxSize" * tag 'net-6.4-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net: (79 commits) udplite: Fix NULL pointer dereference in __sk_mem_raise_allocated(). net: phy: mscc: enable VSC8501/2 RGMII RX clock net: phy: mscc: remove unnecessary phydev locking net: phy: mscc: add support for VSC8501 net: phy: mscc: add VSC8502 to MODULE_DEVICE_TABLE net/handshake: Enable the SNI extension to work properly net/handshake: Unpin sock->file if a handshake is cancelled net/handshake: handshake_genl_notify() shouldn't ignore @flags net/handshake: Fix uninitialized local variable net/handshake: Fix handshake_dup() ref counting net/handshake: Remove unneeded check from handshake_dup() ipv6: Fix out-of-bounds access in ipv6_find_tlv() net: ethernet: mtk_eth_soc: fix QoS on DSA MAC on non MTK_NETSYS_V2 SoCs docs: netdev: document the existence of the mail bot net: fix skb leak in __skb_tstamp_tx() r8169: Use a raw_spinlock_t for the register locks. page_pool: fix inconsistency for page_pool_ring_[un]lock() bpf, sockmap: Test progs verifier error with latest clang bpf, sockmap: Test FIONREAD returns correct bytes in rx buffer with drops bpf, sockmap: Test FIONREAD returns correct bytes in rx buffer ...
2 parents eb03e31 + ad42a35 commit 50fb587

Some content is hidden

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

88 files changed

+1488
-792
lines changed

Documentation/netlink/specs/handshake.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,9 @@ attribute-sets:
6868
type: nest
6969
nested-attributes: x509
7070
multi-attr: true
71+
-
72+
name: peername
73+
type: string
7174
-
7275
name: done
7376
attributes:
@@ -105,6 +108,7 @@ operations:
105108
- auth-mode
106109
- peer-identity
107110
- certificate
111+
- peername
108112
-
109113
name: done
110114
doc: Handler reports handshake completion

Documentation/networking/tls-handshake.rst

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ fills in a structure that contains the parameters of the request:
5353
struct socket *ta_sock;
5454
tls_done_func_t ta_done;
5555
void *ta_data;
56+
const char *ta_peername;
5657
unsigned int ta_timeout_ms;
5758
key_serial_t ta_keyring;
5859
key_serial_t ta_my_cert;
@@ -71,6 +72,10 @@ instantiated a struct file in sock->file.
7172
has completed. Further explanation of this function is in the "Handshake
7273
Completion" sesction below.
7374

75+
The consumer can provide a NUL-terminated hostname in the @ta_peername
76+
field that is sent as part of ClientHello. If no peername is provided,
77+
the DNS hostname associated with the server's IP address is used instead.
78+
7479
The consumer can fill in the @ta_timeout_ms field to force the servicing
7580
handshake agent to exit after a number of milliseconds. This enables the
7681
socket to be fully closed once both the kernel and the handshake agent

Documentation/process/maintainer-netdev.rst

Lines changed: 26 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -127,13 +127,32 @@ the value of ``Message-ID`` to the URL above.
127127
Updating patch status
128128
~~~~~~~~~~~~~~~~~~~~~
129129

130-
It may be tempting to help the maintainers and update the state of your
131-
own patches when you post a new version or spot a bug. Please **do not**
132-
do that.
133-
Interfering with the patch status on patchwork will only cause confusion. Leave
134-
it to the maintainer to figure out what is the most recent and current
135-
version that should be applied. If there is any doubt, the maintainer
136-
will reply and ask what should be done.
130+
Contributors and reviewers do not have the permissions to update patch
131+
state directly in patchwork. Patchwork doesn't expose much information
132+
about the history of the state of patches, therefore having multiple
133+
people update the state leads to confusion.
134+
135+
Instead of delegating patchwork permissions netdev uses a simple mail
136+
bot which looks for special commands/lines within the emails sent to
137+
the mailing list. For example to mark a series as Changes Requested
138+
one needs to send the following line anywhere in the email thread::
139+
140+
pw-bot: changes-requested
141+
142+
As a result the bot will set the entire series to Changes Requested.
143+
This may be useful when author discovers a bug in their own series
144+
and wants to prevent it from getting applied.
145+
146+
The use of the bot is entirely optional, if in doubt ignore its existence
147+
completely. Maintainers will classify and update the state of the patches
148+
themselves. No email should ever be sent to the list with the main purpose
149+
of communicating with the bot, the bot commands should be seen as metadata.
150+
151+
The use of the bot is restricted to authors of the patches (the ``From:``
152+
header on patch submission and command must match!), maintainers themselves
153+
and a handful of senior reviewers. Bot records its activity here:
154+
155+
https://patchwork.hopto.org/pw-bot.html
137156

138157
Review timelines
139158
~~~~~~~~~~~~~~~~

MAINTAINERS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8153,6 +8153,7 @@ F: include/linux/spi/spi-fsl-dspi.h
81538153

81548154
FREESCALE ENETC ETHERNET DRIVERS
81558155
M: Claudiu Manoil <[email protected]>
8156+
M: Vladimir Oltean <[email protected]>
81568157
81578158
S: Maintained
81588159
F: drivers/net/ethernet/freescale/enetc/

drivers/bluetooth/btnxpuart.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1319,17 +1319,17 @@ static void nxp_serdev_remove(struct serdev_device *serdev)
13191319
hci_free_dev(hdev);
13201320
}
13211321

1322-
static struct btnxpuart_data w8987_data = {
1322+
static struct btnxpuart_data w8987_data __maybe_unused = {
13231323
.helper_fw_name = NULL,
13241324
.fw_name = FIRMWARE_W8987,
13251325
};
13261326

1327-
static struct btnxpuart_data w8997_data = {
1327+
static struct btnxpuart_data w8997_data __maybe_unused = {
13281328
.helper_fw_name = FIRMWARE_HELPER,
13291329
.fw_name = FIRMWARE_W8997,
13301330
};
13311331

1332-
static const struct of_device_id nxpuart_of_match_table[] = {
1332+
static const struct of_device_id nxpuart_of_match_table[] __maybe_unused = {
13331333
{ .compatible = "nxp,88w8987-bt", .data = &w8987_data },
13341334
{ .compatible = "nxp,88w8997-bt", .data = &w8997_data },
13351335
{ }

drivers/net/bonding/bond_main.c

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3947,7 +3947,11 @@ static int bond_slave_netdev_event(unsigned long event,
39473947
unblock_netpoll_tx();
39483948
break;
39493949
case NETDEV_FEAT_CHANGE:
3950-
bond_compute_features(bond);
3950+
if (!bond->notifier_ctx) {
3951+
bond->notifier_ctx = true;
3952+
bond_compute_features(bond);
3953+
bond->notifier_ctx = false;
3954+
}
39513955
break;
39523956
case NETDEV_RESEND_IGMP:
39533957
/* Propagate to master device */
@@ -6342,6 +6346,8 @@ static int bond_init(struct net_device *bond_dev)
63426346
if (!bond->wq)
63436347
return -ENOMEM;
63446348

6349+
bond->notifier_ctx = false;
6350+
63456351
spin_lock_init(&bond->stats_lock);
63466352
netdev_lockdep_set_classes(bond_dev);
63476353

drivers/net/ethernet/3com/3c589_cs.c

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -195,6 +195,7 @@ static int tc589_probe(struct pcmcia_device *link)
195195
{
196196
struct el3_private *lp;
197197
struct net_device *dev;
198+
int ret;
198199

199200
dev_dbg(&link->dev, "3c589_attach()\n");
200201

@@ -218,7 +219,15 @@ static int tc589_probe(struct pcmcia_device *link)
218219

219220
dev->ethtool_ops = &netdev_ethtool_ops;
220221

221-
return tc589_config(link);
222+
ret = tc589_config(link);
223+
if (ret)
224+
goto err_free_netdev;
225+
226+
return 0;
227+
228+
err_free_netdev:
229+
free_netdev(dev);
230+
return ret;
222231
}
223232

224233
static void tc589_detach(struct pcmcia_device *link)

drivers/net/ethernet/freescale/fec_main.c

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3834,6 +3834,11 @@ static int fec_enet_txq_xmit_frame(struct fec_enet_private *fep,
38343834
index = fec_enet_get_bd_index(last_bdp, &txq->bd);
38353835
txq->tx_skbuff[index] = NULL;
38363836

3837+
/* Make sure the updates to rest of the descriptor are performed before
3838+
* transferring ownership.
3839+
*/
3840+
dma_wmb();
3841+
38373842
/* Send it on its way. Tell FEC it's ready, interrupt when done,
38383843
* it's the last BD of the frame, and to put the CRC on the end.
38393844
*/
@@ -3843,8 +3848,14 @@ static int fec_enet_txq_xmit_frame(struct fec_enet_private *fep,
38433848
/* If this was the last BD in the ring, start at the beginning again. */
38443849
bdp = fec_enet_get_nextdesc(last_bdp, &txq->bd);
38453850

3851+
/* Make sure the update to bdp are performed before txq->bd.cur. */
3852+
dma_wmb();
3853+
38463854
txq->bd.cur = bdp;
38473855

3856+
/* Trigger transmission start */
3857+
writel(0, txq->bd.reg_desc_active);
3858+
38483859
return 0;
38493860
}
38503861

@@ -3873,12 +3884,6 @@ static int fec_enet_xdp_xmit(struct net_device *dev,
38733884
sent_frames++;
38743885
}
38753886

3876-
/* Make sure the update to bdp and tx_skbuff are performed. */
3877-
wmb();
3878-
3879-
/* Trigger transmission start */
3880-
writel(0, txq->bd.reg_desc_active);
3881-
38823887
__netif_tx_unlock(nq);
38833888

38843889
return sent_frames;

drivers/net/ethernet/marvell/octeontx2/nic/otx2_txrx.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -652,9 +652,7 @@ static void otx2_sqe_add_ext(struct otx2_nic *pfvf, struct otx2_snd_queue *sq,
652652
htons(ext->lso_sb - skb_network_offset(skb));
653653
} else if (skb_shinfo(skb)->gso_type & SKB_GSO_TCPV6) {
654654
ext->lso_format = pfvf->hw.lso_tsov6_idx;
655-
656-
ipv6_hdr(skb)->payload_len =
657-
htons(ext->lso_sb - skb_network_offset(skb));
655+
ipv6_hdr(skb)->payload_len = htons(tcp_hdrlen(skb));
658656
} else if (skb_shinfo(skb)->gso_type & SKB_GSO_UDP_L4) {
659657
__be16 l3_proto = vlan_get_protocol(skb);
660658
struct udphdr *udph = udp_hdr(skb);

drivers/net/ethernet/mediatek/mtk_eth_soc.c

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3269,18 +3269,14 @@ static int mtk_open(struct net_device *dev)
32693269
eth->dsa_meta[i] = md_dst;
32703270
}
32713271
} else {
3272-
/* Hardware special tag parsing needs to be disabled if at least
3273-
* one MAC does not use DSA.
3272+
/* Hardware DSA untagging and VLAN RX offloading need to be
3273+
* disabled if at least one MAC does not use DSA.
32743274
*/
32753275
u32 val = mtk_r32(eth, MTK_CDMP_IG_CTRL);
32763276

32773277
val &= ~MTK_CDMP_STAG_EN;
32783278
mtk_w32(eth, val, MTK_CDMP_IG_CTRL);
32793279

3280-
val = mtk_r32(eth, MTK_CDMQ_IG_CTRL);
3281-
val &= ~MTK_CDMQ_STAG_EN;
3282-
mtk_w32(eth, val, MTK_CDMQ_IG_CTRL);
3283-
32843280
mtk_w32(eth, 0, MTK_CDMP_EG_CTRL);
32853281
}
32863282

drivers/net/ethernet/mellanox/mlx5/core/cmd.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1920,9 +1920,10 @@ static void mlx5_cmd_err_trace(struct mlx5_core_dev *dev, u16 opcode, u16 op_mod
19201920
static void cmd_status_log(struct mlx5_core_dev *dev, u16 opcode, u8 status,
19211921
u32 syndrome, int err)
19221922
{
1923+
const char *namep = mlx5_command_str(opcode);
19231924
struct mlx5_cmd_stats *stats;
19241925

1925-
if (!err)
1926+
if (!err || !(strcmp(namep, "unknown command opcode")))
19261927
return;
19271928

19281929
stats = &dev->cmd.stats[opcode];

drivers/net/ethernet/mellanox/mlx5/core/en/ptp.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -175,6 +175,8 @@ static bool mlx5e_ptp_poll_ts_cq(struct mlx5e_cq *cq, int budget)
175175
/* ensure cq space is freed before enabling more cqes */
176176
wmb();
177177

178+
mlx5e_txqsq_wake(&ptpsq->txqsq);
179+
178180
return work_done == budget;
179181
}
180182

drivers/net/ethernet/mellanox/mlx5/core/en/tc_tun_encap.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1369,11 +1369,13 @@ static void mlx5e_invalidate_encap(struct mlx5e_priv *priv,
13691369
struct mlx5e_tc_flow *flow;
13701370

13711371
list_for_each_entry(flow, encap_flows, tmp_list) {
1372-
struct mlx5_flow_attr *attr = flow->attr;
13731372
struct mlx5_esw_flow_attr *esw_attr;
1373+
struct mlx5_flow_attr *attr;
13741374

13751375
if (!mlx5e_is_offloaded_flow(flow))
13761376
continue;
1377+
1378+
attr = mlx5e_tc_get_encap_attr(flow);
13771379
esw_attr = attr->esw_attr;
13781380

13791381
if (flow_flag_test(flow, SLOW))

drivers/net/ethernet/mellanox/mlx5/core/en/txrx.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -193,6 +193,8 @@ static inline u16 mlx5e_txqsq_get_next_pi(struct mlx5e_txqsq *sq, u16 size)
193193
return pi;
194194
}
195195

196+
void mlx5e_txqsq_wake(struct mlx5e_txqsq *sq);
197+
196198
static inline u16 mlx5e_shampo_get_cqe_header_index(struct mlx5e_rq *rq, struct mlx5_cqe64 *cqe)
197199
{
198200
return be16_to_cpu(cqe->shampo.header_entry_index) & (rq->mpwqe.shampo->hd_per_wq - 1);

drivers/net/ethernet/mellanox/mlx5/core/en_tc.c

Lines changed: 40 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1665,11 +1665,9 @@ bool mlx5e_tc_is_vf_tunnel(struct net_device *out_dev, struct net_device *route_
16651665
int mlx5e_tc_query_route_vport(struct net_device *out_dev, struct net_device *route_dev, u16 *vport)
16661666
{
16671667
struct mlx5e_priv *out_priv, *route_priv;
1668-
struct mlx5_devcom *devcom = NULL;
16691668
struct mlx5_core_dev *route_mdev;
16701669
struct mlx5_eswitch *esw;
16711670
u16 vhca_id;
1672-
int err;
16731671

16741672
out_priv = netdev_priv(out_dev);
16751673
esw = out_priv->mdev->priv.eswitch;
@@ -1678,6 +1676,9 @@ int mlx5e_tc_query_route_vport(struct net_device *out_dev, struct net_device *ro
16781676

16791677
vhca_id = MLX5_CAP_GEN(route_mdev, vhca_id);
16801678
if (mlx5_lag_is_active(out_priv->mdev)) {
1679+
struct mlx5_devcom *devcom;
1680+
int err;
1681+
16811682
/* In lag case we may get devices from different eswitch instances.
16821683
* If we failed to get vport num, it means, mostly, that we on the wrong
16831684
* eswitch.
@@ -1686,16 +1687,16 @@ int mlx5e_tc_query_route_vport(struct net_device *out_dev, struct net_device *ro
16861687
if (err != -ENOENT)
16871688
return err;
16881689

1690+
rcu_read_lock();
16891691
devcom = out_priv->mdev->priv.devcom;
1690-
esw = mlx5_devcom_get_peer_data(devcom, MLX5_DEVCOM_ESW_OFFLOADS);
1691-
if (!esw)
1692-
return -ENODEV;
1692+
esw = mlx5_devcom_get_peer_data_rcu(devcom, MLX5_DEVCOM_ESW_OFFLOADS);
1693+
err = esw ? mlx5_eswitch_vhca_id_to_vport(esw, vhca_id, vport) : -ENODEV;
1694+
rcu_read_unlock();
1695+
1696+
return err;
16931697
}
16941698

1695-
err = mlx5_eswitch_vhca_id_to_vport(esw, vhca_id, vport);
1696-
if (devcom)
1697-
mlx5_devcom_release_peer_data(devcom, MLX5_DEVCOM_ESW_OFFLOADS);
1698-
return err;
1699+
return mlx5_eswitch_vhca_id_to_vport(esw, vhca_id, vport);
16991700
}
17001701

17011702
static int
@@ -5301,6 +5302,8 @@ int mlx5e_tc_esw_init(struct mlx5_rep_uplink_priv *uplink_priv)
53015302
goto err_action_counter;
53025303
}
53035304

5305+
mlx5_esw_offloads_devcom_init(esw);
5306+
53045307
return 0;
53055308

53065309
err_action_counter:
@@ -5329,7 +5332,7 @@ void mlx5e_tc_esw_cleanup(struct mlx5_rep_uplink_priv *uplink_priv)
53295332
priv = netdev_priv(rpriv->netdev);
53305333
esw = priv->mdev->priv.eswitch;
53315334

5332-
mlx5e_tc_clean_fdb_peer_flows(esw);
5335+
mlx5_esw_offloads_devcom_cleanup(esw);
53335336

53345337
mlx5e_tc_tun_cleanup(uplink_priv->encap);
53355338

@@ -5643,22 +5646,43 @@ bool mlx5e_tc_update_skb_nic(struct mlx5_cqe64 *cqe, struct sk_buff *skb)
56435646
0, NULL);
56445647
}
56455648

5649+
static struct mapping_ctx *
5650+
mlx5e_get_priv_obj_mapping(struct mlx5e_priv *priv)
5651+
{
5652+
struct mlx5e_tc_table *tc;
5653+
struct mlx5_eswitch *esw;
5654+
struct mapping_ctx *ctx;
5655+
5656+
if (is_mdev_switchdev_mode(priv->mdev)) {
5657+
esw = priv->mdev->priv.eswitch;
5658+
ctx = esw->offloads.reg_c0_obj_pool;
5659+
} else {
5660+
tc = mlx5e_fs_get_tc(priv->fs);
5661+
ctx = tc->mapping;
5662+
}
5663+
5664+
return ctx;
5665+
}
5666+
56465667
int mlx5e_tc_action_miss_mapping_get(struct mlx5e_priv *priv, struct mlx5_flow_attr *attr,
56475668
u64 act_miss_cookie, u32 *act_miss_mapping)
56485669
{
5649-
struct mlx5_eswitch *esw = priv->mdev->priv.eswitch;
56505670
struct mlx5_mapped_obj mapped_obj = {};
5671+
struct mlx5_eswitch *esw;
56515672
struct mapping_ctx *ctx;
56525673
int err;
56535674

5654-
ctx = esw->offloads.reg_c0_obj_pool;
5655-
5675+
ctx = mlx5e_get_priv_obj_mapping(priv);
56565676
mapped_obj.type = MLX5_MAPPED_OBJ_ACT_MISS;
56575677
mapped_obj.act_miss_cookie = act_miss_cookie;
56585678
err = mapping_add(ctx, &mapped_obj, act_miss_mapping);
56595679
if (err)
56605680
return err;
56615681

5682+
if (!is_mdev_switchdev_mode(priv->mdev))
5683+
return 0;
5684+
5685+
esw = priv->mdev->priv.eswitch;
56625686
attr->act_id_restore_rule = esw_add_restore_rule(esw, *act_miss_mapping);
56635687
if (IS_ERR(attr->act_id_restore_rule))
56645688
goto err_rule;
@@ -5673,10 +5697,9 @@ int mlx5e_tc_action_miss_mapping_get(struct mlx5e_priv *priv, struct mlx5_flow_a
56735697
void mlx5e_tc_action_miss_mapping_put(struct mlx5e_priv *priv, struct mlx5_flow_attr *attr,
56745698
u32 act_miss_mapping)
56755699
{
5676-
struct mlx5_eswitch *esw = priv->mdev->priv.eswitch;
5677-
struct mapping_ctx *ctx;
5700+
struct mapping_ctx *ctx = mlx5e_get_priv_obj_mapping(priv);
56785701

5679-
ctx = esw->offloads.reg_c0_obj_pool;
5680-
mlx5_del_flow_rules(attr->act_id_restore_rule);
5702+
if (is_mdev_switchdev_mode(priv->mdev))
5703+
mlx5_del_flow_rules(attr->act_id_restore_rule);
56815704
mapping_remove(ctx, act_miss_mapping);
56825705
}

0 commit comments

Comments
 (0)