Skip to content

Commit f54ca91

Browse files
committed
Merge tag 'net-5.16-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net
Pull networking fixes from Jakub Kicinski: "Including fixes from bpf, can and netfilter. Current release - regressions: - bpf: do not reject when the stack read size is different from the tracked scalar size - net: fix premature exit from NAPI state polling in napi_disable() - riscv, bpf: fix RV32 broken build, and silence RV64 warning Current release - new code bugs: - net: fix possible NULL deref in sock_reserve_memory - amt: fix error return code in amt_init(); fix stopping the workqueue - ax88796c: use the correct ioctl callback Previous releases - always broken: - bpf: stop caching subprog index in the bpf_pseudo_func insn - security: fixups for the security hooks in sctp - nfc: add necessary privilege flags in netlink layer, limit operations to admin only - vsock: prevent unnecessary refcnt inc for non-blocking connect - net/smc: fix sk_refcnt underflow on link down and fallback - nfnetlink_queue: fix OOB when mac header was cleared - can: j1939: ignore invalid messages per standard - bpf, sockmap: - fix race in ingress receive verdict with redirect to self - fix incorrect sk_skb data_end access when src_reg = dst_reg - strparser, and tls are reusing qdisc_skb_cb and colliding - ethtool: fix ethtool msg len calculation for pause stats - vlan: fix a UAF in vlan_dev_real_dev() when ref-holder tries to access an unregistering real_dev - udp6: make encap_rcv() bump the v6 not v4 stats - drv: prestera: add explicit padding to fix m68k build - drv: felix: fix broken VLAN-tagged PTP under VLAN-aware bridge - drv: mvpp2: fix wrong SerDes reconfiguration order Misc & small latecomers: - ipvs: auto-load ipvs on genl access - mctp: sanity check the struct sockaddr_mctp padding fields - libfs: support RENAME_EXCHANGE in simple_rename() - avoid double accounting for pure zerocopy skbs" * tag 'net-5.16-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net: (123 commits) selftests/net: udpgso_bench_rx: fix port argument net: wwan: iosm: fix compilation warning cxgb4: fix eeprom len when diagnostics not implemented net: fix premature exit from NAPI state polling in napi_disable() net/smc: fix sk_refcnt underflow on linkdown and fallback net/mlx5: Lag, fix a potential Oops with mlx5_lag_create_definer() gve: fix unmatched u64_stats_update_end() net: ethernet: lantiq_etop: Fix compilation error selftests: forwarding: Fix packet matching in mirroring selftests vsock: prevent unnecessary refcnt inc for nonblocking connect net: marvell: mvpp2: Fix wrong SerDes reconfiguration order net: ethernet: ti: cpsw_ale: Fix access to un-initialized memory net: stmmac: allow a tc-taprio base-time of zero selftests: net: test_vxlan_under_vrf: fix HV connectivity test net: hns3: allow configure ETS bandwidth of all TCs net: hns3: remove check VF uc mac exist when set by PF net: hns3: fix some mac statistics is always 0 in device version V2 net: hns3: fix kernel crash when unload VF while it is being reset net: hns3: sync rx ring head in echo common pull net: hns3: fix pfc packet number incorrect after querying pfc parameters ...
2 parents c55a041 + d336509 commit f54ca91

File tree

134 files changed

+1242
-730
lines changed

Some content is hidden

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

134 files changed

+1242
-730
lines changed

Documentation/networking/ip-sysctl.rst

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1004,13 +1004,11 @@ udp_l3mdev_accept - BOOLEAN
10041004
udp_mem - vector of 3 INTEGERs: min, pressure, max
10051005
Number of pages allowed for queueing by all UDP sockets.
10061006

1007-
min: Below this number of pages UDP is not bothered about its
1008-
memory appetite. When amount of memory allocated by UDP exceeds
1009-
this number, UDP starts to moderate memory usage.
1007+
min: Number of pages allowed for queueing by all UDP sockets.
10101008

10111009
pressure: This value was introduced to follow format of tcp_mem.
10121010

