Page MenuHomeFreeBSD

lio_listio: validate aio_lio_opcode
ClosedPublic

Authored by asomers on Jan 10 2021, 5:33 AM.
Tags
None
Referenced Files
Unknown Object (File)
Sat, Sep 21, 6:22 AM
Unknown Object (File)
Wed, Sep 18, 9:24 PM
Unknown Object (File)
Mon, Sep 16, 8:42 PM
Unknown Object (File)
Thu, Sep 5, 12:16 PM
Unknown Object (File)
Thu, Sep 5, 10:42 AM
Unknown Object (File)
Wed, Sep 4, 7:43 PM
Unknown Object (File)
Tue, Sep 3, 11:38 PM
Unknown Object (File)
Aug 20 2024, 12:02 AM
Subscribers

Details

Reviewers
tmunro
jhb
Group Reviewers
manpages
Summary

Previously, we would accept any kind of LIO_* opcode, including ones
that were intended for in-kernel use only like LIO_SYNC (which is not
defined in userland). The situation became more serious with
022ca2fc7fe08d51f33a1d23a9be49e6d132914e. After that revision, setting
aio_lio_opcode to LIO_WRITEV or LIO_READV would trigger an assertion.

Note that POSIX does not specify what should happen if aio_lio_opcode is
invalid.

MFC-with: 022ca2fc7fe08d51f33a1d23a9be49e6d132914e

Test Plan

test case added

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 36080
Build 32969: arc lint + arc unit

Event Timeline

0mp added a subscriber: 0mp.

OK from manpages.

jhb added inline comments.
lib/libc/sys/aio_return.2
81

I would perhaps simplify this to just:

The I/O operation was submitted with
.Fn lio_listio ,
and the value of
.Fa aio_lio_opcode
is invalid.
tests/sys/aio/lio_test.c
241

It is perhaps better to call aio_error() here instead of aio_return(). lio_listio()'s man page says to call aio_error().

This revision is now accepted and ready to land.Jan 11 2021, 10:07 PM