Page MenuHomeFreeBSD

lio_listio: validate aio_lio_opcode
ClosedPublic

Authored by asomers on Sun, Jan 10, 5:33 AM.

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 OK
Unit
No Unit 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.Mon, Jan 11, 10:07 PM