1013-
max: Number of pages allowed for queueing by all UDP sockets.
1011+
max: This value was introduced to follow format of tcp_mem.
10141012

10151013
Default is calculated at boot time from amount of available memory.
10161014

Documentation/security/SCTP.rst

Lines changed: 33 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -15,22 +15,19 @@ For security module support, three SCTP specific hooks have been implemented::
1515
security_sctp_assoc_request()
1616
security_sctp_bind_connect()
1717
security_sctp_sk_clone()
18-
19-
Also the following security hook has been utilised::
20-
21-
security_inet_conn_established()
18+
security_sctp_assoc_established()
2219

2320
The usage of these hooks are described below with the SELinux implementation
2421
described in the `SCTP SELinux Support`_ chapter.
2522

2623

2724
security_sctp_assoc_request()
2825
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
29-
Passes the ``@ep`` and ``@chunk->skb`` of the association INIT packet to the
26+
Passes the ``@asoc`` and ``@chunk->skb`` of the association INIT packet to the
3027
security module. Returns 0 on success, error on failure.
3128
::
3229

33-
@ep - pointer to sctp endpoint structure.
30+
@asoc - pointer to sctp association structure.
3431
@skb - pointer to skbuff of association packet.
3532

3633

@@ -117,24 +114,25 @@ Called whenever a new socket is created by **accept**\(2)
117114
calls **sctp_peeloff**\(3).
118115
::
119116

120-
@ep - pointer to current sctp endpoint structure.
117+
@asoc - pointer to current sctp association structure.
121118
@sk - pointer to current sock structure.
122-
@sk - pointer to new sock structure.
119+
@newsk - pointer to new sock structure.
123120

124121

125-
security_inet_conn_established()
122+
security_sctp_assoc_established()
126123
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
127-
Called when a COOKIE ACK is received::
124+
Called when a COOKIE ACK is received, and the peer secid will be
125+
saved into ``@asoc->peer_secid`` for client::
128126

129-
@sk - pointer to sock structure.
127+
@asoc - pointer to sctp association structure.
130128
@skb - pointer to skbuff of the COOKIE ACK packet.
131129

132130

133131
Security Hooks used for Association Establishment
134132
-------------------------------------------------
135133

136134
The following diagram shows the use of ``security_sctp_bind_connect()``,
137-
``security_sctp_assoc_request()``, ``security_inet_conn_established()`` when
135+
``security_sctp_assoc_request()``, ``security_sctp_assoc_established()`` when
138136
establishing an association.
139137
::
140138

@@ -151,9 +149,9 @@ establishing an association.
151149
INIT --------------------------------------------->
152150
sctp_sf_do_5_1B_init()
153151
Respond to an INIT chunk.
154-
SCTP peer endpoint "A" is
155-
asking for an association. Call
156-
security_sctp_assoc_request()
152+
SCTP peer endpoint "A" is asking
153+
for a temporary association.
154+
Call security_sctp_assoc_request()
157155
to set the peer label if first
158156
association.
159157
If not first association, check
@@ -163,13 +161,16 @@ establishing an association.
163161
| discard the packet.
164162
|
165163
COOKIE ECHO ------------------------------------------>
166-
|
167-
|
168-
|
164+
sctp_sf_do_5_1D_ce()
165+
Respond to an COOKIE ECHO chunk.
166+
Confirm the cookie and create a
167+
permanent association.
168+
Call security_sctp_assoc_request() to
169+
do the same as for INIT chunk Response.
169170
<------------------------------------------- COOKIE ACK
170171
| |
171172
sctp_sf_do_5_1E_ca |
172-
Call security_inet_conn_established() |
173+
Call security_sctp_assoc_established() |
173174
to set the peer label. |
174175
| |
175176
| If SCTP_SOCKET_TCP or peeled off
@@ -195,27 +196,27 @@ hooks with the SELinux specifics expanded below::
195196
security_sctp_assoc_request()
196197
security_sctp_bind_connect()
197198
security_sctp_sk_clone()
198-
security_inet_conn_established()
199+
security_sctp_assoc_established()
199200

