Linux 5.3.18
Greg KH
maintainerI'm announcing the release of the 5.3.18 kernel.
Note, this is the LAST 5.3.y kernel release. It is now end-of-life. Please move to 5.4.y now.
All users of the 5.3 kernel series must upgrade.
The updated 5.3.y git tree can be found at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git linux-5.3.y
and can be browsed at the normal kernel.org git web browser:
https://git.kernel.org/?p=linux/kernel/git/stable/linux-stable.git;a=summary
thanks,
greg k-h
------------
Makefile | 2 drivers/infiniband/core/addr.c | 7 drivers/infiniband/sw/rxe/rxe_net.c | 8 drivers/net/ethernet/cavium/thunder/thunder_bgx.c | 2 drivers/net/ethernet/mellanox/mlx5/core/en.h | 2 drivers/net/ethernet/mellanox/mlx5/core/en/port_buffer.c | 27 +++ drivers/net/ethernet/mellanox/mlx5/core/en/tc_tun.c | 8 drivers/net/ethernet/mellanox/mlx5/core/en_main.c | 31 +-- drivers/net/ethernet/mellanox/mlx5/core/en_stats.c | 2 drivers/net/ethernet/mellanox/mlx5/core/en_tx.c | 2 drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 4 drivers/net/ethernet/ti/cpsw.c | 2 drivers/net/geneve.c | 4 drivers/net/vxlan.c | 8 include/linux/netdevice.h | 5 include/linux/skbuff.h | 5 include/linux/time.h | 13 + include/net/ip.h | 5 include/net/ipv6.h | 2 include/net/ipv6_stubs.h | 6 include/net/page_pool.h | 52 +----- include/net/tcp.h | 27 ++- include/net/xdp_priv.h | 4 include/trace/events/xdp.h | 19 -- net/bridge/br_device.c | 6 net/core/dev.c | 3 net/core/flow_dissector.c | 5 net/core/lwt_bpf.c | 4 net/core/page_pool.c | 122 +++++++++------ net/core/skbuff.c | 10 - net/core/xdp.c | 117 +++++--------- net/dccp/ipv6.c | 6 net/hsr/hsr_device.c | 9 - net/ipv4/devinet.c | 5 net/ipv4/gre_demux.c | 2 net/ipv4/ip_output.c | 13 - net/ipv4/tcp_output.c | 5 net/ipv6/addrconf_core.c | 11 - net/ipv6/af_inet6.c | 4 net/ipv6/datagram.c | 2 net/ipv6/inet6_connection_sock.c | 4 net/ipv6/ip6_output.c | 8 net/ipv6/raw.c | 2 net/ipv6/syncookies.c | 2 net/ipv6/tcp_ipv6.c | 4 net/l2tp/l2tp_ip6.c | 2 net/mpls/af_mpls.c | 7 net/openvswitch/actions.c | 6 net/openvswitch/conntrack.c | 11 + net/sched/act_mpls.c | 7 net/sched/sch_mq.c | 1 net/sched/sch_mqprio.c | 3 net/sctp/ipv6.c | 4 net/tipc/core.c | 29 +-- net/tipc/udp_media.c | 9 - net/tls/tls_device.c | 8 net/tls/tls_main.c | 4 net/tls/tls_sw.c | 8 tools/testing/selftests/net/tls.c | 8 59 files changed, 369 insertions(+), 329 deletions(-)
Aaron Conole (1):
openvswitch: support asymmetric conntrack
Alexander Lobakin (1):
net: dsa: fix flow dissection on Tx path
Cong Wang (1):
gre: refetch erspan header from skb->data after pskb_may_pull()
Dust Li (1):
net: sched: fix dump qlen for sch_mq/sch_mqprio with NOLOCK subqueues
Eran Ben Elisha (1):
net/mlx5e: Fix TXQ indices to be sequential
Eric Dumazet (2):
inet: protect against too small mtu values.
tcp: md5: fix potential overestimation of TCP option space
Greg Kroah-Hartman (1):
Linux 5.3.18
Grygorii Strashko (1):
net: ethernet: ti: cpsw: fix extra rx interrupt
Guillaume Nault (3):
tcp: fix rejected syncookies due to stale timestamps
tcp: tighten acceptance of ACKs not matching a child socket
tcp: Protect accesses to .ts_recent_stamp with {READ,WRITE}_ONCE()
Huy Nguyen (1):
net/mlx5e: Query global pause state before setting prio2buffer
Jonathan Lemon (2):
page_pool: do not release pool until inflight == 0.
xdp: obtain the mem_id mutex before trying to remove an entry.
Martin Varghese (2):
Fixed updating of ethertype in function skb_mpls_pop
net: Fixed updating of ethertype in skb_mpls_push()
Mian Yousaf Kaukab (1):
net: thunderx: start phy before starting autonegotiation
Nikolay Aleksandrov (1):
net: bridge: deny dev_set_mac_address() when unregistering
Sabrina Dubroca (2):
net: ipv6: add net argument to ip6_dst_lookup_flow
net: ipv6_stub: use ip6_dst_lookup_flow instead of ip6_dst_lookup
Taehee Yoo (2):
tipc: fix ordering of tipc module init and exit routine
hsr: fix a NULL pointer dereference in hsr_dev_xmit()
Valentin Vidic (1):
net/tls: Fix return values to avoid ENOTSUPP
Vladyslav Tarasiuk (1):
mqprio: Fix out-of-bounds access in mqprio_dump
Greg KH
maintainerMakefile +1 -1
@@ -1,7 +1,7 @@ # SPDX-License-Identifier: GPL-2.0 VERSION = 5 PATCHLEVEL = 3 -SUBLEVEL = 17 +SUBLEVEL = 18 EXTRAVERSION = NAME = Bobtail Squid
drivers/infiniband/core/addr.c +3 -4
@@ -421,16 +421,15 @@ static int addr6_resolve(struct sockaddr *src_sock, (const struct sockaddr_in6 *)dst_sock;struct flowi6 fl6;struct dst_entry *dst; -int ret;memset (&fl6,0 ,sizeof fl6); fl6.daddr = dst_in->sin6_addr; fl6.saddr = src_in->sin6_addr; fl6.flowi6_oif = addr->bound_dev_if; - ret = ipv6_stub->ipv6_dst_lookup (addr->net,NULL , &dst, &fl6); -if (ret <0 ) -return ret; + dst = ipv6_stub->ipv6_dst_lookup_flow (addr->net,NULL , &fl6,NULL ); +if (IS_ERR (dst)) +return PTR_ERR (dst);if (ipv6_addr_any (&src_in->sin6_addr)) src_in->sin6_addr = fl6.saddr;
drivers/infiniband/sw/rxe/rxe_net.c +5 -3
@@ -117,10 +117,12 @@ static struct dst_entry *rxe_find_route6(struct net_device *ndev,memcpy (&fl6.daddr, daddr,sizeof (*daddr)); fl6.flowi6_proto =IPPROTO_UDP ; -if (unlikely (ipv6_stub->ipv6_dst_lookup (sock_net (recv_sockets.sk6->sk), - recv_sockets.sk6->sk, &ndst, &fl6))) { + ndst = ipv6_stub->ipv6_dst_lookup_flow (sock_net (recv_sockets.sk6->sk), + recv_sockets.sk6->sk, &fl6, +NULL ); +if (unlikely (IS_ERR (ndst))) {pr_err_ratelimited ("no route to %pI6\n" , daddr); - goto put; +return NULL ; }if (unlikely (ndst->error)) {
drivers/net/ethernet/cavium/thunder/thunder_bgx.c +1 -1
@@ -1115,7 +1115,7 @@ static int bgx_lmac_enable(struct bgx *bgx, u8 lmacid) phy_interface_mode(lmac->lmac_type)))return -ENODEV ; -phy_start_aneg (lmac->phydev); +phy_start (lmac->phydev);return 0 ; }
drivers/net/ethernet/mellanox/mlx5/core/en.h +1 -1
@@ -792,7 +792,7 @@ struct mlx5e_xsk {struct mlx5e_priv {/* priv data path fields - start */ struct mlx5e_txqsq *txq2sq[MLX5E_MAX_NUM_CHANNELS *MLX5E_MAX_NUM_TC ]; -int channel_tc2txq[MLX5E_MAX_NUM_CHANNELS ][MLX5E_MAX_NUM_TC ]; +int channel_tc2realtxq[MLX5E_MAX_NUM_CHANNELS ][MLX5E_MAX_NUM_TC ];#ifdef CONFIG_MLX5_CORE_EN_DCB struct mlx5e_dcbx_dp dcbx_dp;#endif
drivers/net/ethernet/mellanox/mlx5/core/en/port_buffer.c +25 -2
@@ -155,8 +155,11 @@ static int update_xoff_threshold(struct mlx5e_port_buffer *port_buffer, }if (port_buffer->buffer[i].size < - (xoff + max_mtu + (1 <<MLX5E_BUFFER_CELL_SHIFT ))) + (xoff + max_mtu + (1 <<MLX5E_BUFFER_CELL_SHIFT ))) { +pr_err ("buffer_size[%d]=%d is not enough for lossless buffer\n" , + i, port_buffer->buffer[i].size);return -ENOMEM ; + } port_buffer->buffer[i].xoff = port_buffer->buffer[i].size - xoff; port_buffer->buffer[i].xon =
@@ -232,6 +235,26 @@ static int update_buffer_lossy(unsigned int max_mtu,return 0 ; } +static int fill_pfc_en (struct mlx5_core_dev *mdev,u8 *pfc_en) +{ +u32 g_rx_pause, g_tx_pause; +int err; + + err =mlx5_query_port_pause (mdev, &g_rx_pause, &g_tx_pause); +if (err) +return err; + +/* If global pause enabled, set all active buffers to lossless. +* Otherwise, check PFC setting. +*/ +if (g_rx_pause || g_tx_pause) + *pfc_en =0xff ; +else + err =mlx5_query_port_pfc (mdev, pfc_en,NULL ); + +return err; +} +#define MINIMUM_MAX_MTU 9216 int mlx5e_port_manual_buffer_config(struct mlx5e_priv *priv, u32 change, unsigned int mtu,
@@ -277,7 +300,7 @@ int mlx5e_port_manual_buffer_config(struct mlx5e_priv *priv,if (change &MLX5E_PORT_BUFFER_PRIO2BUFFER ) { update_prio2buffer = true; - err =mlx5_query_port_pfc (priv->mdev, &curr_pfc_en,NULL ); + err =fill_pfc_en (priv->mdev, &curr_pfc_en);if (err)return err;
drivers/net/ethernet/mellanox/mlx5/core/en/tc_tun.c +4 -4
@@ -137,10 +137,10 @@ static int mlx5e_route_lookup_ipv6(struct mlx5e_priv *priv,#if IS_ENABLED (CONFIG_INET ) &&IS_ENABLED (CONFIG_IPV6 )int ret; - ret = ipv6_stub->ipv6_dst_lookup (dev_net (mirred_dev),NULL , &dst, - fl6); -if (ret <0 ) -return ret; + dst = ipv6_stub->ipv6_dst_lookup_flow (dev_net (mirred_dev),NULL , fl6, +NULL ); +if (IS_ERR (dst)) +return PTR_ERR (dst);if (!(*out_ttl)) *out_ttl =ip6_dst_hoplimit (dst);
drivers/net/ethernet/mellanox/mlx5/core/en_main.c +12 -19
@@ -1678,11 +1678,10 @@ static int mlx5e_open_sqs(struct mlx5e_channel *c,struct mlx5e_params *params, struct mlx5e_channel_param *cparam) { - struct mlx5e_priv *priv = c->priv; int err, tc;for (tc =0 ; tc < params->num_tc; tc++) { -int txq_ix = c->ix + tc * priv->max_nch; +int txq_ix = c->ix + tc * params->num_channels; err =mlx5e_open_txqsq (c, c->priv->tisn[tc], txq_ix, params, &cparam->sq, &c->sq[tc], tc);
@@ -2856,26 +2855,21 @@ static void mlx5e_netdev_set_tcs(struct net_device *netdev)netdev_set_tc_queue (netdev, tc, nch,0 ); } -static void mlx5e_build_tc2txq_maps (struct mlx5e_priv *priv) +static void mlx5e_build_txq_maps (struct mlx5e_priv *priv) { -int i, tc; +int i, ch; -for (i =0 ; i < priv->max_nch; i++) -for (tc =0 ; tc < priv->profile->max_tc; tc++) - priv->channel_tc2txq[i][tc] = i + tc * priv->max_nch; -} + ch = priv->channels.num; -static void mlx5e_build_tx2sq_maps (struct mlx5e_priv *priv) -{ -struct mlx5e_channel *c; -struct mlx5e_txqsq *sq; -int i, tc; +for (i =0 ; i < ch; i++) { +int tc; + +for (tc =0 ; tc < priv->channels.params.num_tc; tc++) { +struct mlx5e_channel *c = priv->channels.c[i]; +struct mlx5e_txqsq *sq = &c->sq[tc]; -for (i =0 ; i < priv->channels.num; i++) { - c = priv->channels.c[i]; -for (tc =0 ; tc < c->num_tc; tc++) { - sq = &c->sq[tc]; priv->txq2sq[sq->txq_ix] = sq; + priv->channel_tc2realtxq[i][tc] = i + tc * ch; } } }
@@ -2890,7 +2884,7 @@ void mlx5e_activate_priv_channels(struct mlx5e_priv *priv)netif_set_real_num_tx_queues (netdev, num_txqs);netif_set_real_num_rx_queues (netdev, num_rxqs); -mlx5e_build_tx2sq_maps (priv); +mlx5e_build_txq_maps (priv);mlx5e_activate_channels (&priv->channels);mlx5e_xdp_tx_enable (priv);netif_tx_start_all_queues (priv->netdev);
@@ -4968,7 +4962,6 @@ static int mlx5e_nic_init(struct mlx5_core_dev *mdev,if (err)mlx5_core_err (mdev,"TLS initialization failed, %d\n" , err);mlx5e_build_nic_netdev (netdev); -mlx5e_build_tc2txq_maps (priv);return 0 ; }
drivers/net/ethernet/mellanox/mlx5/core/en_stats.c +1 -1
@@ -1435,7 +1435,7 @@ static int mlx5e_grp_channels_fill_strings(struct mlx5e_priv *priv, u8 *data,for (j =0 ; j <NUM_SQ_STATS ; j++)sprintf (data + (idx++) *ETH_GSTRING_LEN , sq_stats_desc[j].format, - priv->channel_tc2txq[i][tc]); + i + tc * max_nch);for (i =0 ; i < max_nch; i++) {for (j =0 ; j <NUM_XSKSQ_STATS * is_xsk; j++)
drivers/net/ethernet/mellanox/mlx5/core/en_tx.c +1 -1
@@ -93,7 +93,7 @@ u16 mlx5e_select_queue(struct net_device *dev, struct sk_buff *skb,if (txq_ix >= num_channels) txq_ix = priv->txq2sq[txq_ix]->ch_ix; -return priv->channel_tc2txq[txq_ix][up]; +return priv->channel_tc2realtxq[txq_ix][up]; }static inline int mlx5e_skb_l2_header_offset (struct sk_buff *skb)
drivers/net/ethernet/stmicro/stmmac/stmmac_main.c +1 -3
@@ -1477,10 +1477,8 @@ static void free_dma_rx_desc_resources(struct stmmac_priv *priv) rx_q->dma_erx, rx_q->dma_rx_phy);kfree (rx_q->buf_pool); -if (rx_q->page_pool) { -page_pool_request_shutdown (rx_q->page_pool); +if (rx_q->page_pool)page_pool_destroy (rx_q->page_pool); - } } }
drivers/net/ethernet/ti/cpsw.c +1 -1
@@ -890,8 +890,8 @@ static irqreturn_t cpsw_rx_interrupt(int irq, void *dev_id) {struct cpsw_common *cpsw = dev_id; -cpdma_ctlr_eoi (cpsw->dma,CPDMA_EOI_RX );writel (0 , &cpsw->wr_regs->rx_en); +cpdma_ctlr_eoi (cpsw->dma,CPDMA_EOI_RX );if (cpsw->quirk_irq) {disable_irq_nosync (cpsw->irqs_table[0 ]);
drivers/net/geneve.c +3 -1
@@ -853,7 +853,9 @@ static struct dst_entry *geneve_get_v6_dst(struct sk_buff *skb,if (dst)return dst; } -if (ipv6_stub->ipv6_dst_lookup (geneve->net, gs6->sock->sk, &dst, fl6)) { + dst = ipv6_stub->ipv6_dst_lookup_flow (geneve->net, gs6->sock->sk, fl6, +NULL ); +if (IS_ERR (dst)) {netdev_dbg (dev,"no route to %pI6\n" , &fl6->daddr);return ERR_PTR (-ENETUNREACH ); }
drivers/net/vxlan.c +3 -5
@@ -2276,7 +2276,6 @@ static struct dst_entry *vxlan6_get_route(struct vxlan_dev *vxlan,bool use_cache =ip_tunnel_dst_cache_usable (skb, info);struct dst_entry *ndst;struct flowi6 fl6; -int err;if (!sock6)return ERR_PTR (-EIO );
@@ -2299,10 +2298,9 @@ static struct dst_entry *vxlan6_get_route(struct vxlan_dev *vxlan, fl6.fl6_dport = dport; fl6.fl6_sport = sport; - err = ipv6_stub->ipv6_dst_lookup (vxlan->net, - sock6->sock->sk, - &ndst, &fl6); -if (unlikely (err <0 )) { + ndst = ipv6_stub->ipv6_dst_lookup_flow (vxlan->net, sock6->sock->sk, + &fl6,NULL ); +if (unlikely (IS_ERR (ndst))) {netdev_dbg (dev,"no route to %pI6\n" , daddr);return ERR_PTR (-ENETUNREACH ); }
include/linux/netdevice.h +5 -0
@@ -1848,6 +1848,11 @@ struct net_device {unsigned char if_port;unsigned char dma; +/* Note : dev->mtu is often read without holding a lock. +* Writers usually hold RTNL. +* It is recommended to use READ_ONCE() to annotate the reads, +* and to use WRITE_ONCE() to annotate the writes. +*/ unsigned int mtu;unsigned int min_mtu;unsigned int max_mtu;
include/linux/skbuff.h +3 -2
@@ -3482,8 +3482,9 @@ int __skb_vlan_pop(struct sk_buff *skb, u16 *vlan_tci);int skb_vlan_pop (struct sk_buff *skb);int skb_vlan_push (struct sk_buff *skb,__be16 vlan_proto,u16 vlan_tci);int skb_mpls_push (struct sk_buff *skb,__be32 mpls_lse,__be16 mpls_proto, -int mac_len); -int skb_mpls_pop (struct sk_buff *skb,__be16 next_proto,int mac_len); +int mac_len,bool ethernet); +int skb_mpls_pop (struct sk_buff *skb,__be16 next_proto,int mac_len, +bool ethernet);int skb_mpls_update_lse (struct sk_buff *skb,__be32 mpls_lse);int skb_mpls_dec_ttl (struct sk_buff *skb); struct sk_buff *pskb_extract(struct sk_buff *skb, int off, int to_copy,
include/linux/time.h +13 -0
@@ -96,4 +96,17 @@ static inline bool itimerspec64_valid(const struct itimerspec64 *its)*/ #define time_after32 (a, b) ((s32)((u32)(b) - (u32)(a)) < 0)#define time_before32 (b, a) time_after32(a, b) + +/** +* time_between32 - check if a 32-bit timestamp is within a given time range +* @t: the time which may be within [l,h] +* @l: the lower bound of the range +* @h: the higher bound of the range +* +* time_before32(t, l, h) returns true if @l <= @t <= @h. All operands are +* treated as 32-bit integers. +* +* Equivalent to !(time_before32(@t, @l) || time_after32(@t, @h)). +*/ +#define time_between32 (t, l, h) ((u32)(h) - (u32)(l) >= (u32)(t) - (u32)(l))#endif
include/net/ip.h +5 -0
@@ -759,4 +759,9 @@ int ip_misc_proc_init(void);int rtm_getroute_parse_ip_proto (struct nlattr *attr,u8 *ip_proto,u8 family,struct netlink_ext_ack *extack); +static inline bool inetdev_valid_mtu (unsigned int mtu) +{ +return likely (mtu >=IPV4_MIN_MTU ); +} +#endif /* _IP_H */
include/net/ipv6.h +1 -1
@@ -1017,7 +1017,7 @@ static inline struct sk_buff *ip6_finish_skb(struct sock *sk)int ip6_dst_lookup (struct net *net,struct sock *sk,struct dst_entry **dst,struct flowi6 *fl6); -struct dst_entry *ip6_dst_lookup_flow (const struct sock *sk,struct flowi6 *fl6, +struct dst_entry *ip6_dst_lookup_flow (struct net *net,const struct sock *sk,struct flowi6 *fl6,const struct in6_addr *final_dst); struct dst_entry *ip6_sk_dst_lookup_flow(struct sock *sk, struct flowi6 *fl6, const struct in6_addr *final_dst,
include/net/ipv6_stubs.h +4 -2
@@ -24,8 +24,10 @@ struct ipv6_stub { const struct in6_addr *addr);int (*ipv6_sock_mc_drop)(struct sock *sk,int ifindex,const struct in6_addr *addr); -int (*ipv6_dst_lookup)(struct net *net,struct sock *sk, -struct dst_entry **dst,struct flowi6 *fl6); +struct dst_entry *(*ipv6_dst_lookup_flow)(struct net *net, +const struct sock *sk, +struct flowi6 *fl6, +const struct in6_addr *final_dst);int (*ipv6_route_input)(struct sk_buff *skb);struct fib6_table *(*fib6_get_table)(struct net *net,u32 id);
include/net/page_pool.h +14 -38
81 lines not on this page · raw message
include/net/tcp.h +19 -8
@@ -484,15 +484,16 @@ static inline void tcp_synq_overflow(const struct sock *sk) reuse =rcu_dereference (sk->sk_reuseport_cb);if (likely (reuse)) { last_overflow =READ_ONCE (reuse->synq_overflow_ts); -if (time_after32 (now, last_overflow +HZ )) +if (!time_between32 (now, last_overflow, + last_overflow +HZ ))WRITE_ONCE (reuse->synq_overflow_ts, now);return ; } } - last_overflow =tcp_sk (sk)->rx_opt.ts_recent_stamp; -if (time_after32 (now, last_overflow +HZ )) -tcp_sk (sk)->rx_opt.ts_recent_stamp = now; + last_overflow =READ_ONCE (tcp_sk (sk)->rx_opt.ts_recent_stamp); +if (!time_between32 (now, last_overflow, last_overflow +HZ )) +WRITE_ONCE (tcp_sk (sk)->rx_opt.ts_recent_stamp, now); }/* syncookies: no recent synqueue overflow on this listening socket? */
@@ -507,13 +508,23 @@ static inline bool tcp_synq_no_recent_overflow(const struct sock *sk) reuse =rcu_dereference (sk->sk_reuseport_cb);if (likely (reuse)) { last_overflow =READ_ONCE (reuse->synq_overflow_ts); -return time_after32 (now, last_overflow + -TCP_SYNCOOKIE_VALID ); +return !time_between32 (now, last_overflow -HZ , + last_overflow + +TCP_SYNCOOKIE_VALID ); } } - last_overflow =tcp_sk (sk)->rx_opt.ts_recent_stamp; -return time_after32 (now, last_overflow +TCP_SYNCOOKIE_VALID ); + last_overflow =READ_ONCE (tcp_sk (sk)->rx_opt.ts_recent_stamp); + +/* If last_overflow <= jiffies <= last_overflow + TCP_SYNCOOKIE_VALID, +* then we're under synflood. However, we have to use +* 'last_overflow - HZ' as lower bound. That's because a concurrent +* tcp_synq_overflow() could update .ts_recent_stamp after we read +* jiffies but before we store .ts_recent_stamp into last_overflow, +* which could lead to rejecting a valid syncookie. +*/ +return !time_between32 (now, last_overflow -HZ , + last_overflow +TCP_SYNCOOKIE_VALID ); }static inline u32 tcp_cookie_time (void )
include/net/xdp_priv.h +0 -4
@@ -12,12 +12,8 @@ struct xdp_mem_allocator {struct page_pool *page_pool; struct zero_copy_allocator *zc_alloc; }; -int disconnect_cnt; -unsigned long defer_start;struct rhash_head node;struct rcu_head rcu; -struct delayed_work defer_wq; -unsigned long defer_warn; };#endif /* __LINUX_NET_XDP_PRIV_H__ */
include/trace/events/xdp.h +4 -15
@@ -316,19 +316,15 @@ __MEM_TYPE_MAP(__MEM_TYPE_TP_FN) TRACE_EVENT(mem_disconnect, - TP_PROTO(const struct xdp_mem_allocator *xa, - bool safe_to_remove, bool force), + TP_PROTO(const struct xdp_mem_allocator *xa), - TP_ARGS(xa, safe_to_remove, force), + TP_ARGS(xa), TP_STRUCT__entry( __field(const struct xdp_mem_allocator *, xa) __field(u32, mem_id) __field(u32, mem_type) __field(const void *, allocator) - __field(bool, safe_to_remove) - __field(bool, force) - __field(int, disconnect_cnt) ), TP_fast_assign(
@@ -336,19 +332,12 @@ TRACE_EVENT(mem_disconnect, __entry->mem_id = xa->mem.id; __entry->mem_type = xa->mem.type; __entry->allocator = xa->allocator; - __entry->safe_to_remove = safe_to_remove; - __entry->force = force; - __entry->disconnect_cnt = xa->disconnect_cnt; ), -TP_printk ("mem_id=%d mem_type=%s allocator=%p" -" safe_to_remove=%s force=%s disconnect_cnt=%d" , +TP_printk ("mem_id=%d mem_type=%s allocator=%p" , __entry->mem_id,__print_symbolic (__entry->mem_type, __MEM_TYPE_SYM_TAB), - __entry->allocator, - __entry->safe_to_remove ?"true" :"false" , - __entry->force ?"true" :"false" , - __entry->disconnect_cnt + __entry->allocator ) );
net/bridge/br_device.c +6 -0
@@ -253,6 +253,12 @@ static int br_set_mac_address(struct net_device *dev, void *p)if (!is_valid_ether_addr (addr->sa_data))return -EADDRNOTAVAIL ; +/* dev_set_mac_addr() can be called by a master device on bridge's +* NETDEV_UNREGISTER, but since it's being destroyed do nothing +*/ +if (dev->reg_state !=NETREG_REGISTERED ) +return -EBUSY ; +spin_lock_bh (&br->lock);if (!ether_addr_equal (dev->dev_addr, addr->sa_data)) {/* Mac address will be changed in br_stp_change_bridge_id(). */
net/core/dev.c +2 -1
@@ -7662,7 +7662,8 @@ int __dev_set_mtu(struct net_device *dev, int new_mtu)if (ops->ndo_change_mtu)return ops->ndo_change_mtu (dev, new_mtu); - dev->mtu = new_mtu; +/* Pairs with all the lockless reads of dev->mtu in the stack */ +WRITE_ONCE (dev->mtu, new_mtu);return 0 ; }EXPORT_SYMBOL (__dev_set_mtu);
net/core/flow_dissector.c +3 -2
@@ -853,9 +853,10 @@ bool __skb_flow_dissect(const struct net *net, nhoff =skb_network_offset (skb); hlen =skb_headlen (skb);#if IS_ENABLED (CONFIG_NET_DSA ) -if (unlikely (skb->dev &&netdev_uses_dsa (skb->dev))) { +if (unlikely (skb->dev &&netdev_uses_dsa (skb->dev) && + proto ==htons (ETH_P_XDSA ))) {const struct dsa_device_ops *ops; -int offset; +int offset =0 ; ops = skb->dev->dsa_ptr->tag_ops; if (ops->flow_dissect &&
net/core/lwt_bpf.c +1 -3
@@ -230,9 +230,7 @@ static int bpf_lwt_xmit_reroute(struct sk_buff *skb) fl6.daddr = iph6->daddr; fl6.saddr = iph6->saddr; - err = ipv6_stub->ipv6_dst_lookup (net, skb->sk, &dst, &fl6); -if (unlikely (err)) - goto err; + dst = ipv6_stub->ipv6_dst_lookup_flow (net, skb->sk, &fl6,NULL );if (IS_ERR (dst)) { err =PTR_ERR (dst); goto err;
net/core/page_pool.c +76 -46
169 lines not on this page · raw message
net/core/skbuff.c +6 -4
@@ -5472,7 +5472,7 @@ static void skb_mod_eth_type(struct sk_buff *skb, struct ethhdr *hdr,* Returns 0 on success, -errno otherwise. */ int skb_mpls_push (struct sk_buff *skb,__be32 mpls_lse,__be16 mpls_proto, -int mac_len) +int mac_len,bool ethernet) {struct mpls_shim_hdr *lse;int err;
@@ -5503,7 +5503,7 @@ int skb_mpls_push(struct sk_buff *skb, __be32 mpls_lse, __be16 mpls_proto, lse->label_stack_entry = mpls_lse;skb_postpush_rcsum (skb, lse,MPLS_HLEN ); -if (skb->dev && skb->dev->type ==ARPHRD_ETHER ) +if (ethernet)skb_mod_eth_type (skb,eth_hdr (skb), mpls_proto); skb->protocol = mpls_proto;
@@ -5517,12 +5517,14 @@ EXPORT_SYMBOL_GPL(skb_mpls_push);* @skb: buffer * @next_proto: ethertype of header after popped MPLS header * @mac_len: length of the MAC header +* @ethernet: flag to indicate if ethernet header is present in packet * * Expects skb->data at mac header. * * Returns 0 on success, -errno otherwise. */ -int skb_mpls_pop (struct sk_buff *skb,__be16 next_proto,int mac_len) +int skb_mpls_pop (struct sk_buff *skb,__be16 next_proto,int mac_len, +bool ethernet) {int err;
@@ -5541,7 +5543,7 @@ int skb_mpls_pop(struct sk_buff *skb, __be16 next_proto, int mac_len)skb_reset_mac_header (skb);skb_set_network_header (skb, mac_len); -if (skb->dev && skb->dev->type ==ARPHRD_ETHER ) { +if (ethernet) {struct ethhdr *hdr;/* use mpls_hdr() to get ethertype to account for VLANs. */
net/core/xdp.c +42 -75
174 lines not on this page · raw message
net/dccp/ipv6.c +3 -3
@@ -210,7 +210,7 @@ static int dccp_v6_send_response(const struct sock *sk, struct request_sock *req final_p =fl6_update_dst (&fl6,rcu_dereference (np->opt), &final);rcu_read_unlock (); - dst =ip6_dst_lookup_flow (sk, &fl6, final_p); + dst =ip6_dst_lookup_flow (sock_net (sk), sk, &fl6, final_p);if (IS_ERR (dst)) { err =PTR_ERR (dst); dst =NULL ;
@@ -281,7 +281,7 @@ static void dccp_v6_ctl_send_reset(const struct sock *sk, struct sk_buff *rxskb)security_skb_classify_flow (rxskb,flowi6_to_flowi (&fl6));/* sk = NULL, but it is safe for now. RST socket required. */ - dst =ip6_dst_lookup_flow (ctl_sk, &fl6,NULL ); + dst =ip6_dst_lookup_flow (sock_net (ctl_sk), ctl_sk, &fl6,NULL );if (!IS_ERR (dst)) {skb_dst_set (skb, dst);ip6_xmit (ctl_sk, skb, &fl6,0 ,NULL ,0 );
@@ -911,7 +911,7 @@ static int dccp_v6_connect(struct sock *sk, struct sockaddr *uaddr, opt =rcu_dereference_protected (np->opt,lockdep_sock_is_held (sk)); final_p =fl6_update_dst (&fl6, opt, &final); - dst =ip6_dst_lookup_flow (sk, &fl6, final_p); + dst =ip6_dst_lookup_flow (sock_net (sk), sk, &fl6, final_p);if (IS_ERR (dst)) { err =PTR_ERR (dst); goto failure;
net/hsr/hsr_device.c +7 -2
@@ -227,8 +227,13 @@ static int hsr_dev_xmit(struct sk_buff *skb, struct net_device *dev)struct hsr_port *master; master =hsr_port_get_hsr (hsr,HSR_PT_MASTER ); - skb->dev = master->dev; -hsr_forward_skb (skb, master); +if (master) { + skb->dev = master->dev; +hsr_forward_skb (skb, master); + }else { +atomic_long_inc (&dev->tx_dropped); +dev_kfree_skb_any (skb); + }return NETDEV_TX_OK ; }
net/ipv4/devinet.c +0 -5
@@ -1496,11 +1496,6 @@ static void inetdev_changename(struct net_device *dev, struct in_device *in_dev) } } -static bool inetdev_valid_mtu (unsigned int mtu) -{ -return mtu >=IPV4_MIN_MTU ; -} -static void inetdev_send_gratuitous_arp (struct net_device *dev,struct in_device *in_dev)
net/ipv4/gre_demux.c +1 -1
@@ -127,7 +127,7 @@ int gre_parse_header(struct sk_buff *skb, struct tnl_ptk_info *tpi,if (!pskb_may_pull (skb, nhs + hdr_len +sizeof (*ershdr)))return -EINVAL ; - ershdr = (struct erspan_base_hdr *)options; + ershdr = (struct erspan_base_hdr *)(skb->data + nhs + hdr_len); tpi->key =cpu_to_be32 (get_session_id (ershdr)); }
net/ipv4/ip_output.c +8 -5
@@ -1258,15 +1258,18 @@ static int ip_setup_cork(struct sock *sk, struct inet_cork *cork, cork->addr = ipc->addr; } -/* -* We steal reference to this route, caller should not release it -*/ - *rtp =NULL ; cork->fragsize =ip_sk_use_pmtu (sk) ? -dst_mtu (&rt->dst) : rt->dst.dev->mtu; +dst_mtu (&rt->dst) :READ_ONCE (rt->dst.dev->mtu); + +if (!inetdev_valid_mtu (cork->fragsize)) +return -ENETUNREACH ; cork->gso_size = ipc->gso_size; + cork->dst = &rt->dst; +/* We stole this route, caller should not release it. */ + *rtp =NULL ; + cork->length =0 ; cork->ttl = ipc->ttl; cork->tos = ipc->tos;
net/ipv4/tcp_output.c +3 -2
@@ -755,8 +755,9 @@ static unsigned int tcp_established_options(struct sock *sk, struct sk_buff *skb min_t(unsigned int, eff_sacks, (remaining -TCPOLEN_SACK_BASE_ALIGNED ) / TCPOLEN_SACK_PERBLOCK); - size +=TCPOLEN_SACK_BASE_ALIGNED + - opts->num_sack_blocks *TCPOLEN_SACK_PERBLOCK ; +if (likely (opts->num_sack_blocks)) + size +=TCPOLEN_SACK_BASE_ALIGNED + + opts->num_sack_blocks *TCPOLEN_SACK_PERBLOCK ; }return size;
net/ipv6/addrconf_core.c +6 -5
@@ -128,11 +128,12 @@ int inet6addr_validator_notifier_call_chain(unsigned long val, void *v) }EXPORT_SYMBOL (inet6addr_validator_notifier_call_chain); -static int eafnosupport_ipv6_dst_lookup (struct net *net,struct sock *u1, -struct dst_entry **u2, -struct flowi6 *u3) +static struct dst_entry *eafnosupport_ipv6_dst_lookup_flow (struct net *net, +const struct sock *sk, +struct flowi6 *fl6, +const struct in6_addr *final_dst) { -return -EAFNOSUPPORT ; +return ERR_PTR (-EAFNOSUPPORT ); }static int eafnosupport_ipv6_route_input (struct sk_buff *skb)
@@ -189,7 +190,7 @@ static int eafnosupport_ip6_del_rt(struct net *net, struct fib6_info *rt) }const struct ipv6_stub *ipv6_stub__read_mostly = &(struct ipv6_stub ) { - .ipv6_dst_lookup = eafnosupport_ipv6_dst_lookup, + .ipv6_dst_lookup_flow = eafnosupport_ipv6_dst_lookup_flow, .ipv6_route_input = eafnosupport_ipv6_route_input, .fib6_get_table = eafnosupport_fib6_get_table, .fib6_table_lookup = eafnosupport_fib6_table_lookup,
net/ipv6/af_inet6.c +2 -2
@@ -765,7 +765,7 @@ int inet6_sk_rebuild_header(struct sock *sk) &final);rcu_read_unlock (); - dst =ip6_dst_lookup_flow (sk, &fl6, final_p); + dst =ip6_dst_lookup_flow (sock_net (sk), sk, &fl6, final_p);if (IS_ERR (dst)) { sk->sk_route_caps =0 ; sk->sk_err_soft = -PTR_ERR (dst);
@@ -946,7 +946,7 @@ static int ipv6_route_input(struct sk_buff *skb)static const struct ipv6_stub ipv6_stub_impl = { .ipv6_sock_mc_join = ipv6_sock_mc_join, .ipv6_sock_mc_drop = ipv6_sock_mc_drop, - .ipv6_dst_lookup = ip6_dst_lookup, + .ipv6_dst_lookup_flow = ip6_dst_lookup_flow, .ipv6_route_input = ipv6_route_input, .fib6_get_table = fib6_get_table, .fib6_table_lookup = fib6_table_lookup,
net/ipv6/datagram.c +1 -1
@@ -85,7 +85,7 @@ int ip6_datagram_dst_update(struct sock *sk, bool fix_sk_saddr) final_p =fl6_update_dst (&fl6, opt, &final);rcu_read_unlock (); - dst =ip6_dst_lookup_flow (sk, &fl6, final_p); + dst =ip6_dst_lookup_flow (sock_net (sk), sk, &fl6, final_p);if (IS_ERR (dst)) { err =PTR_ERR (dst); goto out;
net/ipv6/inet6_connection_sock.c +2 -2
@@ -48,7 +48,7 @@ struct dst_entry *inet6_csk_route_req(const struct sock *sk, fl6->flowi6_uid = sk->sk_uid;security_req_classify_flow (req,flowi6_to_flowi (fl6)); - dst =ip6_dst_lookup_flow (sk, fl6, final_p); + dst =ip6_dst_lookup_flow (sock_net (sk), sk, fl6, final_p);if (IS_ERR (dst))return NULL ;
@@ -103,7 +103,7 @@ static struct dst_entry *inet6_csk_route_socket(struct sock *sk, dst =__inet6_csk_dst_check (sk, np->dst_cookie);if (!dst) { - dst =ip6_dst_lookup_flow (sk, fl6, final_p); + dst =ip6_dst_lookup_flow (sock_net (sk), sk, fl6, final_p);if (!IS_ERR (dst))ip6_dst_store (sk, dst,NULL ,NULL );
net/ipv6/ip6_output.c +4 -4
@@ -1144,19 +1144,19 @@ EXPORT_SYMBOL_GPL(ip6_dst_lookup);* It returns a valid dst pointer on success, or a pointer encoded * error code. */ -struct dst_entry *ip6_dst_lookup_flow (const struct sock *sk,struct flowi6 *fl6, +struct dst_entry *ip6_dst_lookup_flow (struct net *net,const struct sock *sk,struct flowi6 *fl6,const struct in6_addr *final_dst) {struct dst_entry *dst =NULL ;int err; - err =ip6_dst_lookup_tail (sock_net (sk), sk, &dst, fl6); + err =ip6_dst_lookup_tail (net, sk, &dst, fl6);if (err)return ERR_PTR (err);if (final_dst) fl6->daddr = *final_dst; -return xfrm_lookup_route (sock_net (sk), dst,flowi6_to_flowi (fl6), sk,0 ); +return xfrm_lookup_route (net, dst,flowi6_to_flowi (fl6), sk,0 ); }EXPORT_SYMBOL_GPL (ip6_dst_lookup_flow);
@@ -1188,7 +1188,7 @@ struct dst_entry *ip6_sk_dst_lookup_flow(struct sock *sk, struct flowi6 *fl6,if (dst)return dst; - dst =ip6_dst_lookup_flow (sk, fl6, final_dst); + dst =ip6_dst_lookup_flow (sock_net (sk), sk, fl6, final_dst);if (connected && !IS_ERR (dst))ip6_sk_dst_store_flow (sk,dst_clone (dst), fl6);
net/ipv6/raw.c +1 -1
@@ -923,7 +923,7 @@ static int rawv6_sendmsg(struct sock *sk, struct msghdr *msg, size_t len) fl6.flowlabel =ip6_make_flowinfo (ipc6.tclass, fl6.flowlabel); - dst =ip6_dst_lookup_flow (sk, &fl6, final_p); + dst =ip6_dst_lookup_flow (sock_net (sk), sk, &fl6, final_p);if (IS_ERR (dst)) { err =PTR_ERR (dst); goto out;
net/ipv6/syncookies.c +1 -1
@@ -235,7 +235,7 @@ struct sock *cookie_v6_check(struct sock *sk, struct sk_buff *skb) fl6.flowi6_uid = sk->sk_uid;security_req_classify_flow (req,flowi6_to_flowi (&fl6)); - dst =ip6_dst_lookup_flow (sk, &fl6, final_p); + dst =ip6_dst_lookup_flow (sock_net (sk), sk, &fl6, final_p);if (IS_ERR (dst)) goto out_free; }
net/ipv6/tcp_ipv6.c +2 -2
@@ -275,7 +275,7 @@ static int tcp_v6_connect(struct sock *sk, struct sockaddr *uaddr,security_sk_classify_flow (sk,flowi6_to_flowi (&fl6)); - dst =ip6_dst_lookup_flow (sk, &fl6, final_p); + dst =ip6_dst_lookup_flow (sock_net (sk), sk, &fl6, final_p);if (IS_ERR (dst)) { err =PTR_ERR (dst); goto failure;
@@ -904,7 +904,7 @@ static void tcp_v6_send_response(const struct sock *sk, struct sk_buff *skb, u32* Underlying function will use this to retrieve the network * namespace */ - dst =ip6_dst_lookup_flow (ctl_sk, &fl6,NULL ); + dst =ip6_dst_lookup_flow (sock_net (ctl_sk), ctl_sk, &fl6,NULL );if (!IS_ERR (dst)) {skb_dst_set (buff, dst);ip6_xmit (ctl_sk, buff, &fl6, fl6.flowi6_mark,NULL , tclass);
net/l2tp/l2tp_ip6.c +1 -1
@@ -615,7 +615,7 @@ static int l2tp_ip6_sendmsg(struct sock *sk, struct msghdr *msg, size_t len) fl6.flowlabel =ip6_make_flowinfo (ipc6.tclass, fl6.flowlabel); - dst =ip6_dst_lookup_flow (sk, &fl6, final_p); + dst =ip6_dst_lookup_flow (sock_net (sk), sk, &fl6, final_p);if (IS_ERR (dst)) { err =PTR_ERR (dst); goto out;
net/mpls/af_mpls.c +3 -4
@@ -617,16 +617,15 @@ static struct net_device *inet6_fib_lookup_dev(struct net *net,struct net_device *dev;struct dst_entry *dst;struct flowi6 fl6; -int err;if (!ipv6_stub)return ERR_PTR (-EAFNOSUPPORT );memset (&fl6,0 ,sizeof (fl6));memcpy (&fl6.daddr, addr,sizeof (struct in6_addr )); - err = ipv6_stub->ipv6_dst_lookup (net,NULL , &dst, &fl6); -if (err) -return ERR_PTR (err); + dst = ipv6_stub->ipv6_dst_lookup_flow (net,NULL , &fl6,NULL ); +if (IS_ERR (dst)) +return ERR_CAST (dst); dev = dst->dev;dev_hold (dev);
net/openvswitch/actions.c +4 -2
@@ -166,7 +166,8 @@ static int push_mpls(struct sk_buff *skb, struct sw_flow_key *key,int err; err =skb_mpls_push (skb, mpls->mpls_lse, mpls->mpls_ethertype, - skb->mac_len); + skb->mac_len, +ovs_key_mac_proto (key) ==MAC_PROTO_ETHERNET );if (err)return err;
@@ -179,7 +180,8 @@ static int pop_mpls(struct sk_buff *skb, struct sw_flow_key *key, {int err; - err =skb_mpls_pop (skb, ethertype, skb->mac_len); + err =skb_mpls_pop (skb, ethertype, skb->mac_len, +ovs_key_mac_proto (key) ==MAC_PROTO_ETHERNET );if (err)return err;
net/openvswitch/conntrack.c +11 -0
@@ -903,6 +903,17 @@ static int ovs_ct_nat(struct net *net, struct sw_flow_key *key, } err =ovs_ct_nat_execute (skb, ct, ctinfo, &info->range, maniptype); +if (err ==NF_ACCEPT && + ct->status &IPS_SRC_NAT && ct->status &IPS_DST_NAT ) { +if (maniptype ==NF_NAT_MANIP_SRC ) + maniptype =NF_NAT_MANIP_DST ; +else + maniptype =NF_NAT_MANIP_SRC ; + + err =ovs_ct_nat_execute (skb, ct, ctinfo, &info->range, + maniptype); + } +/* Mark NAT done if successful and update the flow key. */ if (err ==NF_ACCEPT )ovs_nat_update_key (key, skb, maniptype);
net/sched/act_mpls.c +5 -2
@@ -1,6 +1,7 @@// SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) /* Copyright (C) 2019 Netronome Systems, Inc. */ +#include <linux/if_arp.h> #include <linux/init.h> #include <linux/kernel.h> #include <linux/module.h>
@@ -76,12 +77,14 @@ static int tcf_mpls_act(struct sk_buff *skb, const struct tc_action *a,switch (p->tcfm_action) {case TCA_MPLS_ACT_POP : -if (skb_mpls_pop (skb, p->tcfm_proto, mac_len)) +if (skb_mpls_pop (skb, p->tcfm_proto, mac_len, + skb->dev && skb->dev->type ==ARPHRD_ETHER )) goto drop;break ;case TCA_MPLS_ACT_PUSH : new_lse =tcf_mpls_get_lse (NULL , p, !eth_p_mpls (skb->protocol)); -if (skb_mpls_push (skb, new_lse, p->tcfm_proto, mac_len)) +if (skb_mpls_push (skb, new_lse, p->tcfm_proto, mac_len, + skb->dev && skb->dev->type ==ARPHRD_ETHER )) goto drop;break ;case TCA_MPLS_ACT_MODIFY :
net/sched/sch_mq.c +1 -0
@@ -153,6 +153,7 @@ static int mq_dump(struct Qdisc *sch, struct sk_buff *skb)__gnet_stats_copy_queue (&sch->qstats, qdisc->cpu_qstats, &qdisc->qstats, qlen); + sch->q.qlen += qlen; }else { sch->q.qlen += qdisc->q.qlen; sch->bstats.bytes += qdisc->bstats.bytes;
net/sched/sch_mqprio.c +2 -1
@@ -411,6 +411,7 @@ static int mqprio_dump(struct Qdisc *sch, struct sk_buff *skb)__gnet_stats_copy_queue (&sch->qstats, qdisc->cpu_qstats, &qdisc->qstats, qlen); + sch->q.qlen += qlen; }else { sch->q.qlen += qdisc->q.qlen; sch->bstats.bytes += qdisc->bstats.bytes;
@@ -433,7 +434,7 @@ static int mqprio_dump(struct Qdisc *sch, struct sk_buff *skb) opt.offset[tc] = dev->tc_to_txq[tc].offset; } -if (nla_put (skb,TCA_OPTIONS ,NLA_ALIGN (sizeof (opt)), &opt)) +if (nla_put (skb,TCA_OPTIONS ,sizeof (opt), &opt)) goto nla_put_failure; if ((priv->flags & TC_MQPRIO_F_MODE) &&
net/sctp/ipv6.c +2 -2
@@ -275,7 +275,7 @@ static void sctp_v6_get_dst(struct sctp_transport *t, union sctp_addr *saddr, final_p =fl6_update_dst (fl6,rcu_dereference (np->opt), &final);rcu_read_unlock (); - dst =ip6_dst_lookup_flow (sk, fl6, final_p); + dst =ip6_dst_lookup_flow (sock_net (sk), sk, fl6, final_p);if (!asoc || saddr) goto out;
@@ -328,7 +328,7 @@ static void sctp_v6_get_dst(struct sctp_transport *t, union sctp_addr *saddr, fl6->saddr = laddr->a.v6.sin6_addr; fl6->fl6_sport = laddr->a.v6.sin6_port; final_p =fl6_update_dst (fl6,rcu_dereference (np->opt), &final); - bdst =ip6_dst_lookup_flow (sk, fl6, final_p); + bdst =ip6_dst_lookup_flow (sock_net (sk), sk, fl6, final_p);if (IS_ERR (bdst))continue ;
net/tipc/core.c +15 -14
@@ -122,14 +122,6 @@ static int __init tipc_init(void) sysctl_tipc_rmem[1 ] =RCVBUF_DEF ; sysctl_tipc_rmem[2 ] =RCVBUF_MAX ; - err =tipc_netlink_start (); -if (err) - goto out_netlink; - - err =tipc_netlink_compat_start (); -if (err) - goto out_netlink_compat; - err =tipc_register_sysctl ();if (err) goto out_sysctl;
@@ -150,8 +142,21 @@ static int __init tipc_init(void)if (err) goto out_bearer; + err =tipc_netlink_start (); +if (err) + goto out_netlink; + + err =tipc_netlink_compat_start (); +if (err) + goto out_netlink_compat; +pr_info ("Started in single node mode\n" );return 0 ; + +out_netlink_compat: +tipc_netlink_stop (); +out_netlink: +tipc_bearer_cleanup (); out_bearer:unregister_pernet_device (&tipc_topsrv_net_ops); out_pernet_topsrv:
@@ -161,22 +166,18 @@ static int __init tipc_init(void) out_pernet:tipc_unregister_sysctl (); out_sysctl: -tipc_netlink_compat_stop (); -out_netlink_compat: -tipc_netlink_stop (); -out_netlink:pr_err ("Unable to start in single node mode\n" );return err; } static void __exit tipc_exit(void) { +tipc_netlink_compat_stop (); +tipc_netlink_stop ();tipc_bearer_cleanup ();unregister_pernet_device (&tipc_topsrv_net_ops);tipc_socket_stop ();unregister_pernet_device (&tipc_net_ops); -tipc_netlink_stop (); -tipc_netlink_compat_stop ();tipc_unregister_sysctl ();pr_info ("Deactivated\n" );
net/tipc/udp_media.c +6 -3
@@ -195,10 +195,13 @@ static int tipc_udp_xmit(struct net *net, struct sk_buff *skb, .saddr = src->ipv6, .flowi6_proto = IPPROTO_UDP }; - err = ipv6_stub->ipv6_dst_lookup (net, ub->ubsock->sk, - &ndst, &fl6); -if (err) + ndst = ipv6_stub->ipv6_dst_lookup_flow (net, + ub->ubsock->sk, + &fl6,NULL ); +if (IS_ERR (ndst)) { + err =PTR_ERR (ndst); goto tx_error; + }dst_cache_set_ip6 (cache, ndst, &fl6.saddr); } ttl =ip6_dst_hoplimit (ndst);
net/tls/tls_device.c +4 -4
@@ -385,7 +385,7 @@ static int tls_push_data(struct sock *sk,if (flags & ~(MSG_MORE |MSG_DONTWAIT |MSG_NOSIGNAL |MSG_SENDPAGE_NOTLAST )) -return -ENOTSUPP ; +return -EOPNOTSUPP ;if (sk->sk_err)return -sk->sk_err;
@@ -519,7 +519,7 @@ int tls_device_sendpage(struct sock *sk, struct page *page,lock_sock (sk);if (flags &MSG_OOB ) { - rc = -ENOTSUPP ; + rc = -EOPNOTSUPP ; goto out; }
@@ -961,7 +961,7 @@ int tls_set_device_offload(struct sock *sk, struct tls_context *ctx) }if (!(netdev->features &NETIF_F_HW_TLS_TX )) { - rc = -ENOTSUPP ; + rc = -EOPNOTSUPP ; goto release_netdev; }
@@ -1034,7 +1034,7 @@ int tls_set_device_offload_rx(struct sock *sk, struct tls_context *ctx) }if (!(netdev->features &NETIF_F_HW_TLS_RX )) { - rc = -ENOTSUPP ; + rc = -EOPNOTSUPP ; goto release_netdev; }
net/tls/tls_main.c +2 -2
@@ -473,7 +473,7 @@ static int do_tls_setsockopt_conf(struct sock *sk, char __user *optval,/* check version */ if (crypto_info->version !=TLS_1_2_VERSION && crypto_info->version !=TLS_1_3_VERSION ) { - rc = -ENOTSUPP ; + rc = -EINVAL ; goto err_crypto_info; }
@@ -782,7 +782,7 @@ static int tls_init(struct sock *sk)* share the ulp context. */ if (sk->sk_state !=TCP_ESTABLISHED ) -return -ENOTSUPP ; +return -ENOTCONN ;tls_build_proto (sk);
net/tls/tls_sw.c +4 -4
@@ -900,7 +900,7 @@ int tls_sw_sendmsg(struct sock *sk, struct msghdr *msg, size_t size)int ret =0 ;if (msg->msg_flags & ~(MSG_MORE |MSG_DONTWAIT |MSG_NOSIGNAL )) -return -ENOTSUPP ; +return -EOPNOTSUPP ;mutex_lock (&tls_ctx->tx_lock);lock_sock (sk);
@@ -1215,7 +1215,7 @@ int tls_sw_sendpage_locked(struct sock *sk, struct page *page,if (flags & ~(MSG_MORE |MSG_DONTWAIT |MSG_NOSIGNAL |MSG_SENDPAGE_NOTLAST |MSG_SENDPAGE_NOPOLICY |MSG_NO_SHARED_FRAGS )) -return -ENOTSUPP ; +return -EOPNOTSUPP ;return tls_sw_do_sendpage (sk, page, offset, size, flags); }
@@ -1228,7 +1228,7 @@ int tls_sw_sendpage(struct sock *sk, struct page *page,if (flags & ~(MSG_MORE |MSG_DONTWAIT |MSG_NOSIGNAL |MSG_SENDPAGE_NOTLAST |MSG_SENDPAGE_NOPOLICY )) -return -ENOTSUPP ; +return -EOPNOTSUPP ;mutex_lock (&tls_ctx->tx_lock);lock_sock (sk);
@@ -1928,7 +1928,7 @@ ssize_t tls_sw_splice_read(struct socket *sock, loff_t *ppos,/* splice does not support reading control messages */ if (ctx->control !=TLS_RECORD_TYPE_DATA ) { - err = -ENOTSUPP ; + err = -EINVAL ; goto splice_read_end; }
tools/testing/selftests/net/tls.c +2 -6
@@ -25,10 +25,6 @@#define TLS_PAYLOAD_MAX_LEN 16384#define SOL_TLS 282 -#ifndef ENOTSUPP -#define ENOTSUPP 524 -#endif -FIXTURE (tls_basic) {int fd, cfd;
@@ -1205,11 +1201,11 @@ TEST(non_established) {/* TLS ULP not supported */ if (errno ==ENOENT )return ; -EXPECT_EQ (errno,ENOTSUPP ); +EXPECT_EQ (errno,ENOTCONN ); ret =setsockopt (sfd,IPPROTO_TCP ,TCP_ULP ,"tls" ,sizeof ("tls" ));EXPECT_EQ (ret,-1 ); -EXPECT_EQ (errno,ENOTSUPP ); +EXPECT_EQ (errno,ENOTCONN ); ret =getsockname (sfd, &addr, &len);ASSERT_EQ (ret,0 );