Skip to content

Commit 609d3bc

Browse files
committed
Merge tag 'net-6.2-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net
Pull networking fixes from Jakub Kicinski: "Including fixes from bpf, netfilter and can. Current release - regressions: - bpf: synchronize dispatcher update with bpf_dispatcher_xdp_func - rxrpc: - fix security setting propagation - fix null-deref in rxrpc_unuse_local() - fix switched parameters in peer tracing Current release - new code bugs: - rxrpc: - fix I/O thread startup getting skipped - fix locking issues in rxrpc_put_peer_locked() - fix I/O thread stop - fix uninitialised variable in rxperf server - fix the return value of rxrpc_new_incoming_call() - microchip: vcap: fix initialization of value and mask - nfp: fix unaligned io read of capabilities word Previous releases - regressions: - stop in-kernel socket users from corrupting socket's task_frag - stream: purge sk_error_queue in sk_stream_kill_queues() - openvswitch: fix flow lookup to use unmasked key - dsa: mv88e6xxx: avoid reg_lock deadlock in mv88e6xxx_setup_port() - devlink: - hold region lock when flushing snapshots - protect devlink dump by the instance lock Previous releases - always broken: - bpf: - prevent leak of lsm program after failed attach - resolve fext program type when checking map compatibility - skbuff: account for tail adjustment during pull operations - macsec: fix net device access prior to holding a lock - bonding: switch back when high prio link up - netfilter: flowtable: really fix NAT IPv6 offload - enetc: avoid buffer leaks on xdp_do_redirect() failure - unix: fix race in SOCK_SEQPACKET's unix_dgram_sendmsg() - dsa: microchip: remove IRQF_TRIGGER_FALLING in request_threaded_irq" * tag 'net-6.2-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net: (64 commits) net: fec: check the return value of build_skb() net: simplify sk_page_frag Treewide: Stop corrupting socket's task_frag net: Introduce sk_use_task_frag in struct sock. mctp: Remove device type check at unregister net: dsa: microchip: remove IRQF_TRIGGER_FALLING in request_threaded_irq can: kvaser_usb: hydra: help gcc-13 to figure out cmd_len can: flexcan: avoid unbalanced pm_runtime_enable warning Documentation: devlink: add missing toc entry for etas_es58x devlink doc mctp: serial: Fix starting value for frame check sequence nfp: fix unaligned io read of capabilities word net: stream: purge sk_error_queue in sk_stream_kill_queues() myri10ge: Fix an error handling path in myri10ge_probe() net: microchip: vcap: Fix initialization of value and mask rxrpc: Fix the return value of rxrpc_new_incoming_call() rxrpc: rxperf: Fix uninitialised variable rxrpc: Fix I/O thread stop rxrpc: Fix switched parameters in peer tracing rxrpc: Fix locking issues in rxrpc_put_peer_locked() rxrpc: Fix I/O thread startup getting skipped ...
2 parents 878cf96 + 19e72b0 commit 609d3bc

Some content is hidden

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

77 files changed

+861
-257
lines changed

Documentation/bpf/map_sk_storage.rst

Lines changed: 30 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -34,13 +34,12 @@ bpf_sk_storage_get()
3434
3535
void *bpf_sk_storage_get(struct bpf_map *map, void *sk, void *value, u64 flags)
3636
37-
Socket-local storage can be retrieved using the ``bpf_sk_storage_get()``
38-
helper. The helper gets the storage from ``sk`` that is associated with ``map``.
39-
If the ``BPF_LOCAL_STORAGE_GET_F_CREATE`` flag is used then
40-
``bpf_sk_storage_get()`` will create the storage for ``sk`` if it does not
41-
already exist. ``value`` can be used together with
42-
``BPF_LOCAL_STORAGE_GET_F_CREATE`` to initialize the storage value, otherwise it
43-
will be zero initialized. Returns a pointer to the storage on success, or
37+
Socket-local storage for ``map`` can be retrieved from socket ``sk`` using the
38+
``bpf_sk_storage_get()`` helper. If the ``BPF_LOCAL_STORAGE_GET_F_CREATE``
39+
flag is used then ``bpf_sk_storage_get()`` will create the storage for ``sk``
40+
if it does not already exist. ``value`` can be used together with
41+
``BPF_LOCAL_STORAGE_GET_F_CREATE`` to initialize the storage value, otherwise
42+
it will be zero initialized. Returns a pointer to the storage on success, or
4443
``NULL`` in case of failure.
4544