200201

201202
security_sctp_assoc_request()
202203
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
203-
Passes the ``@ep`` and ``@chunk->skb`` of the association INIT packet to the
204+
Passes the ``@asoc`` and ``@chunk->skb`` of the association INIT packet to the
204205
security module. Returns 0 on success, error on failure.
205206
::
206207

207-
@ep - pointer to sctp endpoint structure.
208+
@asoc - pointer to sctp association structure.
208209
@skb - pointer to skbuff of association packet.
209210

210211
The security module performs the following operations:
211-
IF this is the first association on ``@ep->base.sk``, then set the peer
212+
IF this is the first association on ``@asoc->base.sk``, then set the peer
212213
sid to that in ``@skb``. This will ensure there is only one peer sid
213-
assigned to ``@ep->base.sk`` that may support multiple associations.
214+
assigned to ``@asoc->base.sk`` that may support multiple associations.
214215

215-
ELSE validate the ``@ep->base.sk peer_sid`` against the ``@skb peer sid``
216+
ELSE validate the ``@asoc->base.sk peer_sid`` against the ``@skb peer sid``
216217
to determine whether the association should be allowed or denied.
217218

218-
Set the sctp ``@ep sid`` to socket's sid (from ``ep->base.sk``) with
219+
Set the sctp ``@asoc sid`` to socket's sid (from ``asoc->base.sk``) with
219220
MLS portion taken from ``@skb peer sid``. This will be used by SCTP
220221
TCP style sockets and peeled off connections as they cause a new socket
221222
to be generated.
@@ -259,21 +260,21 @@ security_sctp_sk_clone()
259260
Called whenever a new socket is created by **accept**\(2) (i.e. a TCP style
260261
socket) or when a socket is 'peeled off' e.g userspace calls
261262
**sctp_peeloff**\(3). ``security_sctp_sk_clone()`` will set the new
262-
sockets sid and peer sid to that contained in the ``@ep sid`` and
263-
``@ep peer sid`` respectively.
263+
sockets sid and peer sid to that contained in the ``@asoc sid`` and
264+
``@asoc peer sid`` respectively.
264265
::
265266

266-
@ep - pointer to current sctp endpoint structure.
267+
@asoc - pointer to current sctp association structure.
267268
@sk - pointer to current sock structure.
268-
@sk - pointer to new sock structure.
269+
@newsk - pointer to new sock structure.
269270

270271

271-
security_inet_conn_established()
272+
security_sctp_assoc_established()
272273
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
273274
Called when a COOKIE ACK is received where it sets the connection's peer sid
274275
to that in ``@skb``::
275276

276-
@sk - pointer to sock structure.
277+
@asoc - pointer to sctp association structure.
277278
@skb - pointer to skbuff of the COOKIE ACK packet.
278279

279280

MAINTAINERS

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -872,9 +872,10 @@ F: Documentation/devicetree/bindings/thermal/amazon,al-thermal.txt
872872
F: drivers/thermal/thermal_mmio.c
873873

874874
AMAZON ETHERNET DRIVERS
875-
M: Netanel Belgazal <netanel@amazon.com>
875+
M: Shay Agroskin <shayagr@amazon.com>
876876
M: Arthur Kiyanovski <[email protected]>
877-
R: Guy Tzalik <[email protected]>
877+
R: David Arinzon <[email protected]>
878+
R: Noam Dagan <[email protected]>
878879
R: Saeed Bishara <[email protected]>
879880
880881
S: Supported

arch/riscv/mm/extable.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
#include <linux/module.h>
1212
#include <linux/uaccess.h>
1313

14-
#ifdef CONFIG_BPF_JIT
14+
#if defined(CONFIG_BPF_JIT) && defined(CONFIG_ARCH_RV64I)
1515
int rv_bpf_fixup_exception(const struct exception_table_entry *ex, struct pt_regs *regs);
1616
#endif
1717

@@ -23,7 +23,7 @@ int fixup_exception(struct pt_regs *regs)
2323
if (!fixup)
2424
return 0;
2525

