Page MenuHomeFreeBSD

Disallow fcntl(F_READAHEAD) when the vnode is not a regular file.
ClosedPublic

Authored by markj on Oct 1 2019, 8:19 PM.
Tags
None
Referenced Files
F174906375: D21864.id62809.diff
Tue, Oct 6, 9:41 PM
F174892103: D21864.id62807.diff
Tue, Oct 6, 7:33 PM
F174887772: D21864.id62837.diff
Tue, Oct 6, 6:57 PM
F174793544: D21864.diff
Tue, Oct 6, 12:57 AM
Unknown Object (File)
Mon, Oct 5, 5:48 PM
Unknown Object (File)
Mon, Oct 5, 5:43 PM
Unknown Object (File)
Mon, Oct 5, 5:42 PM
Unknown Object (File)
Mon, Oct 5, 4:02 AM
Subscribers

Details

Summary

f_iosize is 0 for devfs vnodes, resulting in a divide by zero if one
calls, for example, fcntl(STDIN_FILENO, F_READAHEAD, 4096).

The sequential heuristic is not applied to I/O to or from device files,
and posix_fadvise(2) returns an error for v_type != VREG, so do the same
here too.

Diff Detail

Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 26817
Build 25151: arc lint + arc unit