4645
.. note::
@@ -54,9 +53,9 @@ bpf_sk_storage_delete()
5453
5554
long bpf_sk_storage_delete(struct bpf_map *map, void *sk)
5655
57-
Socket-local storage can be deleted using the ``bpf_sk_storage_delete()``
58-
helper. The helper deletes the storage from ``sk`` that is identified by
59-
``map``. Returns ``0`` on success, or negative error in case of failure.
56+
Socket-local storage for ``map`` can be deleted from socket ``sk`` using the
57+
``bpf_sk_storage_delete()`` helper. Returns ``0`` on success, or negative
58+
error in case of failure.
6059

6160
User space
6261
----------
@@ -68,16 +67,20 @@ bpf_map_update_elem()
6867
6968
int bpf_map_update_elem(int map_fd, const void *key, const void *value, __u64 flags)
7069
71-
Socket-local storage for the socket identified by ``key`` belonging to
72-
``map_fd`` can be added or updated using the ``bpf_map_update_elem()`` libbpf
73-
function. ``key`` must be a pointer to a valid ``fd`` in the user space
74-
program. The ``flags`` parameter can be used to control the update behaviour:
70+
Socket-local storage for map ``map_fd`` can be added or updated locally to a
71+
socket using the ``bpf_map_update_elem()`` libbpf function. The socket is
72+
identified by a `socket` ``fd`` stored in the pointer ``key``. The pointer
73+
``value`` has the data to be added or updated to the socket ``fd``. The type
74+
and size of ``value`` should be the same as the value type of the map
75+
definition.
7576

76-
- ``BPF_ANY`` will create storage for ``fd`` or update existing storage.
77-
- ``BPF_NOEXIST`` will create storage for ``fd`` only if it did not already
78-
exist, otherwise the call will fail with ``-EEXIST``.
79-
- ``BPF_EXIST`` will update existing storage for ``fd`` if it already exists,
80-
otherwise the call will fail with ``-ENOENT``.
77+
The ``flags`` parameter can be used to control the update behaviour:
78+
79+
- ``BPF_ANY`` will create storage for `socket` ``fd`` or update existing storage.
80+
- ``BPF_NOEXIST`` will create storage for `socket` ``fd`` only if it did not
81+
already exist, otherwise the call will fail with ``-EEXIST``.
82+
- ``BPF_EXIST`` will update existing storage for `socket` ``fd`` if it already
83+
exists, otherwise the call will fail with ``-ENOENT``.
8184

8285
Returns ``0`` on success, or negative error in case of failure.
8386

@@ -88,10 +91,10 @@ bpf_map_lookup_elem()
8891
8992
int bpf_map_lookup_elem(int map_fd, const void *key, void *value)
9093
91-
Socket-local storage for the socket identified by ``key`` belonging to
92-
``map_fd`` can be retrieved using the ``bpf_map_lookup_elem()`` libbpf
93-
function. ``key`` must be a pointer to a valid ``fd`` in the user space
94-
program. Returns ``0`` on success, or negative error in case of failure.
94+
Socket-local storage for map ``map_fd`` can be retrieved from a socket using
95+
the ``bpf_map_lookup_elem()`` libbpf function. The storage is retrieved from
96+
the socket identified by a `socket` ``fd`` stored in the pointer
97+
``key``. Returns ``0`` on success, or negative error in case of failure.
9598