26-
#ifdef CONFIG_BPF_JIT
26+
#if defined(CONFIG_BPF_JIT) && defined(CONFIG_ARCH_RV64I)
2727
if (regs->epc >= BPF_JIT_REGION_START && regs->epc < BPF_JIT_REGION_END)
2828
return rv_bpf_fixup_exception(fixup, regs);
2929
#endif

arch/riscv/net/bpf_jit_comp64.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -459,6 +459,8 @@ static int emit_call(bool fixed, u64 addr, struct rv_jit_context *ctx)
459459
#define BPF_FIXUP_OFFSET_MASK GENMASK(26, 0)
460460
#define BPF_FIXUP_REG_MASK GENMASK(31, 27)
461461

462+
int rv_bpf_fixup_exception(const struct exception_table_entry *ex,
463+
struct pt_regs *regs);
462464
int rv_bpf_fixup_exception(const struct exception_table_entry *ex,
463465
struct pt_regs *regs)
464466
{

drivers/net/Kconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -294,6 +294,7 @@ config GTP
294294
config AMT
295295
tristate "Automatic Multicast Tunneling (AMT)"
296296
depends on INET && IP_MULTICAST
297+
depends on IPV6 || !IPV6
297298
select NET_UDP_TUNNEL
298299
help
299300
This allows one to create AMT(Automatic Multicast Tunneling)

drivers/net/amt.c

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
#include <linux/igmp.h>
1313
#include <linux/workqueue.h>
1414
#include <net/net_namespace.h>
15-
#include <net/protocol.h>
1615
#include <net/ip.h>
1716
#include <net/udp.h>
1817
#include <net/udp_tunnel.h>
@@ -23,7 +22,6 @@
2322
#include <linux/security.h>
2423
#include <net/gro_cells.h>
2524
#include <net/ipv6.h>
26-
#include <net/protocol.h>
2725
#include <net/if_inet6.h>
2826
#include <net/ndisc.h>
2927
#include <net/addrconf.h>
@@ -2767,7 +2765,7 @@ static int amt_err_lookup(struct sock *sk, struct sk_buff *skb)
27672765
rcu_read_lock_bh();
27682766
amt = rcu_dereference_sk_user_data(sk);
27692767
if (!amt)
2770-
goto drop;
2768+
goto out;
27712769

27722770
if (amt->mode != AMT_MODE_GATEWAY)
27732771
goto drop;
@@ -2789,6 +2787,7 @@ static int amt_err_lookup(struct sock *sk, struct sk_buff *skb)
27892787
default:
27902788
goto drop;
27912789
}
2790+
out:
27922791
rcu_read_unlock_bh();
27932792
return 0;
27942793
drop:
@@ -3259,8 +3258,10 @@ static int __init amt_init(void)
32593258
goto unregister_notifier;
32603259

32613260
amt_wq = alloc_workqueue("amt", WQ_UNBOUND, 1);
3262-
if (!amt_wq)
3261+
if (!amt_wq) {
3262+
err = -ENOMEM;
32633263
goto rtnl_unregister;
3264+
}
32643265

32653266
spin_lock_init(&source_gc_lock);
32663267
spin_lock_bh(&source_gc_lock);
@@ -3285,7 +3286,7 @@ static void __exit amt_fini(void)
32853286
{
32863287
rtnl_link_unregister(&amt_link_ops);
32873288
unregister_netdevice_notifier(&amt_notifier_block);
3288-
flush_delayed_work(&source_gc_wq);
3289+
cancel_delayed_work(&source_gc_wq);
32893290
__amt_source_gc_work();
32903291
destroy_workqueue(amt_wq);
32913292
}

drivers/net/bonding/bond_sysfs_slave.c

Lines changed: 11 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -108,15 +108,15 @@ static ssize_t ad_partner_oper_port_state_show(struct slave *slave, char *buf)
108108
}
109109
static SLAVE_ATTR_RO(ad_partner_oper_port_state);
110110

