freebsd-dev/tests/sys/aio
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
..
aio_kqueue_test.c Revert r337929 2018-08-16 22:04:00 +00:00
aio_test.c aio: Interlock with listen(2) 2021-09-10 17:21:11 -04:00
lio_kqueue_test.c Revert r337929 2018-08-16 22:04:00 +00:00
lio_test.c lio_listio(2): Allow LIO_READV and LIO_WRITEV. 2021-08-22 23:00:42 +12:00
local.h
Makefile Do a sweep and remove most WARNS=6 settings 2020-10-01 01:10:51 +00:00
Makefile.depend DIRDEPS_BUILD: Update dependencies. 2017-10-31 00:07:04 +00:00