9699
bpf_map_delete_elem()
97100
~~~~~~~~~~~~~~~~~~~~~
@@ -100,9 +103,10 @@ bpf_map_delete_elem()
100103
101104
int bpf_map_delete_elem(int map_fd, const void *key)
102105
103-
Socket-local storage for the socket identified by ``key`` belonging to
104-
``map_fd`` can be deleted using the ``bpf_map_delete_elem()`` libbpf
105-
function. Returns ``0`` on success, or negative error in case of failure.
106+
Socket-local storage for map ``map_fd`` can be deleted from a socket using the
107+
``bpf_map_delete_elem()`` libbpf function. The storage is deleted from the
108+
socket identified by a `socket` ``fd`` stored in the pointer ``key``. Returns
109+
``0`` on success, or negative error in case of failure.
106110

107111
Examples
108112
========

Documentation/networking/devlink/index.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ parameters, info versions, and other features it supports.
5050
:maxdepth: 1
5151

5252
bnxt
53+
etas_es58x
5354
hns3
5455
ionic
5556
ice

Documentation/networking/nf_conntrack-sysctl.rst

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,39 @@ nf_conntrack_timestamp - BOOLEAN
163163

164164
Enable connection tracking flow timestamping.
165165

166+
nf_conntrack_sctp_timeout_closed - INTEGER (seconds)
167+
default 10
168+
169+
nf_conntrack_sctp_timeout_cookie_wait - INTEGER (seconds)
170+
default 3
171+
172+
nf_conntrack_sctp_timeout_cookie_echoed - INTEGER (seconds)
173+
default 3
174+
175+
nf_conntrack_sctp_timeout_established - INTEGER (seconds)
176+
default 432000 (5 days)
177+
178+
nf_conntrack_sctp_timeout_shutdown_sent - INTEGER (seconds)
179+
default 0.3
180+
181+
nf_conntrack_sctp_timeout_shutdown_recd - INTEGER (seconds)
182+
default 0.3
183+
184+
nf_conntrack_sctp_timeout_shutdown_ack_sent - INTEGER (seconds)
185+
default 3
186+
187+
nf_conntrack_sctp_timeout_heartbeat_sent - INTEGER (seconds)
188+
default 30
189+
190+
This timeout is used to setup conntrack entry on secondary paths.
191+
Default is set to hb_interval.
192+
193+
nf_conntrack_sctp_timeout_heartbeat_acked - INTEGER (seconds)
194+
default 210
195+
196+
This timeout is used to setup conntrack entry on secondary paths.
197+
Default is set to (hb_interval * path_max_retrans + rto_max)
198+
166199
nf_conntrack_udp_timeout - INTEGER (seconds)
167200
default 30
168201

drivers/block/drbd/drbd_receiver.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1030,6 +1030,9 @@ static int conn_connect(struct drbd_connection *connection)
10301030
sock.socket->sk->sk_allocation = GFP_NOIO;
10311031
msock.socket->sk->sk_allocation = GFP_NOIO;
10321032

1033+
sock.socket->sk->sk_use_task_frag = false;
1034+
msock.socket->sk->sk_use_task_frag = false;
1035+
10331036
sock.socket->sk->sk_priority = TC_PRIO_INTERACTIVE_BULK;
10341037
msock.socket->sk->sk_priority = TC_PRIO_INTERACTIVE;
10351038