111-
static const struct slave_attribute *slave_attrs[] = {
112-
&slave_attr_state,
113-
&slave_attr_mii_status,
114-
&slave_attr_link_failure_count,
115-
&slave_attr_perm_hwaddr,
116-
&slave_attr_queue_id,
117-
&slave_attr_ad_aggregator_id,
118-
&slave_attr_ad_actor_oper_port_state,
119-
&slave_attr_ad_partner_oper_port_state,
111+
static const struct attribute *slave_attrs[] = {
112+
&slave_attr_state.attr,
113+
&slave_attr_mii_status.attr,
114+
&slave_attr_link_failure_count.attr,
115+
&slave_attr_perm_hwaddr.attr,
116+
&slave_attr_queue_id.attr,
117+
&slave_attr_ad_aggregator_id.attr,
118+
&slave_attr_ad_actor_oper_port_state.attr,
119+
&slave_attr_ad_partner_oper_port_state.attr,
120120
NULL
121121
};
122122

@@ -137,24 +137,10 @@ const struct sysfs_ops slave_sysfs_ops = {
137137

138138
int bond_sysfs_slave_add(struct slave *slave)
139139
{
140-
const struct slave_attribute **a;
141-
int err;
142-
143-
for (a = slave_attrs; *a; ++a) {
144-
err = sysfs_create_file(&slave->kobj, &((*a)->attr));
145-
if (err) {
146-
kobject_put(&slave->kobj);
147-
return err;
148-
}
149-
}
150-
151-
return 0;
140+
return sysfs_create_files(&slave->kobj, slave_attrs);
152141
}
153142

154143
void bond_sysfs_slave_del(struct slave *slave)
155144
{
156-
const struct slave_attribute **a;
157-
158-
for (a = slave_attrs; *a; ++a)
159-
sysfs_remove_file(&slave->kobj, &((*a)->attr));
145+
sysfs_remove_files(&slave->kobj, slave_attrs);
160146
}

drivers/net/can/spi/mcp251xfd/mcp251xfd-core.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1092,7 +1092,7 @@ static int mcp251xfd_chip_start(struct mcp251xfd_priv *priv)
10921092

10931093
err = mcp251xfd_chip_rx_int_enable(priv);
10941094
if (err)
1095-
return err;
1095+
goto out_chip_stop;
10961096

10971097
err = mcp251xfd_chip_ecc_init(priv);
10981098
if (err)
@@ -2290,8 +2290,10 @@ static irqreturn_t mcp251xfd_irq(int irq, void *dev_id)
22902290
* check will fail, too. So leave IRQ handler
22912291
* directly.
22922292
*/
2293-
if (priv->can.state == CAN_STATE_BUS_OFF)
2293+
if (priv->can.state == CAN_STATE_BUS_OFF) {
2294+
can_rx_offload_threaded_irq_finish(&priv->offload);
22942295
return IRQ_HANDLED;
2296+
}
22952297
}
22962298

22972299
handled = IRQ_HANDLED;

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

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -664,7 +664,7 @@ int es58x_rx_err_msg(struct net_device *netdev, enum es58x_err error,
664664
struct can_device_stats *can_stats = &can->can_stats;
665665
struct can_frame *cf = NULL;
666666
struct sk_buff *skb;
667-
int ret;
667+
int ret = 0;
668668

669669
if (!netif_running(netdev)) {
670670
if (net_ratelimit())
@@ -823,8 +823,6 @@ int es58x_rx_err_msg(struct net_device *netdev, enum es58x_err error,
823823
can->state = CAN_STATE_BUS_OFF;
824824
can_bus_off(netdev);
825825
ret = can->do_set_mode(netdev, CAN_MODE_STOP);
826-
if (ret)
827-
return ret;
828826
}
829827
break;
830828

@@ -881,7 +879,7 @@ int es58x_rx_err_msg(struct net_device *netdev, enum es58x_err error,
881879
ES58X_EVENT_BUSOFF, timestamp);
882880
}
883881

884-
return 0;
882+
return ret;
885883
}
886884

887885
/**

0 commit comments

Comments
 (0)