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)
Dec 25 2023, 3:07 PM
Unknown Object (File)
Dec 22 2023, 10:41 PM
Unknown Object (File)
Dec 12 2023, 12:19 AM
Unknown Object (File)
Sep 25 2023, 7:08 PM
Unknown Object (File)
Sep 6 2023, 8:38 PM
Unknown Object (File)
Sep 1 2023, 2:27 PM
Unknown Object (File)
Jul 9 2023, 7:34 PM
Unknown Object (File)
May 27 2023, 5:03 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