TencentOS-kernel/net
liuchun 302fd47008 raw: convert raw sockets to RCU
Upstream commit:0daf07e527095e64ee8927ce297ab626643e9f51
Upstream commit:af185d8c76333daa877678e0166a7b45e63bf3c4

Using rwlock in networking code is extremely risky.
writers can starve if enough readers are constantly
grabing the rwlock.

I thought rwlock were at fault and sent this patch:

https://lkml.org/lkml/2022/6/17/272

But Peter and Linus essentially told me rwlock had to be unfair.

We need to get rid of rwlock in networking code.

Without this fix, following script triggers soft lockups:

for i in {1..48}
do
 ping -f -n -q 127.0.0.1 &
 sleep 0.1
done

Conflicts: rewrite net/ipv4/raw.c net/ipv4/raw_diag.c net/ipv6/raw.c

Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2")
Signed-off-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Link: https://lore.kernel.org/r/20220620100509.3493504-1-eric.dumazet@gmail.com
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Signed-off-by: Chun Liu <kaicliu@tencent.com>
2022-11-03 14:14:19 +08:00
..
6lowpan Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
9p net: 9p: initialize sun_server.sun_path to have addr's value only when addr is valid 2021-03-16 16:39:51 +08:00
802 Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
8021q net: vlan: avoid leaks on register_vlan_dev() failures 2021-04-12 12:51:15 +08:00
appletalk appletalk: Fix skb allocation size in loopback case 2021-05-20 16:06:48 +08:00
atm atm: fix a memory leak of vcc->user_back 2021-03-16 16:37:15 +08:00
ax25 AX.25: Prevent integer overflows in connect and sendmsg 2021-03-16 16:32:42 +08:00
batman-adv batman-adv: initialize "struct batadv_tvlv_tt_vlan_data"->reserved field 2021-05-20 16:06:56 +08:00
bluetooth bluetooth: eliminate the potential race condition when removing the HCI controller 2021-05-20 16:07:38 +08:00
bpf bpf: Add selftests for BPF_MODIFY_RETURN 2022-08-30 11:33:31 +08:00
bpfilter net/bpfilter: remove superfluous testing message 2021-03-16 16:26:23 +08:00
bridge net: bridge: mcast: fix broken length + header check for MRDv6 Adv. 2021-05-20 16:08:01 +08:00
caif Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
can can: bcm: delay release of struct bcm_op after synchronize_rcu() 2022-09-27 10:29:35 +08:00
ceph libceph: clear con->out_msg on Policy::stateful_server faults 2021-03-16 16:40:11 +08:00
core net: bpf: disable the usage of bpf_dispatcher for XDP 2022-08-30 11:33:36 +08:00
dcb net: dcb: Accept RTM_GETDCB messages carrying set-like DCB commands 2021-04-12 12:51:30 +08:00
dccp inet_diag: Move the INET_DIAG_REQ_BYTECODE nlattr to cb->data 2022-08-30 11:33:28 +08:00
decnet Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
dns_resolver KEYS: Don't write out to userspace while holding key semaphore 2021-03-16 16:26:42 +08:00
dsa net: dsa: tag_mtk: fix 802.1ad VLAN egress 2021-04-12 12:53:14 +08:00
ethernet Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
hsr hsr: use netdev_err() instead of WARN_ONCE() 2021-05-20 16:07:38 +08:00
ieee802154 net: ieee802154: forbid monitor for add llsec seclevel 2021-05-20 16:07:10 +08:00
ife Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
ipv4 raw: convert raw sockets to RCU 2022-11-03 14:14:19 +08:00
ipv6 raw: convert raw sockets to RCU 2022-11-03 14:14:19 +08:00
iucv net/af_iucv: remove WARN_ONCE on malformed RX packets 2021-04-12 12:52:44 +08:00
kcm Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
key af_key: relax availability checks for skb size calculation 2021-04-12 12:51:58 +08:00
l2tp l2tp: remove skb_dst_set() from l2tp_xmit_skb() 2021-03-16 16:31:43 +08:00
l3mdev Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
lapb net: lapb: Copy the skb before sending a packet 2021-04-12 12:51:53 +08:00
llc net: silence data-races on sk_backlog.tail 2021-03-16 16:36:36 +08:00
mac80211 mac80211: bail out if cipher schemes are invalid 2021-05-20 16:07:57 +08:00
mac802154 net: mac802154: Fix general protection fault 2021-05-20 16:07:04 +08:00
mpls net: avoid infinite loop in mpls_gso_segment when mpls_hlen == 0 2021-04-12 12:52:56 +08:00
ncsi net/ncsi: Avoid channel_monitor hrtimer deadlock 2021-05-20 16:07:00 +08:00
netfilter netfilter: nf_tables: do not allow RULE_ID to refer to another chain 2022-08-31 16:52:05 +08:00
netlabel cipso,calipso: resolve a number of problems with the DOI refcounts 2021-04-12 12:52:59 +08:00
netlink bpf: Refactor bpf_iter_reg to have separate seq_info member 2022-08-30 11:33:28 +08:00
netrom net: netrom: Fix potential nr_neigh refcnt leak in nr_add_node 2021-03-16 16:26:51 +08:00
nfc net:nfc:digital: Fix a double free in digital_tg_recv_dep_req 2021-05-20 16:08:01 +08:00
nsh Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
openvswitch openvswitch: fix stack OOB read while fragmenting IPv4 packets 2021-05-20 16:07:33 +08:00
packet net/packet: fix packet_sock xmit return value checking 2022-08-08 14:58:13 +08:00
phonet Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
psample Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
qrtr net: qrtr: fix a kernel-infoleak in qrtr_recvmsg() 2021-04-12 12:53:32 +08:00
rds net/rds: Fix a use after free in rds_message_map_pages 2021-05-20 16:07:01 +08:00
rfkill rfkill: Fix use-after-free in rfkill_resume() 2021-03-16 16:41:16 +08:00
rose rose: Fix Null pointer dereference in rose_send_frame() 2021-03-16 16:41:52 +08:00
rxrpc rxrpc: Fix clearance of Tx/Rx ring when releasing a call 2021-04-12 12:52:05 +08:00
sched bpf: Add socket assign support 2022-08-30 11:33:23 +08:00
sctp inet_diag: Move the INET_DIAG_REQ_BYTECODE nlattr to cb->data 2022-08-30 11:33:28 +08:00
smc net/smc: fix direct access to ib_gid_addr->ndev in smc_ib_determine_gid() 2021-03-16 16:41:07 +08:00
strparser Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
sunrpc rpc: fix NULL dereference on kmalloc failure 2021-05-20 16:06:45 +08:00
switchdev net: switchdev: don't set port_obj_info->handled true when -EOPNOTSUPP 2021-04-12 12:51:48 +08:00
tipc net:tipc: Fix a double free in tipc_sk_mcast_rcv 2021-05-20 16:07:00 +08:00
tls net, sk_msg: Annotate lockless access to sk_prot on clone 2022-08-30 11:33:20 +08:00
toa net: csig toa patch 2022-04-06 16:55:16 +08:00
unix skbuff: fix a data race in skb_queue_len() 2021-03-16 16:36:50 +08:00
vmw_vsock vsock/vmci: log once the failed queue pair allocation 2021-05-20 16:07:59 +08:00
wimax Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
wireless cfg80211: scan: drop entry from hidden_list on overflow 2021-05-20 16:07:41 +08:00
x25 net/x25: prevent a couple of overflows 2021-03-16 16:41:56 +08:00
xdp xsk: Replace datagram_poll by sock_poll_wait 2021-03-16 16:42:25 +08:00
xfrm net: xfrm: Localize sequence counter per network namespace 2021-05-20 16:06:58 +08:00
Kconfig Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
Makefile Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
compat.c net/compat: Add missing sock updates for SCM_RIGHTS 2021-03-16 16:34:05 +08:00
socket.c net: Set fput_needed iff FDPUT_FPUT is set 2021-03-16 16:33:49 +08:00
sysctl_net.c Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00