Mark Johnston 2884918c73 aio: Fix up the opcode in aiocb32_copyin()
With lio_listio(2), the opcode is specified by userspace rather than
being hard-coded by the system call (e.g., aio_readv() -> LIO_READV).
kern_lio_listio() calls aio_aqueue() with an opcode of LIO_NOP, which
gets fixed up when the aiocb is copied in.

When copying in a job request for vectored I/O, we need to dynamically
allocate a uio to wrap an iovec.  So aiocb_copyin() needs to get the
opcode from the aiocb and then decide whether an allocation is required.
We failed to do this in the COMPAT_FREEBSD32 case.  Fix it.

Reported by:	syzbot+27eab6f2c2162f2885ee@syzkaller.appspotmail.com
Reviewed by:	kib, asomers
Fixes:	f30a1ae8d529 ("lio_listio(2):  Allow LIO_READV and LIO_WRITEV.")
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D31914
2021-09-11 12:58:41 -04:00
..
2021-09-02 20:58:02 -04:00
2021-09-02 20:58:02 -04:00
2021-09-11 20:04:52 +08:00
2021-09-02 20:58:02 -04:00
2021-08-24 11:24:07 +00:00
2021-09-02 20:58:02 -04:00
2021-09-10 17:07:57 +02:00
2021-09-10 18:15:44 +02:00
2021-09-11 20:04:52 +08:00
2021-09-09 17:02:15 -07:00