WSL2-Linux-Kernel/include/net
Xin Long 68ba446395 sctp: add a refcnt in sctp_stream_priorities to avoid a nested loop
With this refcnt added in sctp_stream_priorities, we don't need to
traverse all streams to check if the prio is used by other streams
when freeing one stream's prio in sctp_sched_prio_free_sid(). This
can avoid a nested loop (up to 65535 * 65535), which may cause a
stuck as Ying reported:

    watchdog: BUG: soft lockup - CPU#23 stuck for 26s! [ksoftirqd/23:136]
    Call Trace:
     <TASK>
     sctp_sched_prio_free_sid+0xab/0x100 [sctp]
     sctp_stream_free_ext+0x64/0xa0 [sctp]
     sctp_stream_free+0x31/0x50 [sctp]
     sctp_association_free+0xa5/0x200 [sctp]

Note that it doesn't need to use refcount_t type for this counter,
as its accessing is always protected under the sock lock.

v1->v2:
 - add a check in sctp_sched_prio_set to avoid the possible prio_head
   refcnt overflow.

Fixes: 9ed7bfc795 ("sctp: fix memory leak in sctp_stream_outq_migrate()")
Reported-by: Ying Xu <yinxu@redhat.com>
Acked-by: Marcelo Ricardo Leitner <marcelo.leitner@gmail.com>
Signed-off-by: Xin Long <lucien.xin@gmail.com>
Link: https://lore.kernel.org/r/825eb0c905cb864991eba335f4a2b780e543f06b.1677085641.git.lucien.xin@gmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2023-02-23 12:59:40 -08:00
..
9p
bluetooth Bluetooth: MGMT: add CIS feature bits to controller information 2023-02-09 14:18:27 -08:00
caif
iucv
mana net: mana: Fix IRQ name - add PCI and queue number 2023-01-20 18:17:17 -08:00
netfilter Merge git://git.kernel.org/pub/scm/linux/kernel/git/netfilter/nf-next 2023-02-20 10:53:56 +00:00
netns Merge git://git.kernel.org/pub/scm/linux/kernel/git/netfilter/nf 2023-02-22 21:25:23 -08:00
nfc
phonet
sctp sctp: add a refcnt in sctp_stream_priorities to avoid a nested loop 2023-02-23 12:59:40 -08:00
tc_act net/sched: act_connmark: transition to percpu stats and rcu 2023-02-16 10:39:28 +01:00
6lowpan.h
Space.h
act_api.h net/sched: Rename user cookie and act cookie 2023-02-20 16:46:10 -08:00
addrconf.h
af_ieee802154.h
af_rxrpc.h rxrpc: Tidy up abort generation infrastructure 2023-01-06 09:43:32 +00:00
af_unix.h
af_vsock.h
ah.h
amt.h
arp.h
atmclip.h
ax25.h
ax88796.h
bareudp.h
bond_3ad.h
bond_alb.h
bond_options.h
bonding.h
bpf_sk_storage.h
busy_poll.h
calipso.h
cfg80211-wext.h
cfg80211.h wifi: cfg80211: remove gfp parameter from cfg80211_obss_color_collision_notify description 2023-02-15 18:28:52 +01:00
cfg802154.h ieee802154: Add support for user beaconing requests 2023-01-28 13:51:22 +01:00
checksum.h net: checksum: drop the linux/uaccess.h include 2023-01-27 11:19:46 +00:00
cipso_ipv4.h
cls_cgroup.h
codel.h
codel_impl.h
codel_qdisc.h
compat.h
datalink.h
dcbevent.h
dcbnl.h net: dcb: add helper functions to retrieve PCP and DSCP rewrite maps 2023-01-20 09:33:22 +00:00
devlink.h devlink: fix the name of value arg of devl_param_driverinit_value_get() 2023-02-13 09:49:14 +00:00
dropreason.h ipv6: icmp6: add SKB_DROP_REASON_IPV6_NDISC_NS_OTHERHOST 2023-02-20 08:54:23 +00:00
dsa.h net: dsa: add plumbing for changing and getting MAC merge layer state 2023-01-23 12:44:18 +00:00
dsfield.h
dst.h
dst_cache.h
dst_metadata.h
dst_ops.h ipv6: remove max_size check inline with ipv4 2023-01-13 20:59:14 -08:00
erspan.h
esp.h
espintcp.h
ethoc.h
failover.h
fib_notifier.h
fib_rules.h
firewire.h
flow.h net: remove unnecessary includes from net/flow.h 2023-01-27 11:19:46 +00:00
flow_dissector.h
flow_offload.h net/sched: cls_api: Support hardware miss to tc action 2023-02-20 16:46:10 -08:00
fou.h
fq.h
fq_impl.h
garp.h
gen_stats.h
genetlink.h
geneve.h
gre.h
gro.h
gro_cells.h
gtp.h
gue.h
hwbm.h
icmp.h
ieee80211_radiotap.h
ieee802154_netdev.h mac802154: Handle basic beaconing 2023-01-28 13:55:10 +01:00
if_inet6.h
ife.h
ila.h
inet6_connection_sock.h
inet6_hashtables.h
inet_common.h
inet_connection_sock.h
inet_dscp.h
inet_ecn.h
inet_frag.h
inet_hashtables.h tcp: Add TIME_WAIT sockets in bhash2. 2022-12-30 07:25:52 +00:00
inet_sock.h inet: Add IP_LOCAL_PORT_RANGE socket option 2023-01-25 22:45:00 -08:00
inet_timewait_sock.h tcp: Add TIME_WAIT sockets in bhash2. 2022-12-30 07:25:52 +00:00
inetpeer.h
ioam6.h
ip.h inet: Add IP_LOCAL_PORT_RANGE socket option 2023-01-25 22:45:00 -08:00
ip6_checksum.h
ip6_fib.h
ip6_route.h ipv6: Make ip6_route_output_flags_noref() static. 2023-01-24 18:12:52 -08:00
ip6_tunnel.h
ip_fib.h
ip_tunnels.h
ip_vs.h ipvs: avoid kfree_rcu without 2nd arg 2023-02-02 14:02:01 +01:00
ipcomp.h
ipconfig.h
ipv6.h ipv6: icmp6: add drop reason support to icmpv6_notify() 2023-02-13 19:55:32 -08:00
ipv6_frag.h
ipv6_stubs.h
iw_handler.h
kcm.h
l3mdev.h
lag.h
lapb.h
lib80211.h
llc.h
llc_c_ac.h
llc_c_ev.h
llc_c_st.h
llc_conn.h
llc_if.h
llc_pdu.h
llc_s_ac.h
llc_s_ev.h
llc_s_st.h
llc_sap.h
lwtunnel.h
mac80211.h wifi: mac80211: configure puncturing bitmap 2023-02-14 12:17:22 +01:00
mac802154.h
macsec.h
mctp.h
mctpdevice.h
mip6.h
mld.h
mpls.h
mpls_iptunnel.h
mptcp.h mptcp: remove MPTCP 'ifdef' in TCP SYN cookies 2022-12-12 13:11:24 -08:00
mrp.h
ncsi.h
ndisc.h ipv6: icmp6: add drop reason support to ndisc_rcv() 2023-02-13 19:55:32 -08:00
neighbour.h
net_debug.h
net_failover.h
net_namespace.h
net_ratelimit.h
net_trackers.h
netevent.h
netlabel.h
netlink.h net: netlink: recommend policy range validation 2023-01-28 00:33:51 -08:00
netprio_cgroup.h
netrom.h
nexthop.h
nl802154.h ieee802154: Add support for user beaconing requests 2023-01-28 13:51:22 +01:00
nsh.h
p8022.h
page_pool.h page_pool: add a comment explaining the fragment counter usage 2023-02-21 09:15:39 -08:00
pie.h
ping.h
pkt_cls.h net/sched: cls_api: Support hardware miss to tc action 2023-02-20 16:46:10 -08:00
pkt_sched.h net/sched: taprio: give higher priority to higher TCs in software dequeue mode 2023-02-08 09:48:52 +00:00
pptp.h
protocol.h
psample.h
psnap.h
raw.h raw: use net_hash_mix() in hash function 2023-02-03 19:56:23 -08:00
rawv6.h
red.h
regulatory.h
request_sock.h
rose.h
route.h net: add a couple of helpers for iph tot_len 2023-02-01 20:54:27 -08:00
rpl.h
rsi_91x.h
rtnetlink.h
rtnh.h
sch_generic.h net/sched: cls_api: Support hardware miss to tc action 2023-02-20 16:46:10 -08:00
scm.h
secure_seq.h
seg6.h
seg6_hmac.h
seg6_local.h
selftests.h
slhc_vj.h
smc.h net/smc: De-tangle ism and smc device initialization 2023-01-25 09:46:49 +00:00
snmp.h
sock.h Merge ra.kernel.org:/pub/scm/linux/kernel/git/netdev/net 2023-02-17 11:06:39 +00:00
sock_reuseport.h
stp.h
strparser.h
switchdev.h
tc_wrapper.h net/sched: Retire rsvp classifier 2023-02-16 09:27:07 +01:00
tcp.h bpf-next-for-netdev 2022-12-12 11:27:42 -08:00
tcp_states.h
timewait_sock.h
tipc.h
tls.h
tls_toe.h
transp_v6.h
tso.h net: tso: inline tso_count_descs() 2022-12-12 15:04:39 -08:00
tun_proto.h
udp.h
udp_tunnel.h
udplite.h
vsock_addr.h
vxlan.h
wext.h
x25.h
x25device.h
xdp.h drivers: net: turn on XDP features 2023-02-02 20:48:23 -08:00
xdp_priv.h
xdp_sock.h
xdp_sock_drv.h
xfrm.h bpf-next-for-netdev 2022-12-12 11:27:42 -08:00
xsk_buff_pool.h xsk: Add cb area to struct xdp_buff_xsk 2023-01-23 09:58:23 -08:00