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)
Thu, Oct 24, 2:52 AM
Unknown Object (File)
Thu, Oct 17, 1:50 PM
Unknown Object (File)
Oct 4 2024, 8:33 AM
Unknown Object (File)
Oct 3 2024, 2:31 PM
Unknown Object (File)
Oct 2 2024, 12:27 PM
Unknown Object (File)
Oct 1 2024, 5:35 PM
Unknown Object (File)
Sep 30 2024, 2:25 PM
Unknown Object (File)
Sep 30 2024, 12:04 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