Page MenuHomeFreeBSD

aio: Fix up the opcode in aiocb32_copyin()
ClosedPublic

Authored by markj on Sep 11 2021, 4:24 PM.
Tags
None
Referenced Files
Unknown Object (File)
Fri, Apr 19, 9:58 AM
Unknown Object (File)
Fri, Apr 19, 8:02 AM
Unknown Object (File)
Fri, Apr 19, 7:49 AM
Unknown Object (File)
Tue, Apr 16, 11:03 AM
Unknown Object (File)
Feb 21 2024, 2:53 PM
Unknown Object (File)
Feb 11 2024, 5:28 AM
Unknown Object (File)
Jan 29 2024, 4:51 PM
Unknown Object (File)
Dec 26 2023, 11:31 PM
Subscribers

Details

Summary

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, we need to dynamically allocate a uio to
wrap the 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
Fixes: f30a1ae8d529 ("lio_listio(2): Allow LIO_READV and LIO_WRITEV.")

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable