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
F160707503: D31914.id94980.diff
Sat, Jun 27, 12:43 AM
Unknown Object (File)
Thu, Jun 25, 4:50 AM
Unknown Object (File)
Thu, Jun 25, 4:26 AM
Unknown Object (File)
Mon, Jun 22, 5:30 PM
Unknown Object (File)
Sat, Jun 20, 5:46 PM
Unknown Object (File)
Tue, Jun 2, 8:48 PM
Unknown Object (File)
Sun, May 31, 9:53 PM
Unknown Object (File)
May 17 2026, 5:25 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
rS FreeBSD src repository - subversion
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 41468
Build 38357: arc lint + arc unit