freebsd-dev/sys/security/mac
Gleb Smirnoff 08d9c92027 tcp_input/syncache: acquire only read lock on PCB for SYN,!ACK packets
When packet is a SYN packet, we don't need to modify any existing PCB.
Normally SYN arrives on a listening socket, we either create a syncache
entry or generate syncookie, but we don't modify anything with the
listening socket or associated PCB. Thus create a new PCB lookup
mode - rlock if listening. This removes the primary contention point
under SYN flood - the listening socket PCB.

Sidenote: when SYN arrives on a synchronized connection, we still
don't need write access to PCB to send a challenge ACK or just to
drop. There is only one exclusion - tcptw recycling. However,
existing entanglement of tcp_input + stacks doesn't allow to make
this change small. Consider this patch as first approach to the problem.

Reviewed by:	rrs
Differential revision:	https://reviews.freebsd.org/D29576
2021-04-12 08:25:31 -07:00
..
mac_audit.c
mac_cred.c
mac_framework.c mac: cheaper check for mac_vnode_check_readlink 2021-01-08 13:57:10 +00:00
mac_framework.h mac: cheaper check for mac_vnode_check_readlink 2021-01-08 13:57:10 +00:00
mac_inet6.c
mac_inet.c tcp_input/syncache: acquire only read lock on PCB for SYN,!ACK packets 2021-04-12 08:25:31 -07:00
mac_internal.h security: clean up empty lines in .c and .h files 2020-09-01 21:26:00 +00:00
mac_label.c security: clean up empty lines in .c and .h files 2020-09-01 21:26:00 +00:00
mac_net.c
mac_pipe.c pipe: allow for lockless pipe_stat 2020-11-19 06:30:25 +00:00
mac_policy.h
mac_posix_sem.c
mac_posix_shm.c
mac_priv.c mac: implement fast path for checks 2020-02-13 22:19:17 +00:00
mac_process.c vfs: drop the mostly unused flags argument from VOP_UNLOCK 2020-01-03 22:29:58 +00:00
mac_socket.c security: clean up empty lines in .c and .h files 2020-09-01 21:26:00 +00:00
mac_syscalls.c Convert remaining cap_rights_init users to cap_rights_init_one 2021-01-12 13:16:10 +00:00
mac_system.c
mac_sysv_msg.c
mac_sysv_sem.c
mac_sysv_shm.c
mac_vfs.c Add a comment on why the call to mac_vnode_relabel() might be in the wrong 2021-02-27 16:25:26 +00:00