1
0
mirror of https://git.FreeBSD.org/src.git synced 2025-01-08 13:28:05 +00:00
freebsd/sys
Mark Johnston 141fe2dcee aio: Interlock with listen(2)
soo_aio_queue() did not handle the possibility that the provided socket
is a listening socket.  Up until recently, to fix this one would have to
acquire the socket lock first and check, since the socket buffer locks
were destroyed by listen(2).

Now that the socket buffer locks belong to the socket, simply check
SOLISTENING(so) after acquiring them, and make listen(2) return an error
if any AIO jobs are enqueued on the socket.

Add a couple of simple regression test cases.

Note that this fixes things only for the default AIO implementation;
cxgbe(4)'s TCP offload has a separate pru_aio_queue implementation which
requires its own solution.

Reported by:	syzbot+c8aa122fa2c6a4e2a28b@syzkaller.appspotmail.com
Reported by:	syzbot+39af117d43d4f0faf512@syzkaller.appspotmail.com
Reported by:	syzbot+60cceb9569145a0b993b@syzkaller.appspotmail.com
Reported by:	syzbot+2d522c5db87710277ca5@syzkaller.appspotmail.com
Reviewed by:	tuexen, gallatin, jhb
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D31901
2021-09-10 17:21:11 -04:00
..
amd64 vmd(4): Major driver refactoring 2021-09-02 20:58:02 -04:00
arm Revert "arm: Bump KSTACK_PAGES default to match i386/amd64" 2021-09-01 13:13:27 -07:00
arm64 qoriq_dw_pci: Fix typo in link status checking code 2021-08-31 06:22:33 +02:00
bsm Add fspacectl(2), vn_deallocate(9) and VOP_DEALLOCATE(9). 2021-08-05 23:20:42 +08:00
cam ses: Guard the elm_type_names declaration by _KERNEL 2021-09-02 14:47:18 -06:00
cddl kern: drop remaining references to removed makesyscalls.sh 2021-09-09 19:40:54 -05:00
compat syscalls.master: switch to CAPENABLED flags 2021-09-01 21:58:16 +01:00
conf vmd(4): Major driver refactoring 2021-09-02 20:58:02 -04:00
contrib zfs: merge openzfs/zfs@3b89d9518 (master) into main 2021-08-31 09:02:21 +02:00
crypto crypto(4): Fix a few typos in camellia.c 2021-09-04 13:02:11 +02:00
ddb Create sys/reg.h for the common code previously in machine/reg.h 2021-08-30 12:50:53 +01:00
dev wpi: Fix a lock leak in an error path in wpi_run() 2021-09-10 10:03:51 -04:00
dts Remove "All Rights Reserved" from FreeBSD Foundation sys/ copyrights 2021-08-08 10:42:24 -04:00
fs nfsd: Fix build after commit 103b207536 for 32bit arches 2021-09-08 18:55:06 -07:00
gdb
geom g_label: Handle small sector sizes when tasting 2021-09-07 11:19:29 -04:00
gnu
i386 vmd(4): Major driver refactoring 2021-09-02 20:58:02 -04:00
isa
kern aio: Interlock with listen(2) 2021-09-10 17:21:11 -04:00
kgssapi
libkern libkern: remove bcopy 2021-08-24 11:24:07 +00:00
mips Fix a common typo in source code comments 2021-09-04 12:56:57 +02:00
modules vmd(4): Major driver refactoring 2021-09-02 20:58:02 -04:00
net pf: qid and pqid can be uint16_t 2021-09-10 17:07:57 +02:00
net80211 net80211: add func/line information to IEEE80211_DISCARD* macros 2021-09-04 09:24:51 +00:00
netgraph ng_l2tp: improve callout locking. 2021-09-10 11:27:19 -07:00
netinet net: Fix memory leaks upon arp_fillheader() failures 2021-09-10 09:45:26 -04:00
netinet6 ip6mrouter: Make the expiration callout MPSAFE 2021-09-07 11:19:29 -04:00
netipsec ipsec: Validate the protocol identifier in ipsec4_ctlinput() 2021-09-10 09:09:00 -04:00
netpfil pf: fix NOINET6 builds 2021-09-10 18:15:44 +02:00
netsmb
nfs
nfsclient
nfsserver
nlm
ofed socket: Rename sb(un)lock() and interlock with listen(2) 2021-09-07 15:06:48 -04:00
opencrypto ktls: Support asynchronous dispatch of AEAD ciphers. 2021-08-30 13:11:52 -07:00
powerpc powerpc64: fix radix on pseries TLB invalidation 2021-09-08 08:37:11 -03:00
riscv sifive_spi: Add missing case for SPIBUS_MODE_NONE 2021-08-30 23:38:02 +01:00
rpc Fix a common typo in source code comments 2021-09-04 12:56:57 +02:00
security Add fspacectl(2), vn_deallocate(9) and VOP_DEALLOCATE(9). 2021-08-05 23:20:42 +08:00
sys socket: Add macros to lock socket buffers using socket references 2021-09-10 17:20:39 -04:00
teken
tests routing: add IPv6 fib validation procedure. 2021-08-16 23:04:01 +00:00
tools makesyscalls.lua: add a CAPENABLED flag 2021-09-01 21:58:06 +01:00
ufs ffs: remove unused thread argument from ffs_reload() 2021-09-04 12:25:10 -08:00
vm swap_pager: Handle large swap_pager_reserve() requests 2021-09-07 14:04:50 -04:00
x86 x86/tsc.c: Add TSLOG to test_tsc 2021-09-09 17:02:15 -07:00
xdr
xen
Makefile