drivers/block/nbd.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -512,6 +512,7 @@ static int sock_xmit(struct nbd_device *nbd, int index, int send,
512512
noreclaim_flag = memalloc_noreclaim_save();
513513
do {
514514
sock->sk->sk_allocation = GFP_NOIO | __GFP_MEMALLOC;
515+
sock->sk->sk_use_task_frag = false;
515516
msg.msg_name = NULL;
516517
msg.msg_namelen = 0;
517518
msg.msg_control = NULL;

drivers/isdn/hardware/mISDN/hfcmulti.c

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3217,6 +3217,7 @@ static int
32173217
hfcm_l1callback(struct dchannel *dch, u_int cmd)
32183218
{
32193219
struct hfc_multi *hc = dch->hw;
3220+
struct sk_buff_head free_queue;
32203221
u_long flags;
32213222

32223223
switch (cmd) {
@@ -3245,6 +3246,7 @@ hfcm_l1callback(struct dchannel *dch, u_int cmd)
32453246
l1_event(dch->l1, HW_POWERUP_IND);
32463247
break;
32473248
case HW_DEACT_REQ:
3249+
__skb_queue_head_init(&free_queue);
32483250
/* start deactivation */
32493251
spin_lock_irqsave(&hc->lock, flags);
32503252
if (hc->ctype == HFC_TYPE_E1) {
@@ -3264,20 +3266,21 @@ hfcm_l1callback(struct dchannel *dch, u_int cmd)
32643266
plxsd_checksync(hc, 0);
32653267
}
32663268
}
3267-
skb_queue_purge(&dch->squeue);
3269+
skb_queue_splice_init(&dch->squeue, &free_queue);
32683270
if (dch->tx_skb) {
3269-
dev_kfree_skb(dch->tx_skb);
3271+
__skb_queue_tail(&free_queue, dch->tx_skb);
32703272
dch->tx_skb = NULL;
32713273
}
32723274
dch->tx_idx = 0;
32733275
if (dch->rx_skb) {
3274-
dev_kfree_skb(dch->rx_skb);
3276+
__skb_queue_tail(&free_queue, dch->rx_skb);
32753277
dch->rx_skb = NULL;
32763278
}
32773279
test_and_clear_bit(FLG_TX_BUSY, &dch->Flags);
32783280
if (test_and_clear_bit(FLG_BUSY_TIMER, &dch->Flags))
32793281
del_timer(&dch->timer);
32803282
spin_unlock_irqrestore(&hc->lock, flags);
3283+
__skb_queue_purge(&free_queue);
32813284
break;
32823285
case HW_POWERUP_REQ:
32833286
spin_lock_irqsave(&hc->lock, flags);
@@ -3384,6 +3387,9 @@ handle_dmsg(struct mISDNchannel *ch, struct sk_buff *skb)
33843387
case PH_DEACTIVATE_REQ:
33853388
test_and_clear_bit(FLG_L2_ACTIVATED, &dch->Flags);
33863389
if (dch->dev.D.protocol != ISDN_P_TE_S0) {
3390+
struct sk_buff_head free_queue;
3391+
3392+
__skb_queue_head_init(&free_queue);
33873393
spin_lock_irqsave(&hc->lock, flags);
33883394
if (debug & DEBUG_HFCMULTI_MSG)
33893395
printk(KERN_DEBUG
@@ -3405,14 +3411,14 @@ handle_dmsg(struct mISDNchannel *ch, struct sk_buff *skb)
34053411
/* deactivate */
34063412
dch->state = 1;
34073413
}
3408-
skb_queue_purge(&dch->squeue);
3414+
skb_queue_splice_init(&dch->squeue, &free_queue);
34093415
if (dch->tx_skb) {
3410-
dev_kfree_skb(dch->tx_skb);
3416+
__skb_queue_tail(&free_queue, dch->tx_skb);
34113417
dch->tx_skb = NULL;
34123418
}
34133419
dch->tx_idx = 0;
34143420
if (dch->rx_skb) {
3415-
dev_kfree_skb(dch->rx_skb);
3421+
__skb_queue_tail(&free_queue, dch->rx_skb);
34163422
dch->rx_skb = NULL;
34173423
}
34183424
test_and_clear_bit(FLG_TX_BUSY, &dch->Flags);
@@ -3424,6 +3430,7 @@ handle_dmsg(struct mISDNchannel *ch, struct sk_buff *skb)
34243430
#endif
34253431
ret = 0;
34263432
spin_unlock_irqrestore(&hc->lock, flags);
3433+
__skb_queue_purge(&free_queue);
34273434
} else
34283435
ret = l1_event(dch->l1, hh->prim);
34293436
break;

drivers/isdn/hardware/mISDN/hfcpci.c

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1617,16 +1617,19 @@ hfcpci_l2l1D(struct mISDNchannel *ch, struct sk_buff *skb)
16171617
test_and_clear_bit(FLG_L2_ACTIVATED, &dch->Flags);
16181618
spin_lock_irqsave(&hc->lock, flags);
16191619
if (hc->hw.protocol == ISDN_P_NT_S0) {
1620+
struct sk_buff_head free_queue;
1621+
1622+
__skb_queue_head_init(&free_queue);
16201623
/* prepare deactivation */
16211624
Write_hfc(hc, HFCPCI_STATES, 0x40);
1622-
skb_queue_purge(&dch->squeue);
1625+
skb_queue_splice_init(&dch->squeue, &free_queue);
16231626
if (dch->tx_skb) {
1624-
dev_kfree_skb(dch->tx_skb);
1627+
__skb_queue_tail(&free_queue, dch->tx_skb);
16251628
dch->tx_skb = NULL;
16261629
}
16271630
dch->tx_idx = 0;
16281631
if (dch->rx_skb) {
1629-
dev_kfree_skb(dch->rx_skb);
1632+
__skb_queue_tail(&free_queue, dch->rx_skb);
16301633
dch->rx_skb = NULL;
16311634
}
16321635
test_and_clear_bit(FLG_TX_BUSY, &dch->Flags);
@@ -1639,10 +1642,12 @@ hfcpci_l2l1D(struct mISDNchannel *ch, struct sk_buff *skb)
16391642
hc->hw.mst_m &= ~HFCPCI_MASTER;
16401643
Write_hfc(hc, HFCPCI_MST_MODE, hc->hw.mst_m);
16411644
ret = 0;
1645+
spin_unlock_irqrestore(&hc->lock, flags);
1646+
__skb_queue_purge(&free_queue);
16421647
} else {
16431648
ret = l1_event(dch->l1, hh->prim);
1649+
spin_unlock_irqrestore(&hc->lock, flags);
16441650
}
1645-
spin_unlock_irqrestore(&hc->lock, flags);
16461651
break;
16471652
}
16481653
if (!ret)

drivers/isdn/hardware/mISDN/hfcsusb.c

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -326,20 +326,24 @@ hfcusb_l2l1D(struct mISDNchannel *ch, struct sk_buff *skb)
326326
test_and_clear_bit(FLG_L2_ACTIVATED, &dch->Flags);
327327

328328
if (hw->protocol == ISDN_P_NT_S0) {
329+
struct sk_buff_head free_queue;
330+
331+
__skb_queue_head_init(&free_queue);
329332
hfcsusb_ph_command(hw, HFC_L1_DEACTIVATE_NT);
330333
spin_lock_irqsave(&hw->lock, flags);
331-
skb_queue_purge(&dch->squeue);
334+
skb_queue_splice_init(&dch->squeue, &free_queue);
332335
if (dch->tx_skb) {
333-
dev_kfree_skb(dch->tx_skb);
336+
__skb_queue_tail(&free_queue, dch->tx_skb);
334337
dch->tx_skb = NULL;
335338
}
336339
dch->tx_idx = 0;
337340
if (dch->rx_skb) {
338-
dev_kfree_skb(dch->rx_skb);
341+
__skb_queue_tail(&free_queue, dch->rx_skb);
339342
dch->rx_skb = NULL;
340343
}
341344
test_and_clear_bit(FLG_TX_BUSY, &dch->Flags);
342345
spin_unlock_irqrestore(&hw->lock, flags);
346+
__skb_queue_purge(&free_queue);
343347
#ifdef FIXME
344348
if (test_and_clear_bit(FLG_L1_BUSY, &dch->Flags))
345349
dchannel_sched_event(&hc->dch, D_CLEARBUSY);
@@ -1330,7 +1334,7 @@ tx_iso_complete(struct urb *urb)
13301334
printk("\n");
13311335
}
13321336

1333-
dev_kfree_skb(tx_skb);
1337+
dev_consume_skb_irq(tx_skb);
13341338
tx_skb = NULL;
13351339
if (fifo->dch && get_next_dframe(fifo->dch))
13361340
tx_skb = fifo->dch->tx_skb;

drivers/net/bonding/bond_main.c

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2654,8 +2654,9 @@ static void bond_miimon_link_change(struct bonding *bond,
26542654

26552655
static void bond_miimon_commit(struct bonding *bond)
26562656
{
2657-
struct list_head *iter;
26582657
struct slave *slave, *primary;
2658+
bool do_failover = false;
2659+
struct list_head *iter;
26592660

26602661
bond_for_each_slave(bond, slave, iter) {
26612662
switch (slave->link_new_state) {
@@ -2699,8 +2700,9 @@ static void bond_miimon_commit(struct bonding *bond)
26992700

27002701
bond_miimon_link_change(bond, slave, BOND_LINK_UP);
27012702

2702-
if (!bond->curr_active_slave || slave == primary)
2703-
goto do_failover;
2703+
if (!rcu_access_pointer(bond->curr_active_slave) || slave == primary ||
2704+
slave->prio > rcu_dereference(bond->curr_active_slave)->prio)
2705+
do_failover = true;
27042706

27052707
continue;
27062708

@@ -2721,7 +2723,7 @@ static void bond_miimon_commit(struct bonding *bond)
27212723
bond_miimon_link_change(bond, slave, BOND_LINK_DOWN);
27222724

27232725
if (slave == rcu_access_pointer(bond->curr_active_slave))
2724-
goto do_failover;
2726+
do_failover = true;
27252727

27262728
continue;
27272729

@@ -2732,8 +2734,9 @@ static void bond_miimon_commit(struct bonding *bond)
27322734

27332735
continue;
27342736
}
2737+
}
27352738

2736-
do_failover:
2739+
if (do_failover) {
27372740
block_netpoll_tx();
27382741
bond_select_active_slave(bond);
27392742
unblock_netpoll_tx();
@@ -3531,6 +3534,7 @@ static int bond_ab_arp_inspect(struct bonding *bond)
35313534
*/
35323535
static void bond_ab_arp_commit(struct bonding *bond)
35333536
{
3537+
bool do_failover = false;
35343538
struct list_head *iter;
35353539
unsigned long last_tx;
35363540
struct slave *slave;
@@ -3560,8 +3564,9 @@ static void bond_ab_arp_commit(struct bonding *bond)
35603564
slave_info(bond->dev, slave->dev, "link status definitely up\n");
35613565

35623566
if (!rtnl_dereference(bond->curr_active_slave) ||
3563-
slave == rtnl_dereference(bond->primary_slave))
3564-
goto do_failover;
3567+
slave == rtnl_dereference(bond->primary_slave) ||
3568+
slave->prio > rtnl_dereference(bond->curr_active_slave)->prio)
3569+
do_failover = true;
35653570

35663571
}
35673572

@@ -3580,7 +3585,7 @@ static void bond_ab_arp_commit(struct bonding *bond)
35803585

35813586
if (slave == rtnl_dereference(bond->curr_active_slave)) {
35823587
RCU_INIT_POINTER(bond->current_arp_slave, NULL);
3583-
goto do_failover;
3588+
do_failover = true;
35843589
}
35853590

35863591
continue;
@@ -3604,8 +3609,9 @@ static void bond_ab_arp_commit(struct bonding *bond)
36043609
slave->link_new_state);
36053610
continue;
36063611
}
3612+
}
36073613

3608-
do_failover:
3614+
if (do_failover) {
36093615
block_netpoll_tx();
36103616
bond_select_active_slave(bond);
36113617
unblock_netpoll_tx();

0 commit comments

Comments
